# Friday, October 09, 2009
« Fluent NUnit Assertions | Main | Erlang’s sweet spot »

Sometimes you need a paradigm shift, a different way to look at the same set of problems. Erlang I hope will give me that paradigm shift. Hopefully I can add another a screwdriver to my toolbox, if not, hopefully something besides a hammer.

I just bought a copy (on PDF) of Programming Erlang Software for a Concurrent World. I’ve only gotten through the first few pages of chapter 1, and so far I’m impressed. I guess its no surprise as the book is published by Pragmatic Programmers.

I finally understand why mathematicians like functional languages.  Its so obvious now, and it has a lot to do with immutability. From the book:

When I went to school, my math teacher said, “If there’s an X in several different parts in the same equation, then all the Xs mean the same thing.” That’s how we can solve equations: if we know that X+Y=10 and X-Y=2, then X will be 6 and Y will be 4 in both equations. But when I learned my first programming language, we were shown stuff like this:
X = X + 1
Everyone protested, saying “you can’t do that!” But the teacher said we were wrong, and we had to unlearn what we learned in math class. X isn’t a math variable: it’s like a pigeon hole/little box.... In Erlang, variables are just like they are inmath.When you associate a value with a variable, you’re making an assertion—a statement of fact. This variable has that value. And that’s that.

I guess mutability is a strange beast for most people when learning to program, forcing a lot of them to quit while in their first year of CS.  Well, that and pointers. Its an odd way to think of things for people living in a concrete world. I wonder if first year CS students wouldn’t have an easier time learning a functional language?

Friday, October 09, 2009 1:09:12 AM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  |  Related posts:
Erlang’s sweet spot

Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview