Jump to content

pkbarbiedoll

New Members
  • Posts

    2
  • Joined

  • Last visited

pkbarbiedoll's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Anyone want to take a shot at the post above? Put into a different context.. say I have a news page written procedurally. Several actions are available: view news list view news article add news article edit existing news article In this theoretical page, I have a single news.php script set up with a switch statement controlling each action. switch($action) { case 'submit_article': // sql to update / insert article break; case 'edit_article': // show form to edit article break; case 'view_article': // show single article break; case 'view_article_list': // show list of all articles break; } So how would this example best be done in OOP style? I'm so used to writing procedurally, I'm having trouble seeing the benefits of using objects. hoping someone can explain in a way I can hook into..
  2. Great tutorials, working through the OOP lesson now. I've coded procedurally for over 7 years and am fairly proficient at the style. Includes contain functions, with separate include files for different tasks/sections (functions_security.php, functions_news.php, functions_calendar.php, ect). I reuse as much code as possible, sometimes taking a slight hit on performance to achieve reusability. The sites I work on now are of course, written procedurally. I am interested in starting to implement OOP methods, but every time I look at OOP tutorials, I shy away.. I can write "hello world" in far fewer lines of code procedurally, than with the complexity of classes, properties and methods. What am I failing to see? I think the Killersites OOP tutorial is great, no complaints about the way the material is covered. But where is the incentive to turn a 300 line app into 600 lines with extra complexity? Is it just for the sake of being abstract and using the latest buzznology? Really hoping someone can steer me in the right direction.
×
×
  • Create New...