Alex’s Notes

Alex’s Notes

Alex Reid  //  By day I'm a web-database systems developer. At all other times I'm a web geek, petrol head, anorak-level Beatles fan and father of one from Newcastle upon Tyne, UK.

All of the dubious opinions stated here are purely my own and not those of my employer.

Jul 21 / 10:05am

What's your #1 development tip?

As developers we continually seek to improve our game. In good teams, people share approaches and patterns.

One approach I use a lot is to write each step of functionality as a one line comment. After all the steps have been 'defined' as comments, I review and refine them - possibly changing the order and refactoring before any code has been written. Once I am happy with the comments, I find that filling in the implementation between the comments is easy.

It keeps code focused and forces me to consider the whole problem before diving straight in.

I obviously haven't invented this approach but it works for me. If you prefix the comments with TODO: in Eclipse, it populates the To Do window. Neat.

So that's one oldie that works for me. What approaches along these lines would YOU recommend?

Loading mentions Retweet

2 comments

Jul 22, 2009
David Lavery said...
I like to borrow the green mantra "reduce, reuse, recycle". Reduce - careful design to reduce the amount of code needed to make an app work; Reuse - think of coding in reusable blocks (functions, classes, whatever), so as never to write the same code twice; Recycle - look to pinch bits of code from previous projects, or the wider world (being careful of copyright, of course).
Jul 22, 2009
Alex Reid said...
Yeah, the DRY (don't repeat yourself) principle is another good one.

Your point about code reuse and copyright/licensing raises an interesting question.

If I develop a system for client A, is it OK to refactor generic parts of that code into a library that I'd reuse for client B and client C?

Is this unfair on client A who could argue they have paid for the development of the said library?

What about if client A wanted to hire another developer to extend the system but was able to do so very easily due to the hard work *I* had put in on the library of reusable functionality?

Maybe the business of software doesn't always neatly tie-in with good development practices.

Leave a comment...

 
Got an account with one of these? Login here, or just enter your comment below.
Posterous-login    twitter