I don't grok OCaml at all, since I've never even laid eyes on it, but I identified with his personal story of moving from one mind-warp to the next as he matured as a developer. I've now hit the OMG! Functional Programming! stage myself, which leads to an uncomfortable (some days actually painful) cognitive dissonance while I toil away for 8 hours a day writing VxWorks-based C code for a mega-corporation.
I never really went through any stages, i just started using python and suing functions seemed better for some reason than using classes. Now im learning scheme and i am sort of starting to get it.
"Python offers it all, functional, procedural, object-oriented. So you just choose hwta fits the problem best and dont worry about politics."
I find the idea that Python offers it all surprising, for example my understanding is that anonymous functions can only be one line and you cannot write generic functions a'la CLOS.
If that is the case, while Python may offer a terrific language for Getting Stuff Done, you may want to consider learning other languages on the off chance that they actually do more in each of their respective areas. Then, when you return to Python you can apply what you've learned.
Yes that is true and I know a lot of languages and while Python perhaps doesnt offer as deep possibilities within each paradigm it offers every paradigm.
As you said this makes it very good for writing programs and does so in a lot of different domains but perhaps when digging really deep into one area you can find something better suited.
yeah, im learning django now and models have to be classes and views are functions. You generally have to understand both functional and OOP to be good. Im not a fan of any of the pure languages. Multi paradigm is my choice, but i still would prefer functional to oo solutions to problems.
Without being an expert, I'm pretty sure that OCaml is more strictly functional than Erlang and Javascript, though they all support functional programming to one extent or another. With languages like Javascript and Ruby, you can program for years without really learning functional concepts. I think OCaml is the opposite; the paradigm of least resistance is functional, even though you can program in other styles (OO, imperative).
In terms of functional purity, Haskell > Lisp/Scheme/OCaml/ML > Erlang > Ruby/Javascript > Python > Java > etc.
True, it is virtually impossible to do much of anything in Erlang without using a bunch of little functions. Immutability is a harsh mistress, but one that I've already fallen in love with.
Learning to love the one you're with is fine, however that does not necessarily lead to the type of "mind warp" he's describing.
I like JS enough to blog about it, but I confess I haven't found in it that marvelous thing that makes me see programming in a new light. So it may be that although Javascript is where you want to use your FP chops, Lisp or Ocaml is where you want to acquire them.
A lot of that has to do with Javascript's environment. While it is a functional language, it's living in a decidedly procedural world. The DOM is defined in IDL, for goodness sake, and even the really cool libraries like jQuery don't make much use of the functional paradigm. So there's not a lot of clever code to study that doesn't look like C, basically.
Nonetheless, there are all sorts of clever things you can do with closures in Javascript to avoid big declarations of global variables, etc... You just have to dig really hard to find the sample code that appears in the tutorials for lisp, haskell, ML, etc...