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."
If you haven't looked at it already, you should glance through the OpenBSD source code. It's truly remarkable how well-written it is. But I wouldn't consider it "beautiful". I think studly is a better word. It's rugged, strong, and built to handle the toughest of the tough.
That's still better as a for { } loop. Apart from it's concise variable initialisation and post-loop statement, for is while.
for (i = 0; not bail_condition; i++) {
for (j = 0; not bail_condition; j++) {
inner loop
}
outer loop
}
I think part of the problem might be that compilers have a hard time figuring out gotos. GOTO doesn't imply any scope transition and the compiler has to figure it out. However, BREAK is very clear on which scope is being abandoned. Also, a goto will always compile (well, it depends on the language), but a break with a label will only compile if used in a sane manner.
BTW, I met a guy whose biggest dissapointment with VB.Net was that they did away with GOSUB. I shot him.
holy shit. as I copied that over to try it (uh, "in a vm", right), I noticed it's even better than you posted it! Here it is fixed-width:
not exp log srand xor s qq qx xor
s x x length uc ord and print chr
ord for qw q join use sub tied qx
xor eval xor print qq q q xor int
eval lc q m cos and print chr ord
for qw y abs ne open tied hex exp
ref y m xor scalar srand print qq
q q xor int eval lc qq y sqrt cos
and print chr ord for qw x printf
each return local x y or print qq
s s and eval q s undef or oct xor
time xor ref print chr int ord lc
foreach qw y hex alarm chdir kill
exec return y s gt sin sort split
Now that's beauty!
This site's primary concern seems to be java
Huh? Are you looking at the same site as me? I count 10 articles, of which:
1 is about the design of a core Java API
1 is about implementing a library in C
3 are completely language independent
1 is about a development environment called "Subtext" which has its own language
1 is about Haskell
1 is about the book discussed
2 are about object-oriented design, and use Java in example code (but the text of the article applies equally to any object-oriented language)
That doesn't seem to be particularly Java-focussed to me.
I think to many, part of the beauty of a remarkable haiku is the skill of the writer in packing big, powerful ideas or images into very few words. The haiku form is especially challenging because you have so little space to work with. It is wordcraft... and good wordcraft takes a lot of skill and effort.
In a way, it's like appreciating a remarkable skateboard trick or an amazing touchdown catch because not everyone has the skill to do those things, especially the outstanding examples.
Privacy Statement: We value your privacy! It is very valuable. That's why we try to sell it whenever we can.