Infoworld: Functional programming: A step backward
Unless you've been living under a rock, you know functional programming is all the rage among the so-called alpha geeks. Perhaps you already use a functional programming language. If you use a more conventional language like Java or C#, you're probably aware it has functional programming features in store. While this brave new world is upon us, and before we take things too far, it might be a good time to pause and reflect on the appropriateness of functional programming for everyday application development.
What is functional programming? The simple answer: Everything is a mathematical function. Functional programming languages can have objects, but generally those objects are immutable -- either arguments or return values to functions. There are no for/next loops, as those imply state changes. Instead, that type of looping is performed with recursion and by passing functions as arguments.
Any halfway decent programmer can quickly glean the general intent of most imperative code -- even in a language he or she has never seen. While you can certainly figure out what functional routines do by looking at them, it may not be possible in a glance. Unlike imperative code, functional code doesn't map to simple language constructs. Rather, it maps to mathematical constructs
We've gone from wiring to punch cards to assembler to macro assembler to C (a very fancy macro assembler) and on to higher-level languages that abstract away much of the old machine complexity. Each step has taken us a little closer to the scene in "Star Trek IV" where a baffled Mr. Scott tries to speak instructions into a mouse ("Hello computer"). After decades of progress in making programming languages easier for humans to read and understand, functional programming syntax turns back the clock.
...continued...
Read the rest of my article over at InfoWorld..
After you're done. Please consider sending me ideas on other topics you'd like me to write about. I'm always looking for ideas.
Comments
Disagree
I think on the contrary, Functional programs are easier to read because of their modularity, immutability, etc.
Whose fault?
If mathematics is 'unreadable' is it the reader's ignorance of mathematics or issue of notation?
If someone can't read a particular language (English, German, Arabic etc) is the language at fault?
Programming is a reflection of 'crisp' automated thinking. Since programming languages have deteriorated (I.e.under guise of user-friendly) to accommodate LAZY thinking among devs, even simple ideas of functional programming are perceived unreadable. Systems for end users have to be user-friendly. Tools should be most efficient in delivering those systems. Programmers are NOT end users. If there is a lack of effort or willingness to think, may be it's time to pursue other career choices.
(Note: I am in troll mode ;)
(Note: I am in troll mode ;) It's all about making habits and nothing more. One should use F# (for example) in at least 3 different real world projects and then talk about it; if not, then everyone can talk about everything (like clerics in every religion)!
And purity is forced an very few Functional languages (I am aware of just Haskell, Erlang and to some extend Clojure). But for F# (for example) after writing 1 or 2 projects you can not live without it's features and syntax if far simpler and cleaner than (again for example) C#.
yoocos
I have to disagree by saying only that.
The most used programming language in the world is a functional programming type. And this language is the one used for Excel formula.
Everything is a function there. I haven't seen another programming environment used by non programmers like this one.
Post new comment