Oct 31, 2011

Scala Application Programming is not Math

Programming is one of the most difficult branches of applied mathematics; the poorer mathematicians had better remain pure mathematicians.
- Edsger W. Dijkstra

There is this notion that programming is doing math. It 's not true. Or to put it in a more nuanced manner: It is not true in any meaningful way for an application programmer like me.

I realized how difficult it is to speak to non-application programmers from the reactions I got to last weeks "How to not learn Scala fundamentals". We live in different worlds, me and academia. I tried to expand on my arguments in the follow up, but I probably missed the mark.

The thing is, m.map { t => val (s,i) = t; (s, i+1) }, probably is elegant, and maybe even easy to read for someone exposed to abstract functional code all day long. But for someone who uses Scala as tool, not to improve Scala, but to solve real world problems, abstract descriptions are more or less opaque. We can't easily pick up our rusty university ML experience (if we have that at all) and wrap our heads around "elegant" code like the snippet above. And we shouldn't have to.

If Scala is going to be a main stream language, usable by main stream application programmers, we need to acknowledge that most programmers don't ascribe to the maths based approach to programming.

If you learn Scala without understanding how it all works underneath, you will be less efficient, and sometimes a leaky abstraction will pop up and bite you. But that's ok. You'll still be better off than if you stick to Java. And you will understand more in time, and you'll learn to handle surprises better too.

Scala can boost productivity a lot compared to Java, and you don't need to learn all the "fundamentals" first. That's my message.

No comments:

Post a Comment