Functional or Procedural?
Hello LQ, I'm wondring, if given the chance, what paradigm of programming would you WANT or enjoy programming in most?? Undoubtly Procedural is the majority by history, but if given the chance without previous factors(current project lock-ins), at this current, day, age and moment, would you prefer a Functional or Procedural language??
Thanks in advance as it's something I'm very much curious about, and I don't rally have a preference as of yet. |
Any opinions??
|
First, what is a "padigram"? Did you maybe mean "paradigm"??
Second, I doubt that I am the only one here that does not know what is meant by functional or procedural programming. |
Here are the wiki pages for both Functional and Procedural Programming:
Functional Programming: http://en.wikipedia.org/wiki/Functional_programming Procedural Programming: http://en.wikipedia.org/wiki/Procedural_programming Having experimented with both types I can say I prefer Procedural. |
Quote:
Quote:
|
There are more than two paradigms in program development and since a paradigm is a way of thinking preference is often more about what you are familiar with. For me I spend a lot of time with the OO paradigm so I find that a more comfortable way of developing, however I have done quite a lot of procedural programming so I can switch to that when necessary. I haven't spent a lot of time developing with the functional paradigm but I can see some advantages that it has over the others, specifically the mathematical rigour that it can bring to the development process. However, personal comfort wins out when I have to make a choice, so unless you are offering a brain rewiring service with this poll I guess that, for me, procedural wins out over functional.
|
Lisp allows multi-paradigm programming; functional style is encouraged definitely, and safer in all respects, but procedural style is necessary for creating an executable program. Lisp is truly a general-purpose programming language. My favorite is Scheme (Gambit-C in particular).
Joel |
It simply depends on what you want to do.
For instance, I like to fiddle around with a GPS-based game called Terracaching, and in my area there's a rather intricate puzzle-cache which had a logic-problem with 22 constraints and a 6x6x6 set of conditions to be determined. The cache was rarely found since the puzzle is so difficult. But a "gprolog" program solved the puzzle in about twenty seconds of computing on my slow hardware. It blasts through any "sudoku" puzzle in a few milliseconds. |
Two things may be worthy of note: (1) that there are a lot of other styles of programming as well, like "declarative" (PROLOG, for example) and "stack-based" (FORTH or Factor, for example). (2) Any decent multi-purpose language will transcend any particular paradigm: Haskell is useless without monads which allow you to write procedural code, and AJAX applications rely heavily on certain functional capabilities in JavaScript.
That said, my favorite languages are ones which are typically considered "functional", and especially those which are strongly and statically typed: Haskell, SML, OCaml. As an aside, if you're interested in seeing just how paradigms can be mashed up successfully in various languages, try Erlang (functional + declarative) or Haskell (functional + procedural). |
Thank you to the few that answered, I will pursue the path of functionality with Learning 1st Haskell, and then Joe Armstrong's Erlang book afterwards to know both reasonably buzzy words to open a few extra doors for me. Thank you once again, and yes I'll indeed try to join in on this forum a bit more!! You guys are pretty awesome and knowledgeable. :)
|
well, I reckon functional minimizes distance between brain and keyboard.
procedural minimizes distance between the hardware and keyboard. learn both ends. I like C, Perl and Lisp. |
All times are GMT -5. The time now is 07:08 AM. |