KBD

Keith Devens .com

Sunday, July 20, 2008 Flag waving
You can't do anything worthwhile without pissing somebody off. – I forget

Archive: October 18, 2005

← October 17, 2005October 19, 2005 →

Daily link icon Tuesday, October 18, 2005

  1. Call Me Fishmeal.: Unit testing is teh suck, Urr.:

    I've NEVER, EVER seen a structured test program that (a) didn't take like 100 man-hours of setup time, (b) didn't suck down a ton of engineering resources, and (c) actually found any particularly relevant bugs. Unit testing is a great way to pay a bunch of engineers to be bored out of their minds and find not much of anything.

    When you modify your program, test it yourself. Your goal should be to break it, NOT to verify your code. That is, you should turn your huge intellect to "if I hated this code, how could I break it"... You KNOW that if you hated someone and it was your job to break their program, you could find some way to do it. Do it to every change you make.

    Heh. Great quotes in this thing:

    Essentially, beta testing is Nature's Way (TM) of making systems stable. You think nature creates unit tests and system tests every time it mutates a gene? Aw hell nah. It puts it out in the wild, and if it seems better it sticks around. If not, it's dead.

    Read the rest. Via Paul Hammond.

       (0) Tags: [Programming]
  2. Rands In Repose: Taking Time to Think:

    Panic is the mother of the path of least resistance.

    via Paul Hammond.

       (0)
  3. Small Ideas:

    You could spend a lot of time trying to figure out if this idea is any good, and at the end, you wouldn't really know. Alternatively, you could spend the same amount of time implementing this idea, after which you will have the opportunity to really find out if it's any good.

    via Paul Hammond.

       (0) Tags: [Programming]
  4. Kevin Lynch's Web 2.0 Conference Presentation announcing Flex 2.0 and Flash 8.5, via Welcome to Measure Map, by Jeffrey Veen, via Paul Hammond. Pretty neat presentation.

       (0) Tags: [Programming]
  5. Coding Horror: Pimp My IDE, via Adam. Gotta at least try the off-white.

       (0) Tags: [Programming]
  6. Instapundit.com: Hurricane Katrina prompts growth in gun ownership:

    Reader Sean Malloy emails that a different NPR story led him to join the NRA some years ago:

    > In 1999 or so, NPR ran a story about an armed gang of about 30 men in Bosnia rounding up all the military-aged men/boys in a village and executing them in their village square. About 300 were killed.
    >
    > The thought "it would take a whole lot more than 30 men to kill 300 villagers in an armed society" occurred to me, and I joined the NRA that evening.
    >
    > NPR execs would have puppies if they knew.

    I like puppies.

    Heh.

       (5) Tags: [Opinions/Politics]

Code style

Was just reminded of something (code taken from here (linked earlier)). Compared to the following:

public class Point
{
    private int x, y;
    
    public Point()
    {
        x = 0;
        y = 0;
    }

    public int X
    {
        get
        {
            return x;
        }
        set
        {
            x = value;
        }
    }

    public int Y
    {
        get
        {
            return y;
        }
        set
        {
            y = value;
        }
    }
}

Something like the following:

public class Point{
    private int x, y;
    
    public Point(){
        x = 0;
        y = 0;
    }

    public int X{
        get{
            return x;
        }
        set{
            x = value;
        }
    }
    
    public int Y{
        get{
            return y;
        }
        set{
            y = value;
        }
    }
}

or particularly the following:

public class Point{
    private int x, y;
    
    public Point(){
        x = 0;
        y = 0;
    }

    public int X{
        get{ return x; }
        set{ x = value; }
    }
    
    public int Y{
        get{ return y; }
        set{ y = value; }
    }
}

seems so clearly superior to me that I don't see what there is to debate. It's beyond me how anyone would like to read the first version, which is the exact same code as the final version but with 16 extra lines of nothing to wade through. It's almost twice as many lines as the final version.


While I'm here I might as well harp on tabs vs spaces. I'll never understand why some people prefer to only use spaces instead of tabs. Tab means "one level of indentation". Furthermore, some people like to use two spaces to indent their code. That's perfectly fine, but use tabs so I don't have to care about how you like to view your code.

← October 17, 2005October 19, 2005 →
July 2008
SunMonTueWedThuFriSat
 12345
6789101112
13141516171819
20212223242526
2728293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 2 posts

Recent comments XML

Spider solitaire

To answer an earlier question, I am​almost certain every game can be​beat. ...

Jared: Jul 16, 2:20pm

I hate Norton Antivirus

I HATE NORTON ANTIVIRUS IT SUCKS I​GOT AVG IT ROX! AGES TO DELETE​NORTON AN...

wade: Jul 15, 1:44am

Generated in about 0.069s.

(Used 7 db queries)

mobile phone