4 ms·
What that means, though, is you can only determine if code is readable after it's written, and read by other people. And I agree with you. But that also means
by mcphage 12y ago
What that means, though, is you can only determine if code is readable after it's written, and read by other people. And I agree with you. But that also means that, while you're writing code, or thinking about the code you're going to write, or trying to decide between two possibilities, 'readability' doesn't mean anything. So you can't use it to guide you towards more readable code; instead it can merely be used to decide which code should be replaced / refactored / rewritten. And you can't use it to teach new developers how to write better code.
- AnimalMuppet 12y ago> And you can't use it to teach new developers how to write better code. Yes, you can. New dev writes code. It gets code reviewed. New dev gets told: "That's ugly/too complicated/hard to understand. Here's some suggestions for how to re-write it." Over a few years, new dev learns what not to do (which is about the same as developing a sense of taste, or learning a style). It's not something that can be put into a one-hour training class, though...