Tuesday November 22, 2005

The Way of the Code Samurai

Good Tips for Coding

I peruse the Delicious linkfest page periodically when I need something new to read - usually when I need a break from coding. What I found today is an old article, but really sums up good coding techniques..

Free Programming Tips are Worth Every Penny

Here's a summary - "* The Way of the Code Samurai *"

  • Think first. Think some more. Don't write code until you know what you're doing. This goes to design. A good basic design will accomodate lots of modifications in the future. You must understand business processes, both what is for the Now, and what will be in the future. Understanding both will get you headed in a good design direction, and the application will have the ability to grow and change easily as business processes evolve over time.
  • Write all your code "clean," the first time you write it. It's hard to say how many times I've looked at old code and said "what was I thinking?" Some of that is because I've learned over time new ways of doing things that are more effecient, but sometimes, I took the easy route, and did the QnD (quick and dirty), only to have to go back and fix it - the right way.
  • If you're in code anyways to extend it or fix a bug, CLEAN IT. This is refactoring, always trying to make the code better, more flexible, more extensible. Sometimes doing this takes a little longer, but In my mind is mostly worth it.
  • Less source code is better. Less for your successors to learn, figure out, and, inevitably, to fix.
  • Optimize methods ONLY after they work - Don't optimize as you write. I do this all the time. I write a piece of code, sometimes several that do similar things and get it all to work. The trick is to recognize the fact that some modules can be combined, and go back and combine them, passing the parameters to make a single module do many things. The advantages cover much of the earlier points. But, get it to work first, then combine.
Posted by markj at 11:01 am  |  Last Edited by markj @ 11:19 am
Comment Posting Closed (0 comments posted)  |  Trackbacks (0)  |  Permalink
(Posted to: Development)
No longer accepting trackbacks on this entry.

About the Author

is a Web Application Designer working in the suburbs of Portland Oregon.

He specializes in bringing user-centered, standards based, easy to use applications developed using Oracle web technologies.

This blog will focus on the crossover of standards based design and web application development with Oracle technology, and an occasional sprinkling of articles about his newly discovered "Entrepreneurial Spirit."

The Archives

Categories

Quick Hits

[View All by Month]

RSS Syndication

Syndicated
Subscribe with Bloglines

Validation

Valid XHTML 1.0!
Valid CSS!


Copyright ©2004-2010 On The Mark Technology, LLC. All rights reserved.
Unauthorized access is prohibited. usage will be monitored.
CCBot/1.0 (+http://www.commoncrawl.org/bot.html) on CCBot/1.0 (+http://www.commoncrawl.org/bot.html) at