March 2006 Archives
void foo(boolean condition)
{
int returnValue = 6;
if (condition)
returnValue = 5;
return returnValue;
}Single exit. I even managed to save on a rather confusing else. Short. Easy to read. Even easier to understand. Anyway, as long as we're dealing with code of the complexity like the function shown, it doesn't really matter if you use the single-exit rule or not (As long as you don't work in my team :-). Single-exit becomes important if your function gets longer & more complex. However, if your function gets substantially longer and substantially more complex, you should consider refactoring it anyway.
Coding horror: "Creating good names is hard, but it should be hard. Good variable, object, and function names can make the difference between Daily WTF code and.. well, code you'd actually want to work on."
Click on both links.
If you're used to writing & reading long methods, dealing with small methods & classes can take some time to get familiar with. Keith Ray has a great writeup on Reading Short Methods and Small Classes.
He also cites Jerry Weinberg's great test to determine if a function/method is too long:
Nial Kennedy on theOffice, creating the ideal workplace for indie writers.
Cool.
The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software.
This is a must-read if you're a software developer or into computer science. But don't stop there. Here is great talk (for your podcasting pleasure) by Herb Sutter on this very topic (slides). It offers way more in-depth information, analysis and insight on the topic than the article.
There's a new book out there by 37signals called Getting Real. True to their philosophy of less features, it's PDF only.
Not enough features, folks.
If they would have a dead-tree edition of the PDF, I would buy it right away.
- Reading a book on the screen sucks
- Printing out 171 pages on an aging, constantly-paper-jamming laser printer sucks even more
- Reading a stack of 171 (or 171 / 2) DIN A4 / US letter sized sheets of paper while sitting on the, uhm, well, "throne" sucks royally (*).
There's no alternative to the clean, user-friendly UI of a book.
(*) Hey, I'm a married man & dad of two wonderful daughters. Sitting on the, uhm, well, "throne" is the only time I have left to read a book in peace & quiet)
[Update: No, I don't want to bind my own paperback book]
Watch this: Dabble DB Demo.
Database stuff still is cool.
Web Forms: Death By a Thousand Textboxes
Interesting thoughts on reducing the number of textboxes & text entry controls in a UI.
Now, let me state something unequivocally: 98% of the time when you think you've found a bug that is not your fault, it really is your fault. The other 2% of the time... well, it's probably your fault as well.Amen to that.
Damien Katz: Why Features Don't Matter Anymore.
Excellent. Note the distinction between selling to businesses versus selling to individuals. The question is: Will selling to businesses (slowly) migrate to the model of selling to consumers or will both remain separate beasts?