Programming Since 2007 · Author has 306 answers and 2M answer views · Updated 6y ·
- Short Answer: No! Now read the long answer.
- One of the biggest misconception in programming is regarding "Platform Independency".
- Languages are always platform independent. No language needs you to write different code for different OS or device. It is the executables which are platform dependent or independent.
- Though the compiled code in platform independent languages are independent, their run time environments are not platform independent. E.g. a Java compiled file is platform independent but each of the machine who wants to run that code needs JVM pre installed. And the JVM built for Linux will not be compatible with Windows and vice-versa. This is something like an mp3 file can run in any device but that device needs a compatible player pre-installed, and each device may need different installers if they're using different OSes.
- 'Framework' is not the same as the 'Language' and 'Independency' is not the same as 'Compability'. It is .NET framework that allows you to use C# language to develop a Web Application, Windows Desktop Application, Windows Phone Application etc.
- Thus C# language is compatible with all the above-mentioned platforms (Web, Desktop, Windows Phone), but it's not platform independent because its executables won't work with these platforms.
- What you're asking about is probably the executables. In that case, Short Answer: Yes!
- A C program results in .exe file. And an .exe file that runs on Windows won't run in other OSes.
- But there are several frameworks (e.g. Visual C++ for Windows Desktop Applications, Wt for Web Applications etc) which make it compatible for development of any platform.
Image Source: Google
33K views ·
View upvotes
· View 1 share
· Not for Reproduction · Answer requested by 1 of 13 answers
Something went wrong. Wait a moment and try again.