5 ms·
> I completely understand why (we're learning low level stuff and it's worked for the last 30 years so whatever) Are you sure it's not just because your teache
by sacado2 8y ago
> I completely understand why (we're learning low level stuff and it's worked for the last 30 years so whatever)
Are you sure it's not just because your teachers are not (enough) aware of those new features ? Because I work in a University and know way too many colleagues that still use new/delete on a daily basis.
- zengid 8y agoI believe you are correct, but even the textbook ignores the new stuff except for nullptr and briefly mentioning range based for loops. The professor who taught my Data Structures class (who is an exceptionally great teacher BTW) actually uses C in most of his own work, so we even learned a little bit about how to simulate recursive calls using a void* stack and goto. I hope my peers don't go out and write code like that in the wild, but that's another story..
- monocasa 8y agoFWIW, I used to be the lead of a C++14 RTOS. You can be low level and still use a lot fo these techniques. And that void*/goto hack sounds bad, even in C land. That's basically only acceptable in a byte code interpreter.
- gpderetta 8y agowell, if you have to implement a non tail-recursive function and want to have control of the max recursion depth (i.e. not get killed because you have exhausted the stack) it is an option.
- monocasa 8y agoThere you should probably pass a iteration count into the function rather than some weird goto hack.
- palisade 8y agoLearning how it used to be done isn't a bad thing, though. Because when you need to maintain code that existed before modern C++, of which there is much, you'll be ready.