4 ms·
I would enjoy reading more comments from people who have been programming for a very long time about how their coding style has changed.
by idlewords 12y ago
I would enjoy reading more comments from people who have been programming for a very long time about how their coding style has changed.
- tgb 12y agoSeconded! Also I would like to see comments on how programming styles in general have changed over the years - does a 80's era high-quality program still look like a 2010's high-quality program once you factor out the syntactic sugar?
- hisham_hm 12y agoFor this purpose, it might be worth checking out some classic books such as "Software Tools" and "Project Oberon".
- at-fates-hands 12y agoI find it fascinating that larger traditional languages have changed little over time, while the languages of front-end development seems to change daily. My coding style seemingly morphs about every few months now. It's sad to think stuff I wrote even three years ago I would never show someone interviewing me or put it in a portfolio nowadays.
- GFK_of_xmaspast 12y agoIf you don't hate the code you wrote six months ago you're stagnating.
- acdha 12y agoThis should only be true during the early days of your career. If you're out of the novice stage, you shouldn't be writing hateful code – maybe there's a new library to use or something you now understand about the problem but that's hardly the level of hatred.
- abecedarius 12y agoI don't have much to say that'd fit in a comment, but for science here are two of my programs in C doing similar tasks, one from the late 1980s, one from 2008: https://github.com/darius/req https://github.com/darius/req https://github.com/darius/vicissicalc https://github.com/darius/vicissicalc
- krylon 12y agoThank you very much!
- EddSeabrook 12y agoLine 457-470 of vicissicalc.c: why do you use else if here rather than switch-case?
- ufo 12y agoMight have been because of the `else if (ch == 'q') break;` line. If he used a switch statement he would have needed to use a goto to break out of the loop.
- abecedarius 12y agoThat's a reasonable guess, but a return would work there. I think I did it this way because all the breaks you need in a switch are noisy -- too noisy if you'd like to write one action per line. However, you can mute the noise by lining it up: switch (getchar ()) { break; case ' ': enter_text (); break; case 'f': view = formulas; break; case 'h': col = (col == 0 ? 0 : col-1); which also makes oops-I-forgot-the-break hard to miss. I hadn't thought of that pattern yet. (You could define a macro for "break; case" too; my friend Kragen calls that IF.) But I mostly stopped coding in C after around this time.
- e12e 12y agoThe first break is ignored?