|
|
|
|
|
by Groxx
5904 days ago
|
|
I came across it pretty early, though admittedly I'd read quite a few suggestion articles & management articles prior to it. It's still largely obvious, and super management-oriented. Even the little check-lists at the end of each chapter reek of a manager looking over someone's shoulder, tsk-ing, and marking "flaws" in code, rather than actually being a useful metric of any sort to measure quality against. I can't get past the feeling (as it's a subjective assessment, I can't say "fact") that it's a book for non-programmers who are managing programmers, and it's being mis-applied as something a programmer should read. It's meant to raise the minimum code quality on a project, and it very well could with rather poor programmers, but it does so by sacrificing (nay, slaughtering) potentially better strategies which a decent programmer should know / be learning. "Do X, Y, and Z and your code will improve" is something only managers believe, and they all want to find some magic combination which will work that way. Code Complete bills itself as exactly that. |
|
The thing is, it is absolutely correct for some definitions of X, Y and Z. There are plenty of programmers in the workplace who just suck at constructing code. They don't know how to write good comments, format their code logically and consistently, use good variable and function names, etc. It goes even further: they do not understand why these things are important. I still see plenty of code like this:
bool nothingToDo; // Is there anything to do
....
if (nothingToDo) {
}or
if (time.elapsed() > 10) // If ten seconds or more have passed
{...}
Requests to refactor such code are often met with "This is trivial, just step through the code and figure it out", sometimes from senior programmers (at least in title). And these are not necessarily stupid people, they are often good programmers but not very good software engineers. Have you ever read some of the code open sourced by Google and found yourself thinking "Sheetz, this code is ultra clean"? I bet the people responsible for Google's coding guidelines have read Code Complete. I have been involved in writing coding standards a few times and I referred to Code Complete in each of those instances.
I also completely disagree that this book was written for managers. A manager with no technical background is very likely to dismiss refactoring or code layout as wasted time.