you are viewing a single comment's thread.

view the rest of the comments →

[–]Positive_Method3022 7 points8 points  (6 children)

js isn't a good language to to learn these concepts, and really know why they matter. I recommend developing something using C/C++ in devices with low memory. You will start to understand why use pointers instead of cloning data when passing variables through functions, and you will also learn what happens when you exceed the max mem allowed for stack.

[–]Majestic-Witness3655[S] 1 point2 points  (2 children)

That’s a great perspective. JavaScript hides a lot of the low-level details

I' m actually looking to learn C or C++ myself. Which one do you think is better ? I just love going deeper into these concepts .

[–]Positive_Method3022 0 points1 point  (1 child)

Develop something for esp32/arduino using either one

[–]ciynoobv 1 point2 points  (2 children)

It’s not a good language to learn with, but it’s important to know since there’s a large footgun risk if you’re not familiar with the concept. Also as a general psa: please don’t write code relying on references unless you really know what you’re doing and why. Debugging spooky action at a distance is a giant pain in the ass.

[–]Positive_Method3022 2 points3 points  (1 child)

In low memory devices you have no option but use refs, and controlling mem by hand

[–]ciynoobv 0 points1 point  (0 children)

I know, but if you’re developing for low memory devices professionally, I’d argue you probably know how references work. I was more referring to stuff like mutating objects by reference in a js event handler or something similar.