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."
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?
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"
//Look at my flower,
//my pretty pretty flower.
//Now my code is 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:
He was marked off "-1 Sarcasm not appreciated"
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
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.
while (1){
Beer b = (Beer)getBeer();
drinkBeer(b);
belch(BelchType.LOUDLY);
}
Yeah? Well I think you're overrated too.
http://xkcd.com/292/
That is all.
Hey Theo ... haven't chatted with you in a while. How's it going ? Family doing well ?
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
Fixed, thanks for the report!
There is a memory leak in your code. Or maybe it's a feature?
.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.
getBeer() may be using the flyweight pattern, and reusing previous beer instances (presumably after their
No, that makes it retarded.