3 ms·
Why do corporations spend resources in mounting the JRE to their devices? Wouldn't it be much simpler to use the instruction set of the hardware and write stuff
by moccajoghurt 14y ago
Why do corporations spend resources in mounting the JRE to their devices? Wouldn't it be much simpler to use the instruction set of the hardware and write stuff in C / Assembly?
I am asking because my first language was Java and after learning C / gnu AS it feels much more comfortable to actually have control over the resources you are using than relying on the magic the JRE does for you.
- kd0amg 14y agoWith C, you don't just get to manage memory yourself -- you have to, which can become a distraction from the actual program logic.
- riobard 14y ago“it feels much more comfortable to actually have control over the resources you are using than relying on the magic the JRE does for you.” That's exactly the problem Java/JRE was trying to solve. People make mistakes. Given the large quantities of programers corporations hire, it is almost certain that mistakes, especially those dealing with hardware resources (e.g. memory), will happen. Java/JRE reduces a large part of them (e.g. memory allocation/deallocation due to GC) so corporations can hire average programers to do the majority of tedious tasks without blowing things (too much) off. You cannot have such guarantee with C/C++.
- blaabjerg 14y agoIn addition to the points made by riobard and kd0amg, using the JRE ensures that their engineers can write code that is as general purpose as possible. They won't have to rewrite large parts of the software if they want to deploy it to a different architecture/platform, for example. Leave the low level stuff to the JRE folks and spend your resources on doing stuff that directly makes you money or furthers your cause.
- moccajoghurt 14y agoThanks for explaining. The reasons sound quite obvious and I feel a little silly for asking in the first place.