Log in

No account? Create an account
Previous Entry Share Next Entry
Code Like a Girl
buzzed, B&W
So, Tony linked to this article titled "Code Like a Girl."

I find it interesting that while from how they describe things, I probably write "girl code" but in my mind, so do most engineer types - it's more pragmatic to write code that "looks right." It makes it easier to read, easier for others to read, and you spend less time trying to figure things out when you revisit the code months, or even years, later.

So, the crux of the article: "Things that aren't just functional, but easy to read, elegantly maintainable, easier--and more joyful--to use, and sometimes flat-out sexy." (Note this can be extended beyond code.) While I think there's definite beauty to physical objects where form follows function, I'm not sure if I agree that it applies to code . . .

I think a good example of my writing "girl code" was yesterday when I finally caved and rewrote the underlying code to one of our webpages. I ended up moving things to functions, removing all the superfluous tables, etc etc. Though, by adding some line breaks, I apparently screwed up the DOM, and the JavaScript that used childnodes() got broken, so I had to rewrite that as well. Unfortunately, I don't know anything about DOM, so the code is hacked - it works, but I really do need to sit down sometime and figure out how DOM works, and how nodal hierarchy is determined . . .

  • 1
White space is preserved by mozilla in the DOM, but I believe IE removes empty white space text nodes. Better to use XPath.

Also, childNodes isn't a function, it's just a property.

  • 1