Programming
Home
My family
Hobbies
Religion
My Bookshelf
Programming
O'Caml
Tools
Links
CV
News

 

Some tips about programming I learnt during the years.

  • Programs should be compact

Minimizing the number of lines of code you write is very important.

You need overview to understand a program. If it is too long, you get lost. Therefore one of the most important aspects of a programming language is a compact syntax. Thus, Java is a failure, since Java-programs are not compact. (APL and J are very compact, but not readable, at least not for me.)

  • Don’t do it yourself, search on the web

There is a vast amount of good code around there. Both open source, and just samples. A large amount of it can be used within commercial code.

  • Always have a todo-list

Even for private small projects, so that you constantly move forward.

  • Don’t spend time creating a framework in advance

Create it it in the middle of the project from the parts you already done. It is essentially just refactoring.

  • End projects with a postmortem. An example can be found here.

Always try to learn from each project

  • Create a list of error messages

When you start using a new tool, collect all error messages you got and also write how you solved it.

For example, in the early days of C++-compilers, if you wrote

‘CFoo x;’ and you forgot to include cfoo.h, you got a ‘syntax error’.

So on your list you should have ‘if ‘syntax error’ then check if header-file for type included’. I have seen programmers spend 4 hours trying to understand that they forgot the include. Many can do the same mistake several times, they don’t learn.

  • Never use tools that lacks a debugger.

Too many people have wasted time trying to add print statements to their JSP-pages to find bugs. This is the slowest way of developing that exists.

  • Before you check in look at the diffs

Always use source-code management, even for private projects.

In some projects, we even printed out the diffs and peer-reviewed them before checking in. Many bugs are found this way.

  • Always develop threaded applications on SMP-machines

Threading bugs will occur a millions times more frequent on multi-processor machines. The quality of the code will increase enormously.

  • Don’t scale up projects

10 people doesn’t make much more than 3. However, two people makes much more than one. Programming is elitist, there is no place for mediocre programmers in the core of projects, they are just in the way.

If you want to increase the speed of the project, the only place where you can scale up is at

  • Testing

  • Adaptations for specific markets, customers or segments 

  • Collecting requirements

  • GUI-related: layout, graphics, internationalization

  • Usability tests

Maybe the best idea is where you create two separate core projects and let them compete. After a while, one of the projects is killed and the best ideas of that project is used in the surviving project.

Page accessed 2585 times.
 
Copyright 2001, Mattias Waldau. Last edited on Sunday, November 25, 2001