« Are you a passionate tech user? | Main | Head Rush Ajax ships! »

Code like a girl

Do engineers and programmers care about concepts like beauty and elegance? Should they? Designers have always known that looks matter--that the outside (interface) matters. But deep in the heart of those building the inside--the technology most users never see--lies the sensibility of an artist. In a kind of "Design Eye for the Code Guy" way.

While I'm stereotyping with abandon, I might as well be honest. I've been going to tech conferences for the last 15 years, and I swear the ratio of pocket protectors to Urban Outfitter clothes has shifted dramatically. So maybe it's not accurate to say geeks today are better looking--but they're certainly better dressed. With hipper haircuts.

Does this mean anything? Maybe.

What prompted this post--and it's whimsical title--is a post by Jamis Buck titled Beautiful code, test first, which includes the following:

"He was telling me how he feels like he has to sit and tweak his code over and over until it not only acts right, but looks right. It cannot be merely functional, it must be beautiful, as well."

But the best part was a comment by "Morten" that included the line:

"As for spending too much time on making the code look right down to the last indentation - my code has been called “girl code” for the same reason..."

And there you have it. I think "girl code" is quite a compliment. Because caring about things like beauty makes us better programmers and engineers. We make better things. Things that aren't just functional, but easy to read, elegantly maintainable, easier--and more joyful--to use, and sometimes flat-out sexy. A passion for aesthetics can mean the difference between code that others enjoy working on vs. code that's stressful to look at. And whether we like it or not, most of the world associates an appreciation for beauty more with women than men (especially geek men). Women may have a genetic advantage here.

From one of my favorite books on aesthetics and technology, David Gelernter's Machine Beauty:

"This book explains how beauty drives the computer revolution: how lust for beauty and elegance underpinned the most important discoveries in computational history and continues to push research onward today....The best computer scientists are, like [Henri] Vaillancourt, technologists who crave beauty.

There is the ever-present danger when you discuss beauty in science, mathematics, and technology that readers will assume the word is being used metaphorically... And could a mathematical proof, scientific theory, or piece of software be "beautiful" in the real, literal way that a painting or symphony or rose can be beautiful?

Yes."

And from the back cover:

"Both hardware and software should afford us the greatest opportunity to achieve deep beauty, the kind of beauty that happens when many types of loveliness reinforce one another, when design expresses an underlying technology, a machine logic...

These principles, beautiful in themselves, will set the stage for the next technological revolution, in which the pursuit of elegance will lead to extraordinary innovations."

Yes, calling beautiful code "girl code" is both silly and some might believe sexist. But that doesn't mean there isn't some truth to it. As a female technologist in a heavily male-skewed industry, don't compliment my hair, but if you tell me my code is pretty, I might just give you some tips.

And if it makes you feel better, I'll refer to YOUR gorgeous code as metrosexual. But we'll both know the truth.

