One howler is chasing the next here

Aristotle on 2007-04-29T05:47:14

Zachary Kessin:

Code As Data: Reflection in PHP

[…]

There is a long history of using programs to automate the writing of code in C and similar languages (including Lex, yacc, lint, ctags, and others). For C programmers, many of these tools have been around in one form or another since the 1970s, and are very well understood by the community. However, for people who learned to code in PHP, Perl, and Python (the “P” languages), the use of tools like this may never have entered their horizon. This is unfortunate, because a solid tool chain for code generation and parsing can lead to better end code and higher programmer efficiency, as I will show here.

Once we establish that we can parse our code with a tool, then two questions remain: […]

It doesn’t let up either. The entire article is one comical tragedy, though much of it supplied by PHP itself rather than the author.

Sorry, PHP programmers, there are only three “P” languages, and one of them starts with an “R”.


Where are the howlers?

Bernhard on 2007-04-29T07:38:26

I quite aggree that Perl, Python and Ruby are playing a different league from PHP. But that article sounded quite sane to me. Having a way to work with your compiled code is a good idea. I haven't used the PHP Reflection API, but judging from that article is looks like it is comparable to Perl 5's PPI.

So I wonder what's the next thing that PHP is borrowing from saner languages. How about TAP?

Re:Where are the howlers?

Aristotle on 2007-04-29T08:14:47

The idea that metaprogramming means parsing your own source and using that to fill in source code templates is so typical for PHP. This sort of thing “never entered the horizon” for programmers using the “P” languages. Seriously?

I guess my point is that I’ve done a lot of metaprogramming in Perl in the decade before PPI existed. (And I don’t plan to use PPI anytime soon).