procedural programming

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

rsmarsha
Forum Contributor
Posts: 242
Joined: Tue Feb 08, 2005 4:06 am
Location: Leeds, England

procedural programming

Post by rsmarsha »

I heard someone say they were a procedural programmer.

Not sure what this means really. Do they mean (in the case of php), writing the code to do the job, but without using classes and functions?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Procedural is scripting - from start to finish in a predefined routine (aka procedure) with little flexibility.

The 'alternative' is Object Oriented programming. Where Objects interact with each other, often dependant upon what input was received dictating which objects interact.
rsmarsha
Forum Contributor
Posts: 242
Joined: Tue Feb 08, 2005 4:06 am
Location: Leeds, England

Post by rsmarsha »

So if i was to write a file with no functions and classes, just with code down the page in an order to do what was needed. Thats procedural?
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Post by jmut »

rsmarsha wrote:So if i was to write a file with no functions and classes, just with code down the page in an order to do what was needed. Thats procedural?
well it is more about organization, workflow etc. models and way of thinking.


If you make a class with 20 methods(functions) in it that do all kind of different stuff...this does not make it object programming.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

rsmarsha wrote:So if i was to write a file with no functions and classes, just with code down the page in an order to do what was needed. Thats procedural?
the no functions/classes bit is irrelevant, but the rest is correct - yes, that is writing a procedure.. hence the term procedural programming :)
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

User avatar
MrPotatoes
Forum Regular
Posts: 617
Joined: Wed May 24, 2006 6:42 am

Post by MrPotatoes »

procedural is no OOP
AngusL
Forum Contributor
Posts: 155
Joined: Fri Aug 20, 2004 4:28 am
Location: Falkirk, Scotland

Post by AngusL »

Procedural programming is one of many programming paradigms. Other notable paradigms are functional programming and object oriented programming.

http://en.wikipedia.org/wiki/Programming_paradigms
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Imho when someone says that you're a 'procedural programmer' in a PHP context it's usually meant as an insult...

Since that someone used the 'procedural' word you might want to ask *him* what he meant with it, because as you already noticed there are a couple of different definitions for the word...
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Procedural vs. Object Oriented. Ah, you can almost smell the smoldering piles of ...

In some PHP circles, procedural code is commonly refered to as code that does not use Objects. It uses functions and such, but does not utilize objects for he core programming technique. Bear in mind, just because you use some objects, that does not mean that you are coding in Object Oriented Style.

Object Oriented Programming on the other hand uses classes (objects) for the predominant portion of the code.

There is a lot more to this that just this little example, but it is a fair assumption that if someone says they are a procedural programmer, that means they either choose not to use OOP or they don't know how.
rsmarsha
Forum Contributor
Posts: 242
Joined: Tue Feb 08, 2005 4:06 am
Location: Leeds, England

Post by rsmarsha »

Ah ok thanks. :)

I'm starting to learn OOP, well i am trying. :)

I wrote a simple class to show some mail code, not sure if it's right, maybe i could post it somewhere for you guys to look at? So you can tell me if i'm doing it right?

Not sure where to post it.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

You smelly procedural programmer! :lol:
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Just so everyone is aware, this is an extremely touchy and volatile subject area. The moderators will lock this thread if it comes anywhere near a flame war. So keep it civil and you'll be allowed to continue talks.
AngusL
Forum Contributor
Posts: 155
Joined: Fri Aug 20, 2004 4:28 am
Location: Falkirk, Scotland

Post by AngusL »

feyd wrote:Just so everyone is aware, this is an extremely touchy and volatile subject area. The moderators will lock this thread if it comes anywhere near a flame war. So keep it civil and you'll be allowed to continue talks.
Hey, I've got a genuine question since I appear to have missed something...

How is being a 'procedural programmer' insulting? My code in PHP is primarily procedural because I'm using it for scripting - and also because I'm more at home in the land of C99. It's just a programming style - admittedly some languages are meant to be used as OOP (can't see SmallTalk being used otherwise...). :? I can see people being proponents of one or t'other... but I'd have thought that would be a little naïve given 'the right tool for the job' idea.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

AngusL wrote:Hey, I've got a genuine question since I appear to have missed something...

How is being a 'procedural programmer' insulting? My code in PHP is primarily procedural because I'm using it for scripting - and also because I'm more at home in the land of C99. It's just a programming style - admittedly some languages are meant to be used as OOP (can't see SmallTalk being used otherwise...). :? I can see people being proponents of one or t'other... but I'd have thought that would be a little naïve given 'the right tool for the job' idea.
The policy comes from past issues we've had with certain individuals starting wars over OOP vs Procedural camps of programming. I won't go any further into this line of discussion. If you want to know what's happened, take a look at previous threads of this nature.
Post Reply