News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Pawel Turlejski's Blo:
What's wrong with PHP closures?
October 06, 2009 @ 13:16:18

In a recent post Pawel Turlejski takes a look at what he thinks is wrong with PHP closures as compared to syntax in a few other languages.

PHP 5.3, along with many other features, introduced closures. So now we can finally do all the cool stuff that Ruby / Groovy / Scala / any_modern_language guys can do, right? Well, we can, but we probably won't... Here's why.

He compares the PHP syntax for using closures/lambda functions with the abilities of Groovy and Scala. He does point out out that the ArrayObject wrapper does allow you to work a bit more fluently with the array's contents, but it's still not quite the same. According to him:

I'm sure closures will find their uses in the PHP world (like delayed execution or automated resource management), but IMHO replacing traditional loops and array operations is not one of them.
0 comments voice your opinion now!
closure groovy scala array example


Ant Phillips' Blog:
PHP/Groovy Bridge
January 14, 2009 @ 10:23:46

In a recent post Ant Phillips looks at another bridge that's offered to combine PHP with another language (besides the Java one) - a link over to Groovy.

Up until recently the PHP runtime was treating Groovy code just the same as Java. Anyone could compile a Groovy class to Java class files using the Groovy compiler. Those class files could then be dropped into a Zero application and used in PHP through the PHP/Java Bridge. The problem is that Groovy isn't the same as Java.

He compares the way its works when its Java-esque and how it should work as combined with the Groovy bridge. The code is much cleaner and, by making it more readable, makes it easier to maintain in the future. You can see some slides from a presentation hes given on the subject here.

0 comments voice your opinion now!
groovy language bridge java example slides


Michael Kimsal's Blog:
PHP, Groovy and language evolution
May 29, 2008 @ 12:52:07

In a new post Michael Kimsal does a good job comparing the rise of PHP5 (and what it brought with it) to his language of choice these days - Groovy.

I remember when PHP5 first came out having 'discussions' with a number of people who insisted that PHP5 was way better than 4. [...] Basically, intentions were made clearer with things like "public protected private" (PPP),but I have not yet seen any web project get done faster or dare I say even much *better* due to those sorts of things. [...] This isn't specifically saying PPP is necessarily bad, but that PHP could have addressed the issue in a fashion more suitable to dynamic languages. Keep reading for an example.

His comparison is to how Groovy handles properties in a class - everything is private unless declared otherwise. This could be ported (somewhat) over to PHP and would eliminate the need to search&replace all over the code for the right variables.

1 comment voice your opinion now!
groovy java language evolution php5 private public protected


Michael Kimsal's Blog:
Grails for PHP Developers Part 5
February 19, 2008 @ 12:02:00

Michael Kimsal points out the posting of the latest part of his "Grails for PHP developers" series to his blog site - Part Five of the series.

I've put up the latest installment in my "Grails for PHP developers". Rather than delve too much more in to Grails head on, I'm taking this installment (and at least the next one) to delve more in to the Groovy language itself. Groovy offers similarities to PHP, but also many differences which can trip you up if you're not careful. I'll try to lay those out as best I can in the next couple of installments.

This new part of the series goes back and puts the spotlight on GRoovy, the base of the Groovy/Grails combo. He talks about working with variables and arrays as containers for multiple pieces of data and some possible gotchas that could come up along the way.

0 comments voice your opinion now!
grails developer groovy array variable store screenshot



Community Events





Don't see your event here?
Let us know!


release community podcast series voicesoftheelephpant opinion interview deployment symfony tips api introduction language laravel framework list install bugfix package library

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework