RE: https://hachyderm.io/@simontatham/117653935395211357 When I say "nobody teac...
Laurent Bercot @ska@treehouse.systems
RE: https://hachyderm.io/@simontatham/117653935395211357
When I say "nobody teaches C properly", I am generally thinking of concepts like ownership, strong pointers vs. weak pointers, storage vs. structure, error reporting conventions, etc. that no programming course mentions.
I am wrong. I should be thinking of much more elementary things that are wrongly taught, such as "never use goto", apparently taken extremely literally by numerous students.
It takes one lesson to learn what's wrong with goto and why, and in what cases its use is acceptable. (You can learn this by experience, but for instance, it is perfectly okay to factorize destructors or error management at the end of a frame with goto; defer may replace that use case soon-ish.)
But if you have been taught "never use goto" and apply it literally without understanding the reason for the rule, you may just come up with that instead.
If you have more than 3 C lessons and 2 hours of practice behind you, and you do that, you should never be allowed near a C compiler again. Nor a text editor, just to be sure.