[full disclosure: though I'm 100% female, I have personally authored some of the worst-looking code in north america.]

[UPDATE: someone has Code like a girl shirts on CafePress.]

Bonus beauty links:

Don Norman's Emotional Design

Virginia Postrel's "the substance of style"

CSS Zen Garden: The Beauty in CSS Design

Flickr "Beauty is Simple" group

Posted by Kathy on March 29, 2006 | Permalink

TrackBack

TrackBack URL for this entry:

https://www.typepad.com/services/trackback/6a00d83451b44369e200d8341e9f7553ef

Listed below are links to weblogs that reference Code like a girl:

» Können Frauen nicht nur besser schreiben, sondern auch besser programmieren? from {Bücher,Unterwegs,Rechner-Basteln,Kochen,...}

Neulich hab ich ja schonmal auf einen Artikel hingewiesen, in dem es darum geht, ob Frauen besser schreiben können als Männer. Kathy Sierra von Creating Passionate Users schaut sich das Thema in Bezug auf eine ganz bestimmte Art von Schreiben an: Pro... [Read More]

Tracked on Mar 30, 2006 5:14:03 AM

» Coding Like a Girl from HTNet

No, thats not an insult. What Im actually referring to is this post from Creating Passionate Users. I think that the captions for the first two pictures was accidentally switched, but dont take my word on it. Im not the arts... [Read More]

Tracked on Mar 31, 2006 1:02:06 AM

» Metrosexual programming! from mauriciogonzatto

- Isso mesmo! Programação metrosexual!- Não!! Eu não estou virando viado! Primeiro uma definição de termos:Metrosexual... [Read More]

Tracked on Mar 31, 2006 12:26:38 PM

» Girly coders from 6th Sense Analytics

If one of your guy friends drop it in to the conversation that you, also bloke, happen to “drive like a girl” then you can bet he isn’t complementing you. He’s actually being politically incorrect by drawing on a few popular stereotypes about ... [Read More]

Tracked on Mar 31, 2006 4:07:37 PM

» Refigerator Code or Girl Code from Developer Testing

It doesn't matter if you call it Refigerator Code or Girl Code or Beautiful Code or simply Clean Code, the meme is out there that is isn't enough to say the code works and then leave it at that. Even... [Read More]

Tracked on Apr 1, 2006 7:56:46 AM

» Code Like a Girl from DRT

[Read More]

Tracked on Apr 6, 2006 1:02:55 AM

» Beautiful Code from Dynamist Blog

Thanks to reader Jon Sweet for sending this link to a post on the Passionate Users blog that defends--in fact, advocates--polished, carefully crafted "girl code." Writes blogger Kathy Sierra, "A passion for aesthetics can mean the difference between co... [Read More]

Tracked on Apr 6, 2006 10:23:09 PM

» Ruby, Rails, and the mainstream from Journal

It seems I have stirred quite a pot around the office with my recent ravings about Rails. Today the tech-head on the board sent me this article about why Rails wont make it into the mainstream and asked for my... [Read More]

Tracked on Apr 7, 2006 6:35:17 AM

» You Code Like a Girl! from The Coding Monkey

Thanks to Virginia Postrel for pointing out this rather interesting post about the aesthetics of code. [Read More]

Tracked on Apr 7, 2006 8:16:36 AM

» Code like a girl... can from thirk

Code like a girl... can everything be described as "beautiful"? [Read More]

Tracked on Apr 10, 2006 8:04:13 AM

» Notes on asthetic the beauty of code from Eddie Bell - Proof Of Concept

I wrote a piece a few days ago about programming as an art form. I found a couple of good articles from here and here talking about similar concepts. They are more specifically about the aesthetic qualities of code, which is something I strongly believ... [Read More]

Tracked on Jul 22, 2006 4:13:10 AM

» assorted sweets from angiemckaig.com

Most businesses self destruct"Yes, you have to pay attention to what's going on out there, but I'd argue you need to pay more attention to what's going on in here. In your own company. In your own products. In yourself and your own vision." A-men. Cre... [Read More]

Tracked on Jul 29, 2006 7:13:33 AM

» Code Like a Girl from BeautyDialogues

I was checking my delicious del.icio.us tags yesterday and came across a post (saved for me by the eagle-eyed Beth Kantor) that spoke directly to my heart ... Code Like a Girl. Reading this post about the joy of writing [Read More]

Tracked on Dec 19, 2006 12:43:28 PM

» Saturday night ramen, and some great blogosphere gems from Betsy Aoki's WebLog

Early on when I started blogging, I used to do this... You know, just wander around blogs I liked. Maybe [Read More]

Tracked on Mar 4, 2007 12:40:19 AM

» Code like a girl from Tom's Blog

I found this interesting article about code beauty and the beauty of technology. It has useful links to follow up on code beauty and its origins. Also, it links you to a cool programmer and blogger community. The best... [Read More]

Tracked on Mar 11, 2007 3:30:04 PM

» Code Like a Girl from Boldly Going

This is both an interesting read, as well as a light-hearted jab upon my business partner, with his pristine code, strives for proper Web page validation, and his critiques on my Web development process: Code like a girl. I code like a man. ... [Read More]

Tracked on Mar 17, 2007 12:52:25 AM

» old links roundup from metamanda>>weblog

All stuff that's been piling up for a while, and I want to keep track of these things. A lot of this is stuff that I might have run across this past spring when I was in the throws of theses and advancements and moving and all kinds of less-than-fun ri... [Read More]

Tracked on Sep 7, 2007 8:42:52 AM

Comments

Thanks for this post. There are lots of us men who think this way! We just keep our heads down. I am also a musician and I use to make furniture for a living. I bring all that with me when I code and teach. I require that my students have good looking code as I believe that code is a form of literature that helps us communicate with each other.

Posted by: Eric Knapp | Mar 29, 2006 5:41:24 PM

I've always been a proponent of the programmer as artist. Here's an interesting post by apotheon on code elegance: http://techrepublic.com.com/5254-6257-0.html?forumID=99&threadID=173898&messageID=1915531&id=3923716

and my response:

http://www.chipstips.com/microblog/index.php/post/61/

Posted by: Sterling Camden | Mar 29, 2006 5:48:22 PM

Kathy,

if there's any truth to the numerous psych studies that have been conducted demonstrating that beautiful infants get picked up and played with more (and consequently stimulated more and learn faster) then your observation about pretty code has even more weight than you think. Consider if the same principle discovered in the infant studies applies across the technological barrier to inanimate code samples... which type of "baby" would you rather have?

of course you could always just hit the "apply source formating" feature if you use DW but I agree with you that being anal about how your code looks and grooming it by hand is like someone that waxes their car in their driveway on a saturday- pride in ownership plus it is also observed by others and contributes to the perceptions that they form about you and your work.

sean

Posted by: Sean Tierney | Mar 29, 2006 6:05:26 PM

It goes WAY beyond code formatting.

Posted by: Sterling Camden | Mar 29, 2006 6:12:38 PM

One of the best complements another engineer ever gave me was, “I like working on your code. It’s easy to read and understand.” Yea, Baby! I am another female engineer lost in a sea of men and having someone appreciate the beauty was something that has stayed with me.

I believe that well structured, clean code is easier to maintain for the simple reason that it’s so readable. Generally the person who first wrote the code isn’t the one who is going to maintain it and even if it is the same person, few people remember a specific function months after it was written.

Kim

Posted by: Kim Greenlee | Mar 29, 2006 6:23:25 PM

Thanks for the pointer to Machine Beauty. Can't my clients just pay me to go through their sites and make their source pretty? I'll start by sending them this URL.

Posted by: Drew Bell | Mar 29, 2006 9:34:25 PM

I agree that code is meant for human consumption, and thus should be beautiful.

But I was surprised that some of the most beautiful designs I've produced (in my opinion) actually derived from making the code testable.

In addition, I really believe that code unittesting especially contributes to writing beautyful code, not only because it constraints you to a cleaner and modular design, but also because it makes re-factoring infinitely easier.

The beauty in code I believe derives as much from these engineering constraints and principles as it does from the programmer's mind.

Posted by: Julien Couvreur | Mar 29, 2006 9:48:38 PM

I love beautiful code! And a beautiful layout, while necessary, is hardly sufficient. It's the conceptual beauty that strikes me: the elegant algorithm that lays bare the essence of a computation like a master sumi-e ink painting can capture a stand of bamboo with amazing economy of brush and ink. (I am more skilled at appreciating this beauty than producing it in either code or ink, but I keep practicing both *arts*).

Posted by: andrew | Mar 29, 2006 10:24:54 PM

I've been telling people for *years* that software engineering is an art as well as a science.

The trouble is, a lot of software developers are so sucked into the science that the art never gets a look in, and that concentration of attention affects the quality of work produced.

You should be able to 'take time out' to spend time making things look good, refactor, refine etc. because this helps in the long term.

Posted by: Chris Aves | Mar 30, 2006 1:01:17 AM

Code should always be polished and shine like a jewel. *Always* go the extra mile, remember code usually needs maintenance.

When someone needs to amend your code they will thank you for it and when you need to amend their code you will thank them for it.



Posted by: anteallach | Mar 30, 2006 1:27:06 AM

This is why I tend to shy away from perl - although you can make perl wonderfully clear, it's also possible to write the same thing so it looks like a right mess. I get too tempted to re-factor to stylistic standards, so could end up wasting days unpicking other people's messy, un-commented code.

Posted by: Matt Moran | Mar 30, 2006 2:37:08 AM

Absolutely true! I've blogged about the same subject a few weeks ago at http://www.hansei-kaizen.be/article/124/clean-up-your-code

Posted by: Nico Mommaerts | Mar 30, 2006 3:13:25 AM

I'm a guy and I'm very much into making my code "beautiful."

Yes, well formatted, commented, readable code is important, but for me the real beauty lies in the structure and is more abstract. I spend a fair amount of time tweaking and reorganizing my code so that the structural beauty increases.

Your reference to this as "girl code" is really funny to me considering my situation. I work in a department of 6 men and 1 woman. Hands down I would say that the code written by the 1 girl in this department is the most ugly spaghetti I have ever seen.

Posted by: Brian Glass | Mar 30, 2006 6:20:22 AM

It's a bit like maths. I have a few mathematician friends and they all agree that there has to be beauty in an equation for it to work. No wonder most (if not all) mathematicians (and many programmers, like Eric) are musicians.

Then again, the readability of a code depends on what the programmer finds beautiful. I like to streamline; for me, a beautiful code shouldn't be full of redondancies. But sometimes the more you streamline, the harder it becomes to understand.

Posted by: Marc André | Mar 30, 2006 6:59:29 AM

That's a funny phrase I've never heard. But I definitely write "girl code". Funny thing is I have yet to see any girl write girl code; usually their code is horrendous (just like most guys' code). Maybe I haven't seen enough code written by girls. Admittedly I need to read more code, period.

Posted by: Hans | Mar 30, 2006 7:05:14 AM

Wow. Untill I read your article I knever thought about the way I code my HTML. But I realise that I like goodlooking HTML, and that I'll tweak until I'm satisfied.. Thanks! :-)

Posted by: Wout | Mar 30, 2006 7:12:47 AM

Creativity is a necessary but not sufficient condition for nearly every profession. Creativity is one of things that makes human beings human. You can take any statement that the "programming is art crowd" makes and apply it to nearly any profession. These people should go away and teach philosophy instead of writing code.

Posted by: Embarassed programmer | Mar 30, 2006 7:26:18 AM

A large part of my day job involves producing technical engineering drawings using AutoCAD. Whilst a process far removed from programming, I can absolutely identify with this process. The majority of engineers, and worse, the majority of CAD technicians, will neglect a drawing's aesthetics whilst producing a technically correct drawing. I obsessively take extra time in a variety of utterly mundane ways to make sure that the technical information portrayed in the drawing looks right and looks good (damnet). It may be true that in any specific instance such changes might be unnoticeable, but when over-viewing the whole drawing I am convinced the difference more than justifies the extra time: a design that is pleasing in the way a detailed OS map, weather chart, or detailed schematic can be.

Posted by: James | Mar 30, 2006 7:34:59 AM

some time ago, I've read someplace that the human mind interpreted "beautifull" as something well adjusted to it's environment. For a simplistic example (just to ilustrate my point), fear aside, most people think the shark to be a beautifull animal and, it's true that he is very well adapted to it's environment. Appliing the same principles to code, of course that the purpose isn't to look from far to a piece of paper with printed code and see a Picasso, it's to make clear and readable code. that is why some people are already talking about "pretty as a design feature/ constrain".

A Beautifull Mathematical formula, for example, isn't one where the "3" are very round, it's a simple, elegant and simplified to it's maximum formula. For example, Einstein's formula E=MC2 is quite beautifull by any mathmatician's standards. All those principles can and should be applied to code.

Posted by: Jaime Cardoso | Mar 30, 2006 7:47:20 AM

It wouldn't be called girl code if you were doing it in python. It'd be called normal. That's why I use python.

Posted by: Karl G | Mar 30, 2006 8:20:37 AM

hmmm. Code like a girl? I'm not sure if I should be slightly offended or not. I'm meticulous in my coding style mainly for the reason that it is easier for me to go back and read and understand 6 months later (really only 20 minutes later because I'm so forgetful).

What does good looking code have to do with coding like a girl? Until your post, I 've always felt that my style was driven by testoterone. Talk about damaged ego....

Posted by: Jon Price | Mar 30, 2006 8:38:18 AM

Another female programmer here. I just wanted to add that in my universe of programmers we talk about if the code is 'elegant'. Often the question arises if we have time to do it the elegant way (aka, the 'right' way) or 'must' do it a more 'ugly' way due to time constraints. I am always on the side that the elegant way will pay off later - but I don't always win!

Posted by: Jeanne | Mar 30, 2006 8:51:36 AM

I don't know about "pretty" code, but I try to make my code handsome, easygoing and fun. Add "spontaneous" and you'll get my personal ad. :-) Good article.

Posted by: ppk | Mar 30, 2006 9:23:56 AM

I've seen a lot more "unaesthetic" code lately (well, over the last ten years), and I wonder if it isn't due to the fact that hardly anybody reads anybody else's code anymore. I learned a lot by perusing the 4.2BSD kernel sources, and a lot of the code posted on the old comp.unix-wizards newgroup was quite elegant too. Nowadays it seem like people just post little snippets of code, often not even a complete (working) example. Contrast that to the code examples of (say) Kernighan and Pike's _Elements of Programming Style_. There's a world of difference.

Posted by: Tracy Nelson | Mar 30, 2006 9:37:36 AM

Back in the 80's (yes, I am older than dirt), I read a brief paper in one of the comp-sci journals. A researcher in Europe had gone to various tech conferences and talked with experienced ("good") programmers. He asked them how they knew that a program was "good". The main answer: beauty; if the code looked good, then it usually was good.

This was an empirical study, no actual research, so the question of why "beauty = good" didn't get addressed. My experience has been that programmers who took the time to make the code "pretty" usually took the time to make it "good".

And there's always the "broken windows" theory: if the neighborhood (program) is crappy then people will not take much care in their own dealings with it. If a program looks "ugly" then perhaps previous programmers didn't take the time to fix everything. Bad neighborhood = get in, get out, before something goes wrong.

Posted by: hobbitt | Mar 30, 2006 9:59:11 AM

The comments to this entry are closed.