Live data from Hacker News

The Lesser Known Contributors Who Are Trying To Make PHP Good Again

danielnill.com

31–40 of 53 posts

Re: The Lesser Known Contributors Who Are Trying To Make PHP Good Again

#31

Earlier quoted context omitted.

I hate PHP and don't even want to talk about it but I did skim through the docs for Smarty. The rationale is that PHP sucks as a template engine, so why not create a new one and use PHP for the model-controller/whatever. Maybe that seems perverse, but you have stuff like Node.js in existence that oddly enough solves some problems quite nicely, so maybe it works for PHP guys. I'll never see the appeal compared to othe…

Completely unrelated: I'm not easily offended. Right now I'm not offended at all, in case anyone would interpet this post to mean so. I'm all OK. Really. But that said: I'm severely puzzled about your choice of HN username.

It could just be his name, that coincide with the more famous one. It can happen.

Re: The Lesser Known Contributors Who Are Trying To Make PHP Good Again

#32
post #17
post #9

Everyone probably knows this, but PHP's Smarty template engine ( http://www.smarty.net ) is really awesome. I've yet to see a better one in any language - it has things like Unix-like pipe chaining of filters, user defined functions, and intelligent caching built in. I reduced the number of lines in one codebase I worked on by 70% through use of Smarty.

I work on a legacy code base with pretty much everything in SMARTY templates (including CSS and JS files!) and it's really aweful. It may not be SMARTY's fault, but most of what's going on could be just as easily done with PHP code than with SMARTY tags, include variable insertion ( ) and control logic (if ($var) : // endif;). Now we've actually moved everything to the client side using Ember and Handlebars templates…

  > include variable insertion ()
No disable your short tags and any nontrivial template will become ugly as hell, unless you are on php 5.4+ which not many are.

Re: The Lesser Known Contributors Who Are Trying To Make PHP Good Again

#33
post #9

Everyone probably knows this, but PHP's Smarty template engine ( http://www.smarty.net ) is really awesome. I've yet to see a better one in any language - it has things like Unix-like pipe chaining of filters, user defined functions, and intelligent caching built in. I reduced the number of lines in one codebase I worked on by 70% through use of Smarty.

Nobody mentioned twig yet, so I will: http://twig.sensiolabs.org

And seriously, check Symfony 2 out.

Re: The Lesser Known Contributors Who Are Trying To Make PHP Good Again

#34
post #10

While I've bashed PHP as much next guy, these are the facts: -Take away PHP and the internet would break. The vast majority of websites are either written in PHP or have a PHP back end. -The LAMP/LNMP stack is by far one of the most deployed web server configuration. -PHP is extremely well documented and it's been around so long that it's easy to find solutions on the web. PHP is the Model T of web languages: people…

PHP is extremely well documented and it's been around so long that it's easy to find solutions on the web. I can agree that PHP is documented. That it is well documented however is something I'm very much willing to argue against. PHP has string-operations documented to be "binary-safe" without ever saying what that is supposed to mean, if it's good (it's not), if it's bad (yes, yes, yes it is) and why you should hav…

@josteink, you don't really understand what good documentation is do you. A large amount of PHP documentation provides context in which you may effectively implement a piece of code by providing "sufficient" examples. A grenade I can almost guarantee you probably comes with documentation, but probably a warning which states when you pull the pin, it will blow up. PHP will not blow up the world, or blow your hands off. The documentation does not have to be "perfect". PHP has changed web development in many positive ways, by increasing what could be done via simplicity using what you might call poor documentation. It has sufficed enough that good developers found it sufficient to build large complex code-bases which they could both build on and make money from. Much of MSDN library is created from internal comment-style documentation automation(JavaDoc,PHPDoc, XML Comments). MSDN will often times lack easily readable code-samples, and provide enough context in which you may actually use a library. Just because you define a prototype with long naming conventions doesn't mean Joe schmuck has a clue. PHP examples are generally not obtuse, or obfuscated to newbies. It's the "I'm going to show you how to hunt fish" and nobody said it had to be pretty. MSDN has gotten better over the years, but there are still many areas in the many libraries hosted on there which don't have "even good enough" documentation to help you to the most basic things.

Re: The Lesser Known Contributors Who Are Trying To Make PHP Good Again

#35
post #9

Everyone probably knows this, but PHP's Smarty template engine ( http://www.smarty.net ) is really awesome. I've yet to see a better one in any language - it has things like Unix-like pipe chaining of filters, user defined functions, and intelligent caching built in. I reduced the number of lines in one codebase I worked on by 70% through use of Smarty.

@zdw, I actually think twig is nicer :) It's almost identical to jinja.

Re: The Lesser Known Contributors Who Are Trying To Make PHP Good Again

#36
Article title seems to imply there will be some info about the people who programmed these new features... instead there's a rehash of the new features and mention of a library or 2 that we could read about elsewhere.

Author says, "the developers of these new tools deserve some serious recognition for the work they are doing" and then totally fails to mention them!

So now we've again been suckered into the 'PHP good' vs 'PHP bad' non-debate.

Re: The Lesser Known Contributors Who Are Trying To Make PHP Good Again

#37
post #10

While I've bashed PHP as much next guy, these are the facts: -Take away PHP and the internet would break. The vast majority of websites are either written in PHP or have a PHP back end. -The LAMP/LNMP stack is by far one of the most deployed web server configuration. -PHP is extremely well documented and it's been around so long that it's easy to find solutions on the web. PHP is the Model T of web languages: people…

PHP is extremely well documented and it's been around so long that it's easy to find solutions on the web. I can agree that PHP is documented. That it is well documented however is something I'm very much willing to argue against. PHP has string-operations documented to be "binary-safe" without ever saying what that is supposed to mean, if it's good (it's not), if it's bad (yes, yes, yes it is) and why you should hav…

Agreed.. I like that they often have examples to get you started quickly, but a lot is simply left out. Especially the quirks, and php has a lot of them.

I'm used to dealing with perl 5, which has quirks of it's own, but at least their documented (a little too much sometimes). I learn a lot about many things by reading the perl docs.

Here's "Gory details of parsing quoted constructs" (no that I have read it..)

http://perldoc.perl.org/perlop.html#Gory-details-of-parsing-...

Re: The Lesser Known Contributors Who Are Trying To Make PHP Good Again

#40
post #19
post #9

Everyone probably knows this, but PHP's Smarty template engine ( http://www.smarty.net ) is really awesome. I've yet to see a better one in any language - it has things like Unix-like pipe chaining of filters, user defined functions, and intelligent caching built in. I reduced the number of lines in one codebase I worked on by 70% through use of Smarty.

PHP is itself a template engine. Bolting a template engine on top of that makes no sense whatsoever.

There is one feature of Smarty that is worth having in my opinion, that is the template inheritance. Basically similar to .NET master pages, Rails layouts and I think Django is built the same way. Much cleaner rather than including header/footer files.

Though I don't like having to use the Smarty psuedo-language, I do like the organization of code that it provides.

Post reply on HN