LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


View Poll Results: Functional or Procedural?
Functional 9 60.00%
Procedural 6 40.00%
Voters: 15. You may not vote on this poll

Reply
  Search this Thread
Old 05-26-2008, 02:32 AM   #1
heavensrevenge
LQ Newbie
 
Registered: Mar 2008
Location: Canada
Distribution: sidux & FreeBSD
Posts: 9

Rep: Reputation: 0
Question 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.

Last edited by heavensrevenge; 05-26-2008 at 11:25 AM. Reason: wrong spelling
 
Old 05-26-2008, 08:39 AM   #2
heavensrevenge
LQ Newbie
 
Registered: Mar 2008
Location: Canada
Distribution: sidux & FreeBSD
Posts: 9

Original Poster
Rep: Reputation: 0
Any opinions??
 
Old 05-26-2008, 08:51 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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.
 
Old 05-26-2008, 10:34 AM   #4
terrio
LQ Newbie
 
Registered: Jan 2007
Location: Halifax, NS
Distribution: Linux Mint
Posts: 29

Rep: Reputation: 15
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.
 
Old 05-26-2008, 11:34 AM   #5
heavensrevenge
LQ Newbie
 
Registered: Mar 2008
Location: Canada
Distribution: sidux & FreeBSD
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pixellany View Post
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 View Post
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.
 
Old 05-26-2008, 05:55 PM   #6
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
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.
 
Old 05-26-2008, 06:18 PM   #7
trashbird1240
Member
 
Registered: Sep 2006
Location: Durham, NC
Distribution: Slackware, Ubuntu (yes, both)
Posts: 463

Rep: Reputation: 31
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
 
Old 05-26-2008, 09:10 PM   #8
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,636
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
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.
 
Old 05-26-2008, 09:40 PM   #9
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 43
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).
 
Old 05-28-2008, 06:27 AM   #10
heavensrevenge
LQ Newbie
 
Registered: Mar 2008
Location: Canada
Distribution: sidux & FreeBSD
Posts: 9

Original Poster
Rep: Reputation: 0
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.
 
Old 06-02-2008, 05:26 PM   #11
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
functional programming in C++ synss Programming 2 08-03-2007 01:33 AM
GuI non functional vadivelsurya Slackware - Installation 2 01-24-2006 10:05 AM
loading procedural languages in Postgresql sibtay Linux - Software 1 12-09-2004 08:23 AM
scripting non-functional! Krenn Slackware 4 07-18-2004 08:29 PM
Functional desktop cb9fl Linux - Software 1 05-29-2004 03:19 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration