Jump to content

PHPcoder182

New Members
  • Posts

    1
  • Joined

  • Last visited

PHPcoder182's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am a completely self-taught programmer and have been building my knowledge for 3 years. My site runs seasonally with a break for 3 months in the summer, which every year gives me a chance to do something new with the site. I tend to find every year I almost start my site from scratch because my knowledge I have learnt in that year makes my code redundant. This year the big change I'm making is switching from procedural to OOP. My site has a lot of HTML tables and I have therefore used OOP to generate these table with very little code. This has been extremely efficient and some table which would previously take 50 lines of code I can generate in 4 now. My question is, do most PHP programmers use OOP in this way (i.e. for generating HTML code more efficiently). I didn't start doing it because I read somewhere to do it. I just applied my knowledge of OOP in a way that I thought would be useful. My concern is whether or not someone with better OOP knowledge might think this was the wrong way to do things, whether that be because there is an even better way to do it or if it is just not the done thing. I guess you could make the argument that if it makes things more efficient (which it does do to an extreme) then it is obviously good, and it makes use of the DRY principles, but I just want to know if this is a typical way to use OOP. Essentially what I have is a class to connect to the database, an extended class to run the Mysql query, a further extended class for generating a table and a class extended from this to hold an array of details to dynamically change that table.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.