Should I use pure PHP/MySQL for developing web applications?

11,342

Solution 1

Writing a complex application from scratch, I would definitly not use "bare PHP" : I would certainly use a framework : they provide :

  • a large number of useful classes/methods
  • some set of rules -- like "in which directory should controllers be saved", "how to write a view", ...
  • MVC -- i.e. they help with better structuration of the project

Note that this answer is valid for both personnal projects, and professionnal projects.


There are several great Frameworks in PHP, like :

One thing to remember : learning how to use a framework well will take some time : starting with a small project, before going for a big one, would probably be a good idea ;-)


Now, when you're asking yourself the question of "which framework should I choose", it's mostly a matter of personnal preferences... And here are a couple of questions/answers that might help a bit :


As you're asking me which Framework I would choose ; well :

  • I really like Zend Framework, and often use Doctrine as ORM (it's the default ORM of Symfony, but can be used very easily with ZF)
  • If I had to choose another one, I would probably go with Symfony, as I've seen it used on a couple of projects at work, and know many people who work with it and like it

Solution 2

If you already know that language, you should most definitely use a framework (unless you're a masochist).

For me, besides that fact that they're usually bundled with all sorts of great libraries, using a framework is all about using time effectively.

Most importantly, it will save you time. You're freed from the nitty-gritty of worrying about the foundation/architecture and are able to spend your time of the features of the application itself.

Also, it will save others time; especially since you plan on being all open sourcey.

Solution 3

depending of your skills level, yes you can do it in pure PHP without frameworks. This also will be good, IMO, to improve your skills at debugging, logics, and others. But, on the other hand, you will restrict to other programmers to improve/maintain your code due to learning curve, in this case, the framework serves as a commom language. I recommend that if your project will be complex, or with the possiblity to other programmers join in the project, that you choose a framework which you feels comfortable and use it.

Share:
11,342

Related videos on Youtube

Tim Barnaski
Author by

Tim Barnaski

Updated on April 15, 2022

Comments

  • Tim Barnaski
    Tim Barnaski about 2 years

    I have been dabbling in programming/scripting languages since I was a kid. I started off with HTML and CSS, then went on to PHP (which I got quite good at) and then to Python, Perl, and C(++). I've recently done a lot of work in PHP (along with MySQL).

    After spending so much time learning these languages, I now want to do something with them. I'm looking at starting/contributing to an open source project; almost certainly a web application of some sort.

    In my experience with writing (admittedly small) web applications, I've found writing "pure" PHP to be an extremely slow and tedious process.

    My question is this: if I were to be writing a relatively complex/large web application from scratch, what should I write it in? Should I use pure PHP/MySQL, or use a framework like Django, Rails, or CakePHP?

  • Tim Barnaski
    Tim Barnaski over 14 years
    I'm not necessarily after a PHP framework; I've looked at Rails and Django, though not in great detail.
  • Pascal MARTIN
    Pascal MARTIN over 14 years
    @Tim : I've edited my answer to add some informations, and answer you question :-) (Sorry, I cannot say anything about ruby nor python : never worked with those languages)
  • Justin Johnson
    Justin Johnson over 14 years
    Unless you're trying to learn a language reinventing the wheel is not a good use of your time; unless, of course, you think you can make a better wheel (then more power to you).