|
Posted by lawrence k on 11/02/06 23:44
cyktor@hotmail.com wrote:
> By procedural programming, do you mean C? Please give me some
> suggestions for procedural languages to learn.
PHP without objects and classes is a good enough starting point to
learn procedural programming:
$howManyHats = 4;
$howManyHats = $howManyHats + 3;
setcookie("howManyHats", $howManyHats);
Things happen one at a time, straight down the page. You can use
functions, which means the code goes into those code blocks, but it is
still pretty straightforward.
With objects, you'd suddenly have some variables that are maybe set
inside of objects, and therefore the code is no longer so
straightforward. If HatObject sets a variable called $yardsOfCloth in
its constructor (let's say a value of 34):
$hatObject = new HatObject();
$clothInYards = $hatObject->getYardsOfCloth();
echo $clothInYards; // shows 34
[Back to original message]
|