Jump to content

Examples of Beautiful Code

  jgrahamc's Photo
Posted Jul 20 2010 11:47 AM

Late one evening while reading Paul Graham's Hacker News I came across a compliment from a reader concerning a piece of my code. Naturally, I was flattered (or was it just the late hour?) and it got me thinking about beautiful code. I quickly decided to recycle an old domain name I owned but wasn't using.

Within an hour UseTheSource was born. UseTheSource is based on the same Arc source code that runs Hacker News, with a few special modifications. Readers are invited to submit examples of interesting code, algorithms or solutions to problems. The site uses the familiar voting metaphor seen on many social news sites, and includes special handling of source code: there's automatic syntax highlighting for a wide variety of languages.

The site is a complement to The Daily WTF, it highlights the high points, not the lows, of programming and problem solving skill. It's not a Q&A site like O'Reilly Answers or StackOverflow, it's a place to show off great code. And I'm drawn to good code because I look at my own efforts and think 'Yuck, you could have done better there, John'. I think it's very beneficial to see the good stuff and there's always something new to learn.

O'Reilly kindly offered to give five copies of the book Beautiful Code to UseTheSource readers and I set up a simple competition: join UseTheSource and submit a story to be entered. Early this Monday morning I drew the five winners.

The five items submitted to UseTheSource were:

The last one is slightly off-topic, but it's early days for UseTheSource and I'll let the community guide what's interesting and what's not.

Whether you find those submissions beautiful or not is up to you, and I'd invite you to come to UseTheSource and submit code you find fantastic, vote on others' submissions and take part in the conversations.

1 Reply

  cjapes's Photo
Posted Dec 04 2010 05:20 AM

Hacker News seams to be a very interesting site, but it would benefit if it could improve it's CSS and give a great look.

If it could do that maybe you can have more people coming and getting involved, and everyone could benefit from that.

Just my 2cents.