skwpspace yan pritzker’s home on the web

skwpspace is Yan Pritzker's home on the web

Blog :: Photography :: About Me

TwitterCounter for @skwp

Get the news feed
Get updates by email
Follow me on twitter

hello, i'm yan

This blog is about startups, blogging, Ruby On Rails, virtualization and cloud computing, photography, customer service, marketing, ux and design, git, and lots more.

Top Posts

planypus

I'm the founder of Planypus, the place to share your plans!

cohesiveft

Accessible, manageable, virtualized application stacks ready to download or deploy to the cloud!

flickr

it's hailing in san franciscojessatianalyndaBird in the handkerimodeldanielle pettee and models-4449

Archives

Contact

Reach me at yan at pritzker.ws

Posted
21 August 2006 @ 11pm

Tagged
software, thoughts

writing meaningful code

I work in the travel industry. Those of you who have ever had experience with air travel, you may know that this industry is full of complex business rules, exceptions, exceptions to exceptions, and general mayhem. Couple this with the nature of our product: a switch between airlines and travel agencies, and you get a whole lot of code that does lots of little complex manipulations on our domain model to get it to dance to this cacophany. The net result is a lot of unreadable code that can’t really be made more readable—or can it?

I find that whenever there are even four or five lines of code that I cannot understand at first glance, they’re a good candidate for refactoring into a method. I will even go so far as to say that any _one_ line of code that cannot be easily understood should be encapsulated in a well named method. The reason for this is your code then starts looking like doSomethingGroovyAndComplicatedWith(Someobject). This acts as an automatic description for what’s going on without any extra comments. Instead of writing a thirty line method of messy code, break it up into six little methods and give each step a careful name. Now your thirty lines of junk has turned into six lines of meaningful code, with the details hidden. This may be obvious until you look around the codebase and realize how rarely this is done.


5 Comments

Posted by
teen tight ass hole
17 March 2007 @ 11am

teen tight ass hole…

abrikoskos 2608452 Relevant search results and links for teen tight ass hole…


Posted by
ciara facial teen
17 March 2007 @ 9pm

ciara facial teen…

abrikoskos 2608452 ciara facial teen company…


Posted by
ideepthroat
30 March 2007 @ 5am

ideepthroat…

Description of ideepthroat….


Posted by
car part pontiac
11 May 2007 @ 4am

car part pontiac…

ha-rd-po-rn-fu-ck 1702789 Features of car part pontiac….


Posted by
rc ufo
3 June 2007 @ 11am

rc ufo…

ka-ka-sh-ka 1702789 Aggregator of rc ufo sites…


Leave a Comment

Rails fragment cache with memcached-client and time-based :expire option OS X productivity tip: dock as taskbar