views:

226

answers:

3

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?

+6  A: 

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
Pascal MARTIN
Would you recommend any specific frameworks?
Tim Barnaski
I really like CakePHP
I'm not necessarily after a PHP framework; I've looked at Rails and Django, though not in great detail.
Tim Barnaski
@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)*
Pascal MARTIN
+1  A: 

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.

Justin Johnson
Another option is to write your own kind-of-framework
Col. Shrapnel
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).
Justin Johnson
A: 

Depends on who will be working with the code, on which plattform it has to run and how complex the database should be.

If you develop for a company or community it is always easiest to use PHP because there are many others who know it so i.e. for companies it's easier to recruit someone who knows the language.

If you mostly want to develop on your own, use what you like most, i even heard of websites written in pure common lisp.

If the application can run on windows only C# is also a good solution as you can develop web applications extremely fast and the .NET library makes many tasks easy.

As database backend you can use MySQL if the structure is simple but for more complex databases i'd use postgres as the MySQL performance seems to drop fast with increasing complexity (subjective opinion).

EDIT: As others noted, Frameworks are always a good idea. There are web frameworks for most of the current languages. For PHP CakePHP was recently recommended to me.

dbemerlin