Pavel Mendl
Posts: 1
Nickname: pmendl
Registered: Nov, 2010
|
|
Re: How Has Functional Programming Influenced Your Coding Style?
|
Posted: Nov 23, 2010 3:03 AM
|
|
I am very new to the functional programming paradigm. In fact I came here to learn about this concept and understand, where I can get benefit from it in my programmer praxis.
I always stream to understand the substance, not the various outer signs of any new phenomenon; thus I do not speak about various languages, just about the concept itself.
Initial impulse was this Slashdot thread: http://tech.slashdot.org/comments.pl?sid=1878200&cid=34303544 stating IMHO far too authoritatively: Future of Programming by igreaterthanu on Monday November 22, @08:31AM (#34303544) This just goes to show that if you care about having a future career (or even just continuing with your existing one) in programming, Learn a functional language NOW!
What I learned so far is, that functional paradigm streams to have no states and that this is because of target of as easy an unlimited multithread scaling as possible.
My first question thus is: Do I understand the basic premise of functional programming well, or did I miss something?
If I am true, than the proper functionally programmed code will not store any "intermedial" values, but in case they are needed just recompute them again from the original generating functions. Am I still right here?
If yes, then all the object vs. functional paradigm resembles me the well known true, that you can freely trade CPU time for memory and vice versa. As if you recompute eventually complicated generating functions instead of storing state (i.e. the already once computed value) in the memory, you spare memory but waste CPU time (what is obviously better suited for massive multithreading on multi-core processors). However, once you hit the scaling boundaries (power dissipation, price...) you can increase throughput only by saving some intermittent results, i.e. allow some states into game. Can this be used as the rule of thumb where (and how much strictly) use functional programming paradigm? Or where am I wrong?
Thank you for any comments and clues.
|
|