C is a cool programming language where if you want to return a string from a function you have to set up an entire physical-universe human social system for adjudicating who is responsible for freeing it "In order to create a C string, you must first create civilization"
-
-
C pretends programmer time is infinite, who has time to manage memory, that's real work, aren't computers supposed to automate work ? just buy 2x memory (as per GC theory worst case)
-
There's more to consider than a languages productivity. A GC is a show stopper if you're doing anything with hard real time constraints. And even if you're only running on embedded hardware and can safe 50% RAM, it might be a good idea depending on the circumstances.
-
And even if you just want to learn, C hides very few complexity. If you're know what's going on when handling strings, it might prevent some issues with other languages, too.
-
really, do you know what's going on? caching out of order execution branch prediction pipelines register renaming expeculative execution memory barriers real hardware is nothing like C v̶i̶r̶t̶u̶a̶l̶ abstract machine compilers hide a lot of things
-
It's a bug in the hardware if you have to be aware of any of those to write correct programs.
-
too bad if you mistakenly used undefined behavior
-
Out of all your list, data races (roughly corresponding to memory barriers) is the only one vaguely relevant to UB. Everything else preserves all behavior of arbitrary userspace asm (except timing) so it necessarily preserves behavior of C.
-
out of order execution can also be a problem in some architectures, but they compiler do the right thing , usually
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.