Over the last 18 months i have been hard at work teaching myself PHP & Jquery and so far have become quite good at it but not having a “mentor” i have developed my own “model” for building webapps / sites. it goes like this…
I have my front end page (HTML) and a js script which i fill with lots of jquery ajax (using a get or post method then pass on a command to the php) commands which in turn reference a sometimes large php file made up almost entirley of one big “switch / case” command with all my various options.
my question is this, is there a better way to do this?
i want to advance in my skills, where should i take my model next?
In your case I would make the switch to Object Oriented Programming. I’ve been in a similar situation like you but wasn’t satisfied anymore at how my websites looked with simple procedural scripting. Switching to OOP will take quite some time to get used to, but in my opinion it was all well worth the effort.
Take your time learning OOP. First, check http://www.php.net/ to learn about objects and classes and afterwards read a book on the subject (Php Objects, Patterns And Practice by Matt Zandstra is a very good one http://www.amazon.com/PHP-5-Objects-Patterns-Practice/dp/1590593804). You will find out why a lot of people have made a switch to the OOP approach for web apps.
When you are used to the way of thinking in OOP, choose a framework. It doesn’t make sense to write code for things that have been written 100 times before and are tried and tested approaches to common problems. A framework covers all the basic annoying stuff you shouldn’t be spending your precious time on. But only choose a framework when you have really grasped the way of thinking with OOP. It’s always best to learn the basics first instead of jumping right in the middle by directly choosing a framework.