Hello, dear habradewepera.
With your permission, I’m going to make a bit of a philosophical discussion about the development of us, as a community of developers using the wonderful PHP language. I will say in advance that many may not support my point of view and I will be happy to discuss this in the comments. So let's get started ...
A bit of history
So historically, that PHP is considered simple language.
Initially, it was created for fast writing of small dynamic web applications by a low-skilled (read, inexperienced and beginner) web developer.
The abbreviation PHP back in 1994 meant "Personal HomePage".
')
14 years have passed since then, the PHP engine corresponded from scratch twice (if memory serves me), overgrown with “adult” functionality and breaking stereotypes of its limitations with Facebook and Wikipedia projects.
It is worth waiting for a little more and PHP 5.3 will be released with long-awaited namespaces, unjustly ignored by
Late Static Binding and some additions of syntactic sugar.
What is the problem?
It seems to me that PHP is now suffering from its legacy of simplicity.
It develops much faster than its developer community, which does not have time to adapt to changes in the language itself.
No, I'm not talking about you personally,%% username!
You probably already know why you should always validate data coming from external sources; why it is worth separating logic and representation; how to use (or not use) OOP and design patterns ... you develop as expected. But the development of our development community as a whole worries me.
For example, the simplest question of template engines has been
sucking on my memory for already 7 years, and
nothing new has been invented during this time (apart from XSLT, but it’s not an offtopic here).
Developers in droves, right through one, breed new template engines, the syntax and functionality of which are like two peas in a pod like each other. Particularly advanced write extensions to C to supposedly improve performance. Oh, optimization is generally a separate topic. When a sample from the database takes 90% of the script's working time, and the processing of the template (relatively speaking), the remaining 10%, then it is necessary to optimize the template engine by all means! Although, this is a completely different topic ...
I gave the theme of template engines as an example. In the same way, we are breeding database adapters and a bunch of other libraries, both large and small. And now a new fashion is starting - to write not just your own bicycle library, but a whole bicycle framework! This is how cool, to write your own framework! You can already burst from pride, turning a blind eye to the fact that it differs from a competitor only in that the methods fetchAll / fetchRow / fetchOne are called getAll / getRow / getOne.
Other side of the coin
Critical Habrachelovek on this site must be outraged and argue that if everyone will use ready-made solutions and stop writing their own, the community of developers will finally become stupid.
I partly agree with that. I myself wrote my own template engine. And he wrote his own database adapter. The only difference is that no one has seen these crafts except for me :) Having picked them up a little, I gained experience and understood that I hadn't invented anything fundamentally new. With a clear conscience, I threw out my crafts in / dev / null, so as not to clutter up the “ether”, and take a ready-made mainstream library that allowed me to solve the same problem if not an order of magnitude easier, then at least at someone else's expense - because this library is supported its developers and other users, catching bugs and optimizing it as far as possible. This allowed me to concentrate on the implementation of my intentions in my application, and not on writing the next bicycle template engine ...
A business perspective
Each of us wants our favorite language to be popular and to bring it income. I do not know the exact situation in Russia, but here in Ukraine (or rather, in Kiev) Java-and DotNet-developers receive on average 50-80% more than PHP-developers of the same level. Why? Because Java and .NET is an "enterprise", and PHP is govnododerstvo. This is not my opinion, this is the opinion of employers. And our community fully confirms this by continuing to pick the unfortunate template engines instead of doing business.
But why, why did such garbage happen to our community? Why do javistov and dotnetchik with this all normal? (Well, okay, okay, they also have their own problems, but now we are talking specifically about the "bikes")
I think that this is because there is a large company behind each of these technologies, which literally pulls the handle (or ear :)) and leads developers in the right direction, not allowing them to hang around and invent "bicycles" that have long been invented for them. Need a template engine - get it. Database Access Adapter - Easy. Logging functions - as many as you like. All solutions are typical and standard. If you need something special - to your health, write your own ... it is unlikely that it will be useful to someone other than you, because if it were needed by any significant number of developers, this functionality would be included in the standard library. And if to solve your problem you have to implement almost all auxiliary classes from scratch, then either you really implement some kind of supernaturally original functionality, or you are just a woodpecker and you don’t know how to use what is under your nose :)
How to be?
So how is it possible ... Java has Sun, .NET has Microsoft, and PHP has no one?
You are mistaken! PHP has Zend!
Yes, the guys missed the moment and for a long time did not interfere in the developer environment, letting everything go by itself.
PEAR does not count - it appeared in the heyday of PHP 4 without a normal object model and, to be honest, the quality of the code of its packages leaves much to be desired.
But now Zend realized its mistake and last year released the
Zend Framework .
I have carefully studied its architecture since the first beta versions.
It was unusually raw (there are still sharp corners in it), but the ideas of the authors, their general mood - I liked.
I was filled with them and for myself decided that I would use, support and promote this framework.
I do not agree with all the architectural solutions, I ran across a decent number of bugs and wrote bug reports. Zendovtsy themselves changed their views and ways of solving various tasks themselves several times, but this is good, this is even wonderful - it means that they are trying for us so that it would be more convenient for us to use their work.
And when I see some kind of shoal in ZF, I don’t start shouting “here is shit, now I’ll write my own framework with blackjack and whores!”.
Instead, I try to make ZF better. Fix a bug, add something new and share with the community.
At the same time, if I don’t like the mechanism of the controller, I don’t rush to write my own, but try to delve deeper into the existing one and figure out how to use it correctly.
Stop inventing bikes!
This is what I wanted to urge all of you, dear warm-minded habredevelopers, who have finished reading these lines.
Stop inventing bikes! Better help improve the ready-made solutions, catch all the jambs and add new features to them that can be useful to the community. Yes, you can never say "I am the author of this wonderful framework" ... or even a separate class. But in my opinion it is better to bring three lines of code into the general class, which thousands of developers will use and hear their silent “thank you” than write your own “bicycle” with thousands of lines of code that nobody needs.
PS: Of course, I approve of innovation. If you have a revolutionary idea that no one has ever implemented - go ahead, glory is waiting for you! But let's face it: one more template engine is a little something wrong ...
PPS: I wanted to write that Zend Framework is just an example of a large project that is worth supporting. In its place can be Symfony, ADODb, Propel or any other open source library. But nevertheless Zend Framework deserves your support like no other, because without Zend there would be no PHP itself. If we decide to use a third-party library, then let Zend, IMHO, supervise the development of this library.