Erlang hints for an OO junkie?

Johan Warlander johan@REDACTED
Mon Aug 9 21:38:21 CEST 2004


On Mon, 9 Aug 2004 20:31:43 +0200, Bjoern Knafla wrote
> All of this is very vague and far from a turn-key advice - but I 
> haven't used Erlang or another functional language for something 
> more than simple algorithms and am therefore also seeking for the 
> best way of unleashing their power.

A fellow soul in search of answers :) Thank you for the input though, there
were a few things in there that I hadn't thought about at all.

> PS: By the way: professional game developers seem to dislike using 
> grand scale inheritance for modelling entity behavior. For example: 
> using inheritance languages like C++ make it very hard to change the 
> behavior of an instance at runtime or to use data driven design to 
> describe the behavior of entities.  If in your example a sword 
> should also get attributes for dealing fire damage and giving you 
> mana back you would need more and more base classes which makes your 
> code more and more inflexible and hard to maintain because to add a 
> capability to an entity or classes of entities you always need to 
> inherit and then to add code and debug possible problems (method 
> name conflicts etc). Aggregating attributes by "has a" relationships 
> allow easy run-time changes of behavior and late additions or even 
> changes by users 
> (modding) - though this is only a bit I have read while lurking on 
> game dev lists and am missing real experience to backup that bold 
> statement ;-)

*grin* I have quite a few years of experience in developing text-based online
games, and what I realise as I look back is that most of that time was spent
learning how NOT to do it ;) But yes, if you develop a game in a language like
C++ I can see the advantages of "has a" relationships; I've mostly found
though that for my own purposes, going as low-level and/or static as C or C++
is just a waste of my time - I've done most of my recent work with LPC, which
is a pretty dynamic, interpreted language making it easy to change anything in
runtime.

However, I'm really enjoying learning Erlang for it's concurrency and error
handling / fault tolerance aspects.. It would be great to be able to make
something with it :)

Johan



More information about the erlang-questions mailing list