That, however, is not what the "PHP for the i" crowd is saying.  They're 
saying to use PHP as your primary scripting language, which means your 
HTML is generated by your PHP, which in turn means that your JavaScript 
is generated by your PHP.  It's a bizarre Rube Goldberg technique, but 
that's what you get if your architecture is just an extension of PHP 4 
coding techniques, which sadly is the bulk of PHP programming out there.
Balderdash... I have not heard anyone in the "PHP for i" crowd or 
otherwise speak of generating JavaScript from PHP.  Doesn't mean it hasn't 
happened, but that would be just plain crazy.  I have heard talk about 
mixing PHP with HTML to write individual pages, and you would then add 
JavaScript into the same page if you needed it, but the PHP is generating 
neither the static HTML, nor the JavaScript in that instance.  While it is 
certainly a possibility, I would classify that under the heading of "You 
Can Write Bad Code in Any Language".  If you use a MVC framework such as 
the one from Zend, then You can keep the HTML and PHP separate, and use 
PHP as a server side programming language, and HTML as a markup language 
with some minimal PHP to echo variables within the HTML.
I think the confusion is coming from people trying to say that you can 
write your PHP very much like you write your RPG.  One script per page, 
put everything for the page into that one script.  And may RPG programmers 
like that.  But, even then you are not generating JavaScript, with PHP, 
and you can write the page so that you generate only the dynamic portions 
of your HTML.  Even though you can write PHP in a monolithic manner, it 
isn't considered a good way to do things in the PHP community.  Just as 
you can use RPG IV the same way you use RPG III, but then you aren't 
really writing RPG IV are you.  If you really want to write RPG IV you 
need to start writing reusable sub-procedures, and remove yourself from 
the monolithic programming practices of the past.
If you think about it that way, both RPG IV and PHP can be the path to 
learning modern programming techniques on the iSeries.  BTW, I continue to 
find myself slipping deeper into the 15, 20, even 30+ years of experience 
category you spoke of, and I feel your pain as many of my colleagues still 
only program in RPG III, and don't have the time to learn modern 
productivity enhancing techniques.  I usually tell them I have too much to 
do to not learn them.
 
As an Amazon Associate we earn from qualifying purchases.