4 ms·
I suspect that's a pedagogical device to motivate introducing a style that can make code shorter and more readable, not a prescription to always convert three l
by tome 9y ago
I suspect that's a pedagogical device to motivate introducing a style that can make code shorter and more readable, not a prescription to always convert three lines to two by using sigils.
- tom_mellior 9y agoSure, but IMHO it tends to fail even on the "more readable" front.
- tome 9y agoYes, for converting three lines to two, but often not when converting thirty lines to twenty.
- mannykannot 9y agoBut as a pedagogical device, it would seem to be teaching students to focus on the wrong thing (and it also fails Montrose's token-count definition of shorter.) (Caveat: the site is still down.) More generally, I think there is an inversion of causality here: well-written code is often shorter than slapdash code with the same goal because the author thought about the problem as a whole, got straight to the point, and avoided adding complexity. I think that is clear in the Sudoku-solver example of my previous post.