Registered: Jun, 2004
Posted: Sep 21, 2006 6:43 AM
> When I was programming in C++, I had great pains with manual memory
> management. With Java these pains are gone, and 99% of the bugs of my
> programs are now gone. I have no reason to move to another language,
> and so are most of other programmers.
> I never understood why [referential transparency] is important. In the
> real world, things must be done in order, otherwise they don't work.
> Personally, I think functional programming languages are marginally
> better than imperative ones, and that's the reason functional languages
> have not been widely adopted.
> [...] the reason that other "better" languages are not adopted is that
> they do not offer something so advanced as to really change the way we
> are programming. I have often heard functional languages supporters
> claim that "once the program typechecks, it is usually correct". Well,
> guess what? that happens to me with Java as well; and to my colleagues.
> So why should I learn Haskell or Ocaml, for example? just to type a few
> less characters?
Just what is it that you are trying to achieve? What is the motivation behind you spending time discussing these issues?
Excuse me for being frank, but it seems to me that you are just trying to find excuses for your own ignorance and inability to understand functional programming. I know that you've been at this for a long time. In my opinion, long enough that you should have been able to learn the kind of benefits that, for example, referential transparency (or lack of side-effects) can bring to the table if you really wanted to.
Personally, I strive to gain a deeper understanding of programming. I have about 3 shelf meters of books (on various programming related topics such as logic, discrete maths, theory of computation, algorithms, specific programming languages, OOA/D/P, FP) on my bookshelf and I read articles on various aspects of programming languages and programming tehcniques on a daily basis. I don't know about others, but I didn't just understand techniques like parser combinators after reading a single article on them. It took me a couple of articles to get the crucial "Aha!" -experience. I also didn't learn the basics of functional programming instantaneously. I read several book length introductions to functional programming and spent time programming in various languages that support functional programming. The point here is that I don't just sit on my ass trying to find excuses to avoid learning about topics that I don't understand. Also, learning is something that you need to do by yourself. It is not (yet) possible to just transfer understanding from one brain to another. No FP guru can just make you instantaneously understand what FP is all about.
So why should you learn FP? Depending on what you are trying to achieve, the answer may even be that you shouldn't. Personally, I strive to gain a deeper understanding of programming. Alan Perlis once said: "A language that doesn't affect the way you think about programming, is not worth knowing." Speaking for myself, spending a couple of years learning higher-order and functional programming after spending many years on learning first-order, imperative, and object-oriented programming fundamentally changed the way I think about programming.
The programs that people create in higher-order languages, for example, are not just a few characters shorter. The programs also contain many abstractions that are awkward to express in first-order languages or languages that merely enable (but do not support) higher-order programming.