Reply to Re: Classes and objects - please explain

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация