|
|
|
|
|
by incrudible
1831 days ago
|
|
> But you cannot expect everyone to have the same proficiency you do. Writing good code, also means writing code that a newbie can at least comprehend. If you're writing example code or documentation, by all means, add this kind of comment. Otherwise, if someone can't comprehend these particular two lines without reading the comment, they need to get back to the drawing board. You can't have noisy code like that in production at the off-chance that somebody with zero competence needs to read it. The expected case is that a competent developer needs to find "the thing", which means they need to be able to scan the code quickly without having to read everything twice. That's what you should optimize for. The DRY principle also applies, this sort of error is not uncommon: // Add a vertical scroll bar
hScrollBar = new JScrollBar(JScrollBar.HORIZONTAL);
|
|