[erlang-questions] Ways to get started
Josh Johnston
josh@REDACTED
Tue Jul 12 00:03:38 CEST 2011
I'd like to add to this and say that when I started out with erlang, Makefiles were one of the hurdles I faced. Having never written a makefile before it seemed an unnecessarily cryptic way to get files compiled. Of course, there were plenty of examples out there and I was able to _mostly_ get it to do what I wanted.
But like Joe describes below, it doesn't need to be like that. My epiphany came the day that I realized what my makefile was doing: stepping through .erl files, and using erlc to create .beam files. No magic. With that realization it took me 5 minutes and a few lines of php to do _exactly_ what I wanted and never have to bend my head around a makefile again. Those who have spent years writing makefiles might find this a little stupid :P But to me it removed the hurdle and made it easy to get stuff done, which is why we write code, right? :)
It seems that complicated tools and processes can often hide the underlying simplicity. Of course you might get to a point where you need those tools, but for a beginner the most important thing is to dispel the illusion and see how simple it actually can be.
Josh.
On 12/07/2011, at 6:49 AM, Joe Armstrong wrote:
> I'm old school - you don't need any fancy tools. Just a text
> edit and an erlang shell.
>
> Open your text editor:
>
> Type in the following program.
>
> -module(hello).
> -compile(export_all).
> start() -> "hello world".
>
> store it in a file called hello.erl
>
> Start and erlang shell. It will say ">"
> Type in two commands:
>
>> c(hello).
>> hello:start().
>
> The first command compiles the program. The second evaluates
> the command hello:start()
>
> Thats all it takes - typing three lines of code into a file
> with a text editor - then typing two lines into the shell.
>
> That's all it takes. 95% of all the fun can be achieved with a simple
> text editor and the erlang shell. That's how most of the erlang system
> was implemented.
>
> The erlang shell can be installed in zillions of ways - compile the
> sources or apt-get install it (or whatever)
>
> Forget about git/IDEs/rebar etc.
>
> Use this approach for all languages.
>
> IDEs and build tools are the single biggest obstacle I know
> of to getting started.
>
> Me I use
>
> - a shell
> - makefiles
> - emacs
>
> for all know programming languages under the sun.
>
> 98% of all the fun can be had with the compiler alone - all the rest
> is hype.
>
> Forget about the tools -
>
> Tools like rebar etc are under to automate something but if you don't
> know what it is that you are automating and if the tool doesn't work
> you will just end up being incredible confused.
>
> Then buy a decent book and type in the programs by hand.
> One at a time thinking as you go.
>
> After 30 years you will get the hang of this and be a good programmer.
>
> Tools are no substitute for typing in small programs and
> understanding exactly how they work. This is true for all programming
> language. Programming is an art form, there is no easy way.
> Like playing the violin - is there an easy way of playing the violin other
> than by practising for thousands of hours? I think not.
>
> Start with one liners in the shell, start the shell:
>
> type
>> A = 1
>
> then
>
>> A = 2
>
> ask what happens and why.
>
> There is no quick way to learn programming - no tool will help.
>
> Your brain is a zillion times better than the best IDE. programs
> form in you brain not in an IDE.
>
> But then I'm old school.
>
> Have fun - if it's not fun it is pointless - don't fight the tools
> all you need is a text editor and the erlang shell to start with.
>
> /Joe
>
>
>
>
>
>
>
>
>
> On Mon, Jul 11, 2011 at 10:27 PM, Mihai Balea <mihai@REDACTED> wrote:
>>
>> On Jul 11, 2011, at 2:13 PM, Garrett Smith wrote:
>>
>> I'd be curious to know what editor/IDE/toolset people use other than
>> Emacs. Catch is, you have to be overall happy with it :)
>>
>> I use Text Mate, it's fast and there's a decent Erlang bundle available.
>> CLI for building and everything else.
>>
>>
>> Use a system package (e.g. aptitude, yum, pacman) or a mainstream
>> installer. I wouldn't mess with compiling from scratch, much less
>> getting source from github.
>>
>> I always build from the official sources. It's quite easy, basically just
>> configure, make, sudo make install
>> Distro packages tend to be outdated, Mac packagers as well.
>>
>> Mihai
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
More information about the erlang-questions
mailing list