LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Functional or Procedural? (https://www.linuxquestions.org/questions/programming-9/functional-or-procedural-644780/)

heavensrevenge 05-26-2008 02:32 AM

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.

heavensrevenge 05-26-2008 08:39 AM

Any opinions??

pixellany 05-26-2008 08:51 AM

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.

terrio 05-26-2008 10:34 AM

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.

heavensrevenge 05-26-2008 11:34 AM

Quote:

Originally Posted by pixellany (Post 3164965)
First, what is a "padigram"? Did you maybe mean "paradigm"??

By gosh you're right, I never actually heard it used in proper context until now then.. thank you for the correction :) Took me a couple trys to pronoune the damn thing and get it straight in my mind (pair-a-dyme) got it :P

Quote:

Originally Posted by pixellany (Post 3164965)
Second, I doubt that I am the only one here that does not know what is meant by functional or procedural programming.

Good point, I DO know the difference, but sadly since I'm so new to the whole concept/separation of the "paradigms" I can't quite explain it clearly enough in a precice enough way yet. But if your patient, this presentation happens to mention it in a way you may feel comfortable with grasping http://blip.tv/file/324976/ I do enjoy watching many presentations and tech-previews, and Google Talks.

graemef 05-26-2008 05:55 PM

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.

trashbird1240 05-26-2008 06:18 PM

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

sundialsvcs 05-26-2008 09:10 PM

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.

taylor_venable 05-26-2008 09:40 PM

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).

heavensrevenge 05-28-2008 06:27 AM

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. :)

bigearsbilly 06-02-2008 05:26 PM

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.