Java – do you have to know the machine architecture for writing code?
Suppose I use Java or Python or C programming to solve a simple problem, which may be to build a TCP / UDP loopback server or calculate factorial Do I care about the architectural details, that is, whether it is 32-bit or 64 bit?
With all due respect, I don't have to worry about 32 or 64 bits unless I'm writing something related to something quite low-level What's wrong with me? Or am I right???
Solution
Most of the cases are correct
Unless you deal directly with word size or low - level binaries, the Runtime / language / compiler abstracts these details
Even byte order is abstracted by the NIC / network stack in the kernel It is translated for you When writing sockets in C, sometimes you have to deal with the byte ordering of the network when sending data... But this does not involve 32 or 64 bit differences
When dealing with binary data blobs, mapping them from one architecture to another (for example, as an overlay of C Architecture) may cause problems mentioned by others, but this is why we develop architecture independent protocols based on characters and so on
Facts like Java run in a virtual machine, which abstracts the machine one step!
Understanding the instruction set of architecture and how to compile syntax can help you understand the platform and write clearer and stricter code I know I will make faces at some old c code after learning the compiler!