Hacker News new | past | comments | ask | show | jobs | submit login

This skill can help to write more concise code and refactor better but I wouldn't say it's the core component. Very well-functioning, maintainable code could certainly be written that was full of "== true" lines. That is preferable to indecipherable long-winded one-liners with no comments that are hard to parse.



That’s a false dichotomy. An indecipherable long-winded one-liner with no comments is not well factored code either.

I didn’t mean to imply that syntactic manipulation is the core component of programming, only that it’s a required skill, which beginners commonly struggle to learn. I’ve tutored a good number of beginner CS students, and a big issue is developing a general understanding of a language from the few concrete examples they’ve seen. If you’ve only ever seen “name.name()”, you may be surprised that “(expression).name()” is possible. If you’ve only ever seen “if (name == expression)”, you may be surprised that “if (name)” or “name = (name == expression)” are possible.

This article concerns how beginners learn to program, and I’m only arguing that I would expect an early understanding of the algebra of programs to be an advantage in learning how to productively manipulate programs. When you’re comfortable with the syntax, it is much easier to reason about the more important issue of semantics.


>only that it’s a required skill

What I'm saying is that it might not be required, just pleasant, given my example of someone who codes like that but otherwise writes well-structured good code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: