5 ms·
PHP definitely has its flaws and lack of conventions but for me that is what makes it beautiful. It's a language which has allowed me to grow as a developer ove
by eisokant 18y ago
PHP definitely has its flaws and lack of conventions but for me that is what makes it beautiful. It's a language which has allowed me to grow as a developer over the years. If I look back at how I structured and wrote my code when I first started it's nothing close to how I code now. Since PHP allows so many different variations I didnt have to conform to one style but instead developed my own. If I would have chosen a different language to start with I am quite sure I would have given up on programming quickly. PHP has allowed me to learn from my own mistakes and create my own unique way of solving problems.
Besides how I feel about it; it's been great for all the projects I've worked on and now for the first time I'm using a framework (Codeigniter) for my startup and it's proving to be even more solid and progressing my style even more.
I believe PHP code is as good as its developer. Like mentioned in the article; you can paint a mess or a masterwork, all the colours and brushes are there.
- thorax 18y agoI have to second how well frameworks like CodeIgniter can help developers progress into cleaner code. Those modern tools discourage tightly coupled PHP code and they feel almost like an entirely different language. If you find that you can't stand PHP, you might want to take another look at these-- you'll find the code a refreshing difference from traditional "raw PHP" websites that people hack together early when they're learning.
- KrisJordan 18y ago10 years ago I wrote my first web application. I was hooked. The ability able to write an app that ran anywhere in the world was magical. My journey since has led me to PHP4 and the LAMP stack, away to C++ and Java and back to PHP5, away to C#, Scheme, and Python, and again back to PHP5. The truth is I have a love-hate relationship with PHP. The linguist in me abhors PHP sprawl and the pragmatist in me adores PHP’s simple execution model and practical ubiquity. Upon returning to PHP this September it felt both familiar and unsettling. The feeling of returning to the town you grew up in. Frameworks, like familiar faces, looked the same as when you last saw them just heavier and a bit more mature. Nowhere as spectacular as the framework heroes of other towns like of Pythonville or Rubyfordton. City council was still making unorthodox decisions like enforcing backslashes for namespaces. Yet downtown was booming- many of the greatest internet successes of the world had since established themselves here: Facebook, Flickr, Yahoo!, and others. So I set out to create an open source framework called "Recess!" which will be available on GitHub in preview form "any day now". I just recorded its first screencast that dives into how it Recess! handles routing. Interested to hear your thoughts: http://www.recessframework.com/screencasts/routing/index.html http://www.recessframework.com/screencasts/routing/index.htm... (disclaimer: the flash video may be slow to load - until which you'll see an empty black page)
- k4st 18y agoController route prefixing seems suspicious. Do you include every controller at runtime and use php reflection with some regular expressions to parse all of their prefixes only to figure out what single route to use?
- KrisJordan 18y agoIn development mode, yes. We look at every controller and form a routing tree. In deployment mode that routing tree is serialized and cached. Only a single (matching) controller is then touched. Unserializing the data structure is extremely fast and finding a match is roughly an O(log n) operation.
- blasdel 18y agoPHP is already extremely slow (slower than Ruby! (which is slower than Prolog!)). Using a pure-PHP framework (a template system built in a templating language) leads to pitiful rock-bottom performance -- orders of magnitude slower than any of the popular templating systems that exist for Perl, Python, or Ruby.
- thomasmallen 18y agoPlease back this claim with evidence. There are many things wrong with PHP. Performance is not one of them...it's very quick. I'll start: http://shootout.alioth.debian.org/u32q/benchmark.php?test=all&lang=all http://shootout.alioth.debian.org/u32q/benchmark.php?test=al... Don't sweat it, Ruby's only 50% slower! Proportional results on a faster machine: http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all http://shootout.alioth.debian.org/gp4/benchmark.php?test=all...
- blasdel 18y agoBullshit, you linked to rankings (one where PHP's wart is omitted), not results, and your 'faster machine' is many times slower. It's not really so simple: http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=php&lang2=ruby http://shootout.alioth.debian.org/u32/benchmark.php?test=all... They go back and forth, but on the meteor contest (which is the alioth people's favorite) Ruby's delta is 260, while PHP's is 36,117 (!!) My main point was that templating frameworks written in PHP are WAY slower than using PHP directly, as you're doing a ton of pointless string operations. Benchmarks back this up, even ROR is >= the PHP frameworks (especially when there's no opcode cache): http://www.avnetlabs.com/php/php-framework-comparison-benchmarks http://www.avnetlabs.com/php/php-framework-comparison-benchm... PHP is really fast when you use it as a straight templating system, but once you start writing real applications in it, writing your own high-level PHP inside PHP, it is the slowest thing around.
- thomasmallen 18y agoIn many ways, PHP is itself a framework. Only an idiot would make a high-profile website using ZF or CakePHP. Good luck using straight Ruby for a website. Please don't force me to link to some of Terry Chay's work. There's a very good reason that PHP is used for many high-profile websites whereas Ruby is not.