Hacker News new | past | comments | ask | show | jobs | submit login

I recently (well, a few years ago) went through functional programming in schools. They don't really teach you functional programming, as much as why you shouldn't program imperatively. Even when they're teaching functional programming, the consistent emphasis on only x% effective really cuts out student interest. It's almost like saying, "yeah we have a method for preventing destructive assignment, but it doesn't really work." While it might seem like a good idea at first, I found it to quickly invoke the I'm not listening anymore response. Next, is the issue of effectiveness. Personally, I've been shown way so many gross images of imperative spaghetti code, that I won't even open vim without knowing I have scala. Unfortunately, this doesn't follow through for a lot of other kids who went through the same education as I did. "I love ruby", "what about python", "it doesn't feel as good as C++", and "it's just too much work" are all (yes I know it's sad) frequently cited responses among people I know.

Thirdly, and most troublesome of all, some people don't care that they're spreading nasty interoperability impedance mismatching in their non-scalaz libraries since they haven't realized that variance annotations are not worth their use in the context of Scala’s partial support for Hindley Milner type-inferencing.

. I recently found out someone I knew was receiving treatment for coding in C. I asked her when she found out, believing this to be a recent development. "I've been coding in C all my life," she responds. I walked out of the room. She's quite active in the C community, and her disdain for scalaz is legendary. How anyone can exhibit that kind of carelessness is honestly, beyond me.

Rather than force Scalaz, I feel we might have to take a completely different approach. Scala is great, but it doesn't work when kids don't want to listen or don't care. Perhaps we need to stress the why here, rather than the how.Why fmap, contramap and xmap are (far) superior alternatives to annotated variances and covariances on map, for example.[2]

Lastly - I know this is really aside the point of this article, but Scala should probably also teach how to properly code using pure functional constructs. Not using Higher Kinded types in favor of Pimped Types, encoding algebraic structures of category theory, understanding type theory, (truly understanding, for real ) the benefits of static program verification, attempting a high (read: extremely high) degree of abstraction in the context of Scala’s limited laziness abilities, etc.

It's kind of sad that we learn all these things by exploration, again and again, generation after generation. I think it's about time we standardized it. Everyone needs to (well, almost everyone) use KleisliMA and FingerTrees one day, anyway. Lets just go one step further and relocate L3 programmers who don't understand (read:truly understand) applicative predictor monads, writer transformers lifted into a pointed functors and the Yoneda Lemma to a desert island in the Carribean and carpet bomb said island with B-32s until the last imperative mofo is subsumed by the dust. A Martin L3 is also known as Beginner Haskell Programmer. Might as well aim higher than Martin.

( Apologies etc. Dedicated to Tony Morris, my personal Haskell hero and Scala superhero 1. http://blog.tmorris.net/critique-of-oderskys-scala-levels/

2. http://scalaz.github.com/scalaz/scalaz-2.9.1-6.0.2/doc.sxr/s...)

3. http://en.wikipedia.org/wiki/Yoneda_lemma




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: