[erlang-questions] Ways to get started
Wed Jul 13 11:18:57 CEST 2011
On Wed, Jul 13, 2011 at 9:39 AM, Loïc Hoguin <> wrote:
> 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.
Absolutly - when a team of programmers in volved you need all these things.
But this thread was called "Ways to get started".
I suggested in the beginning writing a three line program and typing
two lines into the shell.
That's how to get started.
Actually in my book I don't get to storing modules in files until
chapter three. So we could omit the three line program.
So here's the short version of how to get started:
1) Install erlang (read the FAQ to do this)
2) type erl - you should see a prompt like this
3) type a command and end it with a dot
> 1234 + 34535.
REPL systejs are brilliant since the barrier to entry is very low.
Just remember the "." at the
end of every line :-)
That's how to get started - telling people that you need to set up a
complex tool chain
before you can do this is nonsense. This comes far later, and anyway
setting up GIT or whatever
has nothing to do with Erlang.
> 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
More information about the erlang-questions