The way to keep things from breaking is to have automated tests for everything. That way you'll know immediately if your last change broke something that was previously working.
The internet has not ruined truth. People today are just about as gullible and misinformed as they always have been. The only difference is that now there are more sources of misinformation than ever before. Today, in addition to being misinformed by government officials, educators, religious authorities, and commercial media, people can be misinformed by anyone able to pony up five bucks a month to run a website.
Generally, the usefulness of comments is overrated. A programmer who knows how to comment usually knows how to write code that is clear enough to need no comments.
The most important thing to document is the purpose and usage of each class. This is usually best documented by including an example of the class usage in the class header file.
This becomes easy if you write a test for every class before you write the class. Then you can just copy the test code into the header file, and if you forget, then a programmer can simply look at the test.
If you are having trouble writing the test, or describing the complete functionality of the class, then it is simply too large and should be split.
Well-named variables and functions can eliminate the need for most comments. Rather than writing
// do_something_complicated ... fifteen lines in two nested loops...
simply say:
do_something_complicated();
and extract the fifteen lines into a separate function.
Do not abbreviate variable or function names, unless you have a standard set of abbreviations for your project that are ALWAYS used.
Try to write code so that it reads as much like English as possible. Use noun-phrases for const member functions, verb-phrases for non-const member functions, and predicate phrases for boolean functions.
The STL is vastly superior to the old Tools.h++ template collection classes. The STL has a set of powerful algorithms, useful iterators, and is type-safe and const-correct. Old Tools.h++ doesn't and isn't.
Newer Tools.h++ classes are compatible with the STL, but I can see little reason to use them beyond backward compatibility. RW does provide hash tables, but you can get an STL-compatible hash table for free.
You do not have a right to assemble explosives
in your bedroom, nor to store gasoline in
unsafe containers, or otherwise engage in
behavior that is reasonably likely to cause
others to suffer injury or property damage.
Comparing guns to homemade bombs is silly.
Guns are not dangerous unless handled irresponsibly. Homemade explosives are continuously hazardous and likely to ignite
even when left alone, and if large enough can
cause widespread damage while gunfire is quite unlikely to escape a house. Having read the
SA's affadavit, I'm feeling that Austin probably
should be in jail. I certainly wouldn't want
him for a neighbor.
I've seem shops where most of the work is "drudgery". They are extremely inefficent,
usually with about 10 drudges doing work
that could be done by two programmers.
The drudges are indeed good at estimating
their usual tasks, but anything beyond that
is not only unestimable, but is often undoable.
On all the projects I've worked on over the past twenty years, it was always obvious who was pulling their weight and who was just collecting a check. A good manager will know who is contributing.
A tough technical interview will sort out the contributors from the watchers before hiring. I've learned to avoid joining organizations if the interview is too easy -- I won't like the people I have to work with.
The way to keep things from breaking is to have automated tests for everything. That way you'll know immediately if your last change broke something that was previously working.
The internet has not ruined truth. People today are just about as gullible and misinformed as they always have been. The only difference is that now there are more sources of misinformation than ever before. Today, in addition to being misinformed by government officials, educators, religious authorities, and commercial media, people can be misinformed by anyone able to pony up five bucks a month to run a website.
Interestingly, he doesn't predict the replacement of Oracle by MySQL.
The most important thing to document is the purpose and usage of each class. This is usually best documented by including an example of the class usage in the class header file.
This becomes easy if you write a test for every class before you write the class. Then you can just copy the test code into the header file, and if you forget, then a programmer can simply look
at the test.
If you are having trouble writing the test, or describing the complete functionality of the class, then it is simply too large and should be split.
Well-named variables and functions can eliminate
the need for most comments. Rather than
writing
simply say:
and extract the fifteen lines into a separate function.
Do not abbreviate variable or function names,
unless you have a standard set of abbreviations
for your project that are ALWAYS used.
Try to write code so that it reads as much like
English as possible. Use noun-phrases for const member functions, verb-phrases for non-const member functions, and predicate phrases
for boolean functions.
Read Refactoring by Martin Fowler.
Are you using a pre-STL version of Tools.h++?
The STL is vastly superior to the old Tools.h++
template collection classes. The STL has a
set of powerful algorithms, useful iterators,
and is type-safe and const-correct. Old Tools.h++
doesn't and isn't.
Newer Tools.h++ classes are compatible with
the STL, but I can see little reason to use
them beyond backward compatibility. RW does
provide hash tables, but you can get an STL-compatible hash table for free.
You do not have a right to assemble explosives
in your bedroom, nor to store gasoline in
unsafe containers, or otherwise engage in
behavior that is reasonably likely to cause
others to suffer injury or property damage.
Comparing guns to homemade bombs is silly.
Guns are not dangerous unless handled irresponsibly. Homemade explosives are continuously hazardous and likely to ignite
even when left alone, and if large enough can
cause widespread damage while gunfire is quite unlikely to escape a house. Having read the
SA's affadavit, I'm feeling that Austin probably
should be in jail. I certainly wouldn't want
him for a neighbor.
"Most code is utter drudgery"
I've seem shops where most of the work is "drudgery". They are extremely inefficent,
usually with about 10 drudges doing work
that could be done by two programmers.
The drudges are indeed good at estimating
their usual tasks, but anything beyond that
is not only unestimable, but is often undoable.
My picks:
JK Rowling
Larry McMurtry
On all the projects I've worked on over the past twenty years, it was always obvious who was pulling their weight and who was just collecting a check. A good manager will know who is contributing.
A tough technical interview will sort out the contributors from the watchers before hiring. I've learned to avoid joining organizations if the interview is too easy -- I won't like the people I have to work with.