March 2006 Archives

Single-exit functions

|
Ivan Moore suggests that single-exit functions should be considered cargo cult. I don't think so. My suggestion for improving his sample code is as follows:
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.

Dependency Injection Demystified

|

Variable/Function/Object/Class naming

|

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.

Short Methods and Small Classes

|

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:

  1. Pick a function.
  2. Understand it, what it's supposed to do, how that is accomplished.
  3. Memorize the function.
  4. Then, without looking at the original code, write the function from memory.
  5. If you've made a mistake, the function was too long, or otherwise too complex.

Marketing Biathlon

|
Another great Dilbert.

Ideal workplace?

|

Herb Sutter on Concurrency

|

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.

Getting Real

|

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]

DabbleDB

|

Watch this: Dabble DB Demo.

Database stuff still is cool.

Textboxes

|

Coding Horror:

Web Forms: Death By a Thousand Textboxes

Interesting thoughts on reducing the number of textboxes & text entry controls in a UI.

Userfriendly...

|

On Bugs

|
Wil Shipley:
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.

Another Take on Simplicity

|

Features & Simplicity

| | Comments (1)

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?

About this Archive

This page is an archive of entries from March 2006 listed from newest to oldest.

February 2006 is the previous archive.

April 2006 is the next archive.

Find recent content on the main index or look in the archives to find all content.