"A heuristic we follow is that whenever we feel the need to comment something, we write a method instead." [Fowler]
Marco Abis ha Scritto: "Gran bella frase ma ci tengo a fare un veloce appunto prima che si "scatenino" flame (come molte volte è successo con affermazioni di questo genere): Fowler non stà dicendo che commentare è MALE bensi che il sentire l'esigenza di commentare del codice è solitamente sintomo (uno "smell") di codice non chiaro che quindi necessita di refactoring :-D "
Non posso che essere daccordo con Marco Abis, infatti per completezza vi presento il resto del discorso di Fowler: "Don't worry, we aren't saying that people shouldn't write comments. In our olfactory analogy,comments aren't a bad smell; indeed they are a sweet smell.The reason we mention comments here is that comments often are used as a deodorant. It's surprising how often you look at thickly commented code and notice that the comments are there because the code is bad. ......Our first action is to remove the bad smells by refactoring. When we're finished, we often find that the comments are superfluous." [Fowler]
In realta' avevo inserito questa frase sul mio blog per non dimenticarmi, quando scrivo del codice, un concetto che secondo me e' molto importante, soprattutto per rendere il codice comprensibile, non solo da chi lo scrive.Grazie tante a Marco, che indubbiamente e' molto (e di +) + esperto di me a riguardo, per la sua precisazione.