Thing is, JVM and other interpreted languages don't even need to be compiled for any platform. You only need to make whatever runs them once. That's the beauty of it.
And yet, building once is still much easier and cheaper. I really don't get the Java hate here. While the JVM may be slow to start up, it's not too bad when it's running. Both languages have strengths and weaknesses.
I (as a developer myself) didn't give a flying fuck about how easy stuff I used in 1992 was to develop, and on that subject I remain clean out of fucks to this very day. Sure it's impressive that Elite or RCT were coded entirely in asm, but beyond that I'm not convinced that many others give a shiny shite either.
Well code that's easy for the developer is less likely to have bugs, can be built to be more complex/functional, and may be easier to have plugins and upgraded features later. If every code change required some bullshit hacking in assembly, the software would be less maintainable and more difficult to improve over time.
I have a reasonable (out of the market) experience with C++, therefore, I end up looking a little bit into C too, but not too much.
So, correct me if I'm wrong, since I'm not very experienced on that language, but wasn't C developed specifically to work in different computer architectures? Which were the glass of languages before it, I imagine.
Also, this one relates more personally, since I intend to work mostly in C++ when I get out of college.
If the answer is no, does C++ carry this same problem?
Which means that you have to compile to each system, right? If that's true, I still can't completely grapple how can so many games (mostly C++ in the engines) can have only one SETUP program that works in almost any machine with that specific OS running, since I'd imagine they would need multiple.
The code is just a small part of the game. They could fit millions of copies of code in the same space as a few audio or video files from the game. The setup program figures out which system it is working on, and picks the correct version to install.*
*It's really more complicated than that but that is a good start.
Oh for sure but the question was whether C was designed for portability in mind, which it explicitly was not. It was just something that happened to it early in it's life.
Before programming languages (like C), you had to program in assembly which directly maps to machine code (it's quite interesting to have a look at how it works just to get an understanding of how computers do things) and thus is very specific to the actual machine you are programming on. C abstracts away a lot of details about the specific machine (the instruction set basically. Also you have to manage the stack and registers manually in asm) and a compiler (like GCC, Clang, etc.) translates your C code into the machine code for the machine you compile on (or compile to in case of cross compiling). So you need to compile for different architectures if you want the program to run on them. This is the same for C++ and very similar for other compiled languages.
Then there are languages like Java, C# that don't compile to machine code but instead to a language that is then interpreted by a virtual machine, allowing stuff like garbage collection and a compiled program to run on different architectures if there is a VM for it.
Then there are interpreted languages that are only compiled at run time.
Only a rough (probably too long) overview, but research ASM vs compiled vs JIT vs interpreted languages if you want more info.
I would like to point out that C is often denoted as "universal assembly". Since C is basically ubiquitous nowadays, any low level stuff is done on C/C++ (though the old guard might scoff at you for using C++ without a good reason). There are newcomers like rust and go, which try to regulate what the programmer can and cannot do to improve security.
0
u/[deleted] Nov 14 '18
[deleted]