3 ms·
It’s nice and smart, but also notice how it needs a whole web page to explain and would happily compile after a lot of invisible single-letter changes that woul
by zoul 9y ago
It’s nice and smart, but also notice how it needs a whole web page to explain and would happily compile after a lot of invisible single-letter changes that would introduce horrible bugs. There is value in the old ways of writing software, I just wouldn’t throw out modern software engineering just yet.
- oldcynic 9y agoAny competent C programmer shouldn't need any explanation of that simple example. Granted pointers, just like objects in more "modern" languages, take some while for new programmers a while to get their heads around.
- pjmlp 9y agoHaving learned pointers in other languages before learning C, I never understood what is so hard about them. Even BASIC had them via peek and poke. Don't people learn to draw boxes and arrows anymore?
- vram22 9y ago>Any competent C programmer shouldn't need any explanation of that simple example. Interesting point, and I agree. I read that code a little earlier today, and (was a bit surprised to see that) I could understand it pretty much right away, even though I have not used C a lot for a while. I did use it a lot earlier though, on both Unix and DOS/Windows, and I do remember poring over that K&R book early in my C career, and working out the meaning of each line of code in almost the whole book. That may be why I could figure out quickly what it meant, now. More cryptic stuff might take a while to figure out, though, but the point I want to make is that the general principle remains the same: you have to understand what each line and even what each token (of the code) in each line is doing, how it works, etc., by reading the books and docs, by trial and error, modifying the code and seeing the modified output, using debugging print statements, isolating smaller chunks of code and running them to see how they work and if your mental model of what is happening matches reality, etc.