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.
The Lesser Known Contributors Who Are Trying To Make PHP Good Again
11–20 of 53 posts
Re: The Lesser Known Contributors Who Are Trying To Make PHP Good Again
#12While 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…
Re: The Lesser Known Contributors Who Are Trying To Make PHP Good Again
#13Everyone 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.
But what's really amazing is when you combine Hiccup with Enlive[3]. Enlive can give you a headache when you first start working with it, but then there's an almost magical "aha!" moment, and not long after that you'll never want to look back. By "combine" I mean using Hiccup and metadata from your db (or whatever) to generate empty, logic-less views and then using Enlive to bind in your data.
Combine those steps with your own macros and HOFs, look for some choice places to memoize function calls, and now you're cooking with gas.
[1] https://github.com/weavejester/hiccup
Re: The Lesser Known Contributors Who Are Trying To Make PHP Good Again
#14Re: The Lesser Known Contributors Who Are Trying To Make PHP Good Again
#15Earlier quoted context omitted.
Perl fans would probably object strongly to that, but it is true that when PHP first caught on there really weren't any great choices.
The strong selling point of PHP for a long time was cheap hosting. Combine that with a fast learning curve and you're set. Nowadays, it's not so clear cut price wise, but PHP took a strong advance in term of user base - look at the number of libraries, projects, and jobs (!) available in PHP, vs python or ruby.
Re: The Lesser Known Contributors Who Are Trying To Make PHP Good Again
#16Re: The Lesser Known Contributors Who Are Trying To Make PHP Good Again
#17Everyone 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.
Now we've actually moved everything to the client side using Ember and Handlebars templates. JS doesn't have any built-in templating like PHP (which is basically just a template engine), so Handlebars makes it really useful to write up HTML code blocks that get variable insertion and data-binding on the client side.
Re: The Lesser Known Contributors Who Are Trying To Make PHP Good Again
#18While 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…
Re: The Lesser Known Contributors Who Are Trying To Make PHP Good Again
#19Everyone 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.
Bolting a template engine on top of that makes no sense whatsoever.
Re: The Lesser Known Contributors Who Are Trying To Make PHP Good Again
#20When was PHP good in the past? (Honest question; I don't use PHP.)