sonesay 7 Report post Posted November 20, 2008 (edited) I'm getting back into it myself since Uni is over for the summer. One thing I would like to share though is my experience when working with PHP on and off over the past few years and trying to develop my own website where I have my own custom CMS built for my own specific purposes. I was pretty much experimenting and learning as I went along with this project and my goal was pretty high. Probably too high for my own good since I never completed it.At the time I was working on PHP (early 2002-4ish ?) version 4 I believe and it had minimal support for objects back then so the book I had brought and was reading did not even include it in there. I did not really know was OOP was anyway so it didn't matter, I was happy to learn PHP just as it was a procedural language as it was designed as. At the same time I was learning HTML and javaScript as well since I barely knew what web standards/ document types was and what a DOM was. Ah and there was also CSS as well so I had to drop using tables for layouts and learn that as well. All in all it was a slow progress and I would say PHP was my first programming language that I really understand when trying to learn how to program. The syntax was loose enough to allow you to learn and make mistakes as you went along.The Problem:My little project is not so little anymore as I add in more and more features. I've only barely completed the applications/registration section and its taken me so long. Why? because I've tried to integrate Ajax so that I get flashy user controls that enable my users to do what they need. Its going to be a nightmare to modify and update things. I'm looking through the code because I had to update certain parts and it was a pain. Yes I did split up my code into many sections but I think the combination of logic and presentation code that you create in a procedural style PHP file. I'm not trying to say you can't do it that why its just when it comes to larger projects it can be hard to maintain and build. I also found out that my requirements change or I got some aspect of the requirements wrong initially so I will need to make changes there. You may say its my fault initially for not getting the requirements right in the first place but you can never do. Why? because requirements change and you don't have the foresight to see all possible requirements with lack of experience. If you spend all the time initially trying to track down all the requirements you may never get started developing. You have to try and get things right the first time and allow room for changes to be made if necessary or at least make it so its much easier to change.The Solution:Well my idea of the best way to do it so far is using a PHP Framework that supports an MVC architecture. There are a few out there but tutorials are either incomplete or too vague for you to learn much. Back about a year ago when I experimented with the Zend and its MVC I had little idea of what it was but after working with it in Java and using MVC to build our application this previous semester I can see why it helps. The only problem is there's so many broken tutorials out there and my current state of xampp server is dodgy so I dont know if the problem is on my end or not. Documentation is vague. Oh wait I did get a demo of the latest 1.70 that came with it working. Well it works out of the box anyway. Well that is what I will be doing trying to relearn PHP in an OOP and MVC context. I think that's the best way to go if your going to be making large PHP bases sites or applications. If anyone is interested in picking up zend and trying to learn as well we can share what we learn. The community is small atm so it would be nice to learn from others at your level. My friends whos a newbie to PHP is building a CMS for WOW lol. I don't know if he will be able to do it. I tried to warn him about the problems with trying to separate presentation and logic and how messy it can get to maintain but he thinks functions will handle that. I'm not sure how it will exactly since if you don't use MVC you still bundle all the code in one file. Edited November 20, 2008 by sonesay (see edit history) Share this post Link to post Share on other sites
truefusion 3 Report post Posted November 20, 2008 I was going to dive into the Zend framework as well; that is, until i saw its filesize—i'm not uploading that to my website. Luckily, Wikipedia has a comparison list of frameworks. I used this list to figure out if there was another framework that did the same thing as Zend but more and with a smaller file size. Nette Framework caught my eye the most. The only unfortunate part about it is its documentation is in another language other than my native language. Google translator can help here, but it still slows down the learning process. I've also heard a lot about CakePHP in, ironically, websites that delt with Python and Ruby—but it was all mainly that it was good, nothing you can actually use in a debate or discussion about it. But my goal isn't insomuch using an already-existing framework for myself, however, but rather perhaps to dissect its code. I noticed that when working with AJAX it is good to have multiple files that access one main file (or core) so that it doesn't load more than it should, or so that it doesn't load nothing (for a core just mainly sits there until you ask it to do something, doesn't it?). The thing about my scripts that contain AJAX is that i try to accomplish making my scripts work if JavaScript were to be disabled. It's not necessarily a difficult thing to accomplish, though, but obviously requires some extra work. I've heard about design patterns and theories, MVC, etc, about programming, but never really took the time to really get into it. But from what i understand about it i feel like my current way of programming implies these things anyway. I would assume MVC is really important concerning programming languages like C and C++, but i don't plan on ever diving into such programming languages, especially since i've been spoiled by interpreted languages. Sure there may be a difference between interpreted languages and languages that need to be compiled in performance, but if my program loads within a second or two, i'm not complaining. But at the same time, there is now a way to compile your PHP programs into bytecode using the Roadsend compiler. And now that i have PHP-Qt compiled and installed on here, i can use PHP to create desktop applications. The Qt4 library is an awesome GUI library, and i recommend it over GTK. You should look into PHP-Qt. My friends whos a newbie to PHP is building a CMS for WOW lol.WOW as in World of Warcraft? If so, how'd they get that position? Share this post Link to post Share on other sites
sonesay 7 Report post Posted November 20, 2008 Hes not doing it for Blizzard truefusion, Hes just another game freak who wants to setup a website with its own CMS for running their community. Thanks for the info I will see if I can look into some of it. Right now I'm trying to fix my MySQL problem. Share this post Link to post Share on other sites