Slashdot Mirror


Beautiful Code Interview

An anonymous reader writes "Safari Books Online has just posted an interview with Andy Oram and Greg Wilson, the two editors who put together the recent O'Reilly book, Beautiful Code. "Beautiful Code" features 33 different case studies about challenging coding scenarios from some of today's most high-profile developers and OS project leaders. There's also a new Beautiful Code web site based on the book where many of the authors are blogging about their work and coding practices."

19 of 286 comments (clear)

  1. Nothing to see here by AuMatar · · Score: 4, Funny

    Yeah, thats about the amount of beautiful code I expect to see in my life time.

    --
    I still have more fans than freaks. WTF is wrong with you people?
    1. Re:Nothing to see here by morgan_greywolf · · Score: 5, Funny

      "If builders built buildings the way programmers write programs, then the first woodpecker that came along would destroy civilization." -- forgot who said it.

    2. Re:Nothing to see here by larry+bagina · · Score: 5, Funny

      If it's any consolation, you did get the coveted first typo.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    3. Re:Nothing to see here by Anonymous+Brave+Guy · · Score: 2, Funny

      If we built our cars like we build our software, they would look great, they would have controls even a five-year-old could use, and every 65,536 miles they'd teleport you back to where you started.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  2. This just reminds me of my friend. by Anonymous Coward · · Score: 5, Funny

    His introduction to C++ teacher told him throughout the class that his code was not "pretty" because he wasn't properly commenting. The code always worked flawlessly, but still she marked "-1 code not pretty"
    On the final project he spent a good portion of time properly commenting all of his code and ended with a commented ascii flower and the following:

    //Look at my flower,
    //my pretty pretty flower.
    //Now my code is pretty

    He was marked off "-1 Sarcasm not appreciated"

    1. Re:This just reminds me of my friend. by morgan_greywolf · · Score: 2, Funny

      And to think if he posted it on Slashdot, he might've actually gotten a +5 Funny! ;)

    2. Re:This just reminds me of my friend. by mrchaotica · · Score: 4, Funny

      He should have removed one syllable from the last line; then he would have gotten "+1 haiku!"

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

  3. The problem with the book... by BlueBoxSW.com · · Score: 5, Funny

    Anyone else have laugh when they looked at the cover of the book?

    A Flock of Birds?

    To symbolize beautiful code?

    Flock-of-Birds-style code is the UGLIEST code out there!

    Used only by those who haven't learned to use case statements, build databases, or define arrays.

    Is this beautiful code???

    if(something==interesting)
        if(somethingelse==goodcode)
            if(somethingother==blahblahblah)
                if(somestupidbookcover=birds)
                    doSomethingUseful();
                else
            else
        else
    else
        if(somethingelse==goodcode)
            if(somethingother==blahblahblah)
                if(somestupidbookcover=birds)
                    doSomethingUseful();
                else
            else
        else
    end if

    1. Re:The problem with the book... by morgan_greywolf · · Score: 2, Funny

      There's a name for that garbage? Well, color me stupid. Learn something new every day.

  4. Re:Have to say... by Anonymous+Crowhead · · Score: 5, Funny

    I have yet to see a really good example other than my own.

    I, too, am the only one I know who writes decent code.

  5. beautiful code by lottameez · · Score: 4, Funny

    while (1){
    Beer b = (Beer)getBeer();
    drinkBeer(b);
    belch(BelchType.LOUDLY);
    }

    --
    Yeah? Well I think you're overrated too.
    1. Re:beautiful code by RetroGeek · · Score: 2, Funny
      You forgot to add inside the loop:

      Bladder blad = Bladder.getInstance();
      if ( blad.isHurting() )
      {
        bld.empty();
      }
      --

      - - - - - - - - - - -
      I am a programmer. I am paid to produce syntax not grammar. Deal with it.
    2. Re:beautiful code by Anonymous Coward · · Score: 2, Funny

      Let us pray getBeer() does not return a Singleton.

  6. Beware the raptors ... by Anonymous Coward · · Score: 5, Funny

    http://xkcd.com/292/

    That is all.

  7. Re:The OpenBSD code is studly. by garett_spencley · · Score: 4, Funny

    Hey Theo ... haven't chatted with you in a while. How's it going ? Family doing well ?

  8. Re:Dangers of binge drinking by Ungrounded+Lightning · · Score: 2, Funny

    There is a memory leak in your code. Or maybe it's a feature?

    Nope. drinkBeer(b) frees the beer instance.

    (But there may be a memory leak in the PROGRAMMER after enough iterations.)

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
  9. Re:The OpenBSD code is studly. by Anonymous Coward · · Score: 1, Funny

    Fixed, thanks for the report!

  10. Re:Dangers of binge drinking by julesh · · Score: 2, Funny

    There is a memory leak in your code. Or maybe it's a feature?

    getBeer() may be using the flyweight pattern, and reusing previous beer instances (presumably after their .urinate() method has been called to, err..., release them). This is clearly why the otherwise pointless typecast to (Beer) is present: the method probably returns Lager, and the writer wanted it to be clear that it was more generic than that.

  11. Re:The most beautiful code I've ever seen... by Alaria+Phrozen · · Score: 2, Funny

    No, that makes it retarded.