Wednesday, October 21, 2009

Armstrong Chapter 4

This chapter in the thesis on Erlang dealt with programming techniques. The two big topics covered were fault tolerance and abstracting out concurrency.

The author pointed out that concurrent programs are harder to write, so making a module that takes care of all the concurrent part separate can be a big gain for maintainability and reliability. Because Erlang only supports one way of communicating between processes (message passing), the language can be fairly simple to use when performing this task.

The fault tolerance discussion was quite interesting. The author listed several practices that help, including letting other processes handle the failure, crashing on an error and intentional programming. As part of intentional programming, Armstrong recommends NOT programming defensively, something sometimes taught religiously on the security side. However, the author is not saying to NOT check arguments, but that Erlang automatically treats unrecognized input as an error anyway. Having this feature built in to the programming language eliminates potentially confusing code meant to capture error cases.

No comments:

Post a Comment