[erlang-questions] Ways to get started

Loïc Hoguin essen@REDACTED
Wed Jul 13 09:39:20 CEST 2011


On 07/12/2011 10:01 PM, Joe Armstrong wrote:
>     90% of time = understanding the problem
>     10% coding the final version
> 
> (in the 90% I'll write lots of code to throw away - no point in having
> a revision control system for this bit) - I don't want to keep it

This part is very important. That's how good code is written. It is
essential however to write code in the 90% of time, you can't just
"think" about it, you have to try an implementation, learn from the
mistakes you made, try another, and so on, until you find the best one.
First time you might have to rewrite it all, then as you get closer to
your goal you get less and less to rewrite.

Of course most people with deadlines just stick with the first version
of their code. But that's a mistake as it'll leave bugs that you'll have
to fix, and the bad code you wrote for the first deadline is going to
make the next deadlines harder to get. So you write code that becomes
worse as time goes on and the project becomes a mess.

If you can't use Joe's method when starting a project and still meet the
deadline, then the planning was wrong and you simply needed more time.
Don't kill your projects at birth just to meet some arbitrary time
requirement. Because I'm sure you all know that estimating development
time is far from a science.

> Zen development - no tools - just your brain - all we are doing
> in making pleasing patterns of zeros and ones that follow the way
> of programming. If we follow the way the programs will please us.

"Zen" is kind of overused. But that sums it up nicely.

Note though that while good tools aren't necessary for development, they
are important for maintenance, bug fixing and even bug detection.
Bisecting for example allows to find causes of regressions much more
efficiently than printf.

Tests, dialyzer, git and all the other tools become important only when
you are done iterating over your program's architecture. But even then
they aren't as important as the code itself.

-- 
Loïc Hoguin
Dev:Extend



More information about the erlang-questions mailing list