Feeds

Shall I compare thee (code) to a summer's day?

Beauty that's code deep

Providing a secure and efficient Helpdesk

Book review Beautiful code? Well, we've all seen plenty of ugly code in our time. If we're being honest, we'd probably even admit to have written some dog-ugly code at one time or other (no doubt with every intention to refactor it later so that it's a bit less brutally repulsive). But code that's beautiful? What does that even mean?

Code that's simple and easy to understand? Code that expresses an elegant and counter-intuitive algorithm? Code that's terse, powerful, and too clever for mere mortals to comprehend?

Of course, there's no one definition of beauty in any sphere of life, and software's no different in this respect. But while there's not a single definition of beauty that emerges from this collection of essays on "beautiful code", there are some common themes that do emerge repeatedly. But more of that later.

This is a fairly eclectic collection of writings about code, covering different types of software (from deep within the guts of operating system kernels, to fundamental sort algorithms, to processing gigabytes of data in bioinformatics), to different languages (from C to Java to Ruby to assembler), to different domains (from data mining to gene sorting to XML parsers).

While all the authors are noted experts or hackers, some are better known than others, and some write with greater skill than others. What all of the authors share is a notion that code itself can be interesting and beautiful – it isn't just the algorithm that's important, it's the code itself.

There are some stand-out pieces that deserve mention. Tim Brays piece on searching through log files using Ruby and Java does a great job of showing the strength of those languages; Brian Kerninghan discourses on regular expressions; Michael Feathers writes about the unusual API design of the Framework for Integrated Testing; and, writing unit testing code is considered beautiful by Alberto Savoia. There are plenty of other good articles, and while some of them really didn';t grab this reader, overall the 33 chapters present a high standard of writing, technical excellence, and interest.

While this isn't a book that covers the latest programming fad or the latest-and-greatest programming language, framework or methodology, it's certainly one that will appeal to those of us who are interested in coding.

And the idea of beautiful code is one that ultimately has a distinctly utilitarian value. Beautiful code is code that encapsulates an elegant algorithm, or that uses the natural features of a language well; it's code that isn't encumbered with special cases or clunky data structures. These ideas of elegance and simplicity emerge in many of the examples described by the different authors. Beautiful code is also code that is flexible, powerful, and efficient. And if we all wrote code that was beautiful, our software (and our users) would benefit from it directly.

And if all that doesn,t convince you that this is ideal holiday reading for developers, then it's worth pointing out that all the profits from this book are pledged to Amnesty International.

Beautiful Code

beautiful codeVerdict: Consistently interesting and highly readable.

Edited by Andy Oram and Greg Wilson

Publisher: O'Reilly

ISBN: 0596510047

Media: Book

List Price: £31.99

Current Reg price: £22.71 inc. VAT (discount 29%)

Buy this book at Register Books at Reg Developer's special discounted price (subject to change).

Internet Security Threat Report 2014

More from The Register

next story
UNIX greybeards threaten Debian fork over systemd plan
'Veteran Unix Admins' fear desktop emphasis is betraying open source
Netscape Navigator - the browser that started it all - turns 20
It was 20 years ago today, Marc Andreeesen taught the band to play
Redmond top man Satya Nadella: 'Microsoft LOVES Linux'
Open-source 'love' fairly runneth over at cloud event
Chrome 38's new HTML tag support makes fatties FIT and SKINNIER
First browser to protect networks' bandwith using official spec
Google+ goes TITSUP. But WHO knew? How long? Anyone ... Hello ...
Wobbly Gmail, Contacts, Calendar on the other hand ...
Admins! Never mind POODLE, there're NEW OpenSSL bugs to splat
Four new patches for open-source crypto libraries
prev story

Whitepapers

Forging a new future with identity relationship management
Learn about ForgeRock's next generation IRM platform and how it is designed to empower CEOS's and enterprises to engage with consumers.
Why and how to choose the right cloud vendor
The benefits of cloud-based storage in your processes. Eliminate onsite, disk-based backup and archiving in favor of cloud-based data protection.
Three 1TB solid state scorchers up for grabs
Big SSDs can be expensive but think big and think free because you could be the lucky winner of one of three 1TB Samsung SSD 840 EVO drives that we’re giving away worth over £300 apiece.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.