I am looking at some Java code for a JBed program in real time. I am not familiar with JBed yet.
The device has only 16 MB of RAM and the code is more like C ++. It rarely passes objects as return value and uses global variables, so the code is hard to understand.
Is this a necessary optimization due to the small amount or RAM available or with this excess RAM, can it be implemented in a βnormalβ way?
I understand that at some point, objects are likely to cause too much overhead, so Java is no longer suitable. If we go further, even C ++ causes too much overhead, and only C is an option (for example, on Texas Instruments MSP430 with 8 kB).
However, my assumption would be that if I use Java, I use it correctly, and not, for example, return half of the return value (for example, two int in the return and the other half by setting a member. Instead, I would used some Pair class as return value.
I don't care how much OO programming is, it could also be an FP style, but at least use atomic elements as return types and not propagate them in all global variables.
So, can I do βnormalβ Java programming for embedded devices? If the question is too broad, consider a JBed script and a 16 MB device. If it is important whether Java is used in OO or FP-style, specify which style may be appropriate.
source share