Feedback (March 2009)

Article ID: 63081

PHP Spoken Here

Thanks for the great article ["Attention RPG Programmers: PHP Spoken Here," January 2009, article ID 62702]. PHP has been in my awareness for some time now, but I haven't taken the time to learn anything about it. Thanks for the foundation. Now, if I did want to start playing around with it—do I have to buy something first? We're on Version 5.4.

Donna Goldman

Via email

My boss and peers are abuzz about your PHP article in the January System iNews. While I have started doing PHP research (and it's nice to know that your list of references match up to many I have already found), it would be nice to have a simple "to do" list of getting PHP up and loaded on an iSeries box for little (or preferably no) cost. The Zend products both appear to be for cost, which is impossible for me at this point (our company put a freeze on all capital expenditures), and while it would not be the first time I loaded non-IBM products on our development box, I would rather know that I am going with the right ones. Thanks for any help/direction you can provide!

David R. Sager

Via email

I read with interest your article(s) about PHP in the latest iNews. One thing I could not find in your articles (and maybe this was not your objective) was how to run or execute a PHP script. I think that PHP needs to be embedded in an HTML page (correct), so this means that the page must be served out of somewhere. Have you written any articles about the set up, configuration, or the minimum things that a System i shop must have in order to execute PHP pages? Thanks for any time you can dedicate to answer my question.

Antonio Mira

Via email

Author Jon Paris replies: Thanks for the kind words. Glad to hear that the article stirred up some interest. Fear not—installing PHP is not only easy but free! There's nothing you have to buy, and there are a number of options you can pursue. As you have surmised, it was not the intention of this piece to show "how" to run PHP. Other articles previously published in System i News and elsewhere have covered that territory and also the details of how to obtain and install PHP.

The Zend Core is free to IBM i users courtesy of a deal between Zend and IBM that gives Zend a fee for each copy of Zend Core for i5/OS that is downloaded. The original deal was for three years (which is up in April, I think), but my understanding is that the contract is being renewed for another three years, so you need have no fear. You can download from zend.com/downloads. You need to register and supply your system's serial number, but that is all. There are pre-reqs you need to install prior to loading Zend Core, but they, too, are all free, and you probably have most installed already.

Not only is Zend Core free, but Zend Studio is also free to IBM i users, and you can download it from the same page. Only Zend Platform (a high-performance version that you might consider in the future if running a large, heavily utilized site) has a fee associated with it. The only other fees are if you want Zend maintenance support beyond the free web-based support that comes with the basic package. The Zend forums are pretty good, though, and there you'll find a lot of information on how to install the most popular of the open-source applications.

When you download Zend Core, I would suggest that you pick the version that includes an install of MySQL—you will need it for much of the open-source software you are likely to want to use. The other choice is whether to use the automated PC installer. I have found that this works well but only if the PC in question is on the same network as the IBM i. When you use it over, say, a DSL connection, it doesn't handle the inevitable timeouts very well.

If you do want to play with PHP, you can load it on a PC. The two distributions that I am most familiar with are XAMPP (apachefriends.org) for Windows/Linux and MAMP for Mac (mamp.info). These install an Apache web server, MySQL, PHP, and a bunch of useful tools. I personally use MAMP but have used XAMPP in the past. Both are good packages that save you having to collect all the "bits." Zend also offers a similar package of its IBM version for PCs—it includes DB2 support, which is nice, but I have not used it extensively.

Still Programming in RPG

The article "Why Are We Still Programming in RPG" by Carson A. Soule [November 2008, article ID62267] needs a controversial comment. First of all, I would like to mention that I am responsible for the (ILE-RPG) application development of an ISV. If one speaks only about simple, System i-restricted and non-globalized solutions, then Carson is right. Otherwise, 4GL techniques and modern programming languages are essential.

Starting with the first point—simple applications—the complexity of applications has highly increased in the last 10 years. Thus, one needs abstraction layers (you can call it 4GL). Of course, the vendor-specific solutions such as LANSA and Cool:2E are not suited for software companies. One needs its own 4GL techniques to master the complexities.

Second: System i restriction. That means the RPG-based solution runs only on System i. However, nowadays this is a strong restriction for a software company. There are a lot of competing platforms a software solution has to run at too. System i restriction means also the exclusive use of RPG-enabled System i technologies, no networking, no file access in a network, no graphical user interface, no interaction with other systems. Of course, you can do all such things but not in a seamless way. You need a lot of technologies besides RPG, and you have to use tricks and do handicrafts to integrate such technologies into your RPG programs (see the huge amount of articles in System iNews about this topic). "4GL" as C# and Java deliver a sophisticated API which covers all the mentioned tasks without bothering the programmer with details.

Last: Non-globalized solution. A non-unicode solution is not worth being called a globalized solution, but it is a nightmare to transform a big RPG-based software solution of, let's say, about 10 million LOC to Unicode (it is my own experience). The difficulties start with the restricted Unicode capabilities of BIFs and opcodes end with the integration in the System i environment, as, for example, the invocation of API or CL, which are more or less non-unicode. And try to create or print a Unicode spool, if it works at all. We are still searching for ways to do that. I won't speak about the missed possibility to use internal defined output files with Unicode and other Unicode restrictions of RPG. All the other "4GLs" don't worry about Unicode, they are Unicode from scratch.

Ottfried Thümmel

Via email

Author Carson Soule replies: I must agree with Mr. Thümmel. RPG is not perfect for every application or company. As an ISV, we made the same analysis and decided to write new applications in Java over WebSphere to get the cross platform and other advantages he mentions. However, our experience was that we had a hard time being competitive in a purely i environment where these capabilities were not critical. As a result, we now often mix RPG back-end code with Java, Lotus Domino, or other front-end language implementations. While I hope that RPG continues to evolve rapidly, we continue to look for the language which will replace it. But, we haven't found it yet.

More Thoughts on Still Programming in RPG

First off, I should indicate my background since that probably shapes the opinion I will now espouse. I've moved from Fortran (on an IBM 360 mainframe), to machine language/assembly, to BASIC, Clipper (DBASE), Pascal, C++, PowerBuilder, and now C#.NET. I would never move back to any language I had ever used before because, in all honesty, each new language I have adopted over the years has been better than the one before.

I can understand however, how someone locked in the darkness of a System i shop, unbathed in the warm glow of modern programming tools, would believe that there is little to be gained from using them. Many 3GL programmers do not understand OOP and think that reusability is the copying and pasting of old code. They either see no benefit in, or do not understand, concepts such as inheritance, polymorphism, iteration, aggregation, interfaces, delegation, or overloading, and the power they provide to the developer. Someone who has always used a spear must find a gun useless since it does not have a point! I meet apologists for System i who keep trying to justify the expensive paperweight by pointing to its much-vaunted reliability. The same can be said for an AK-47. However, let's face it, modern weapons technology has gone past a gun created nearly half a century ago. The same can be said for RPG.

With modern languages, more can be done with a single command, and the applications frameworks make programming complex systems with large teams much easier. I don't even need to mention code maintenance, which is significantly easier using the aforementioned frameworks and powerful IDEs available today. If we include support, third-party libraries, development tools, books, user groups, language extensions, language evolution, etc., RPG would not even be mentioned in any useful discussion on programming. Well, none in which I've participated in the last 15 years.

The real crux of the discussion comes down to this. If Mr. Soule did not have a zillion lines of legacy code to maintain and had to start from scratch to write a new complex business application, would he ever consider RPG? Then again, given how little Mr. Soule seems to know about modern languages, he probably would.

Lancelot Green

Via email

Author Carson Soule replies: I would like to thank Mr. Green for amplifying my point with his excellent examples. First, however, I must correct his impression that RPG programmers are not in the warm glow of modern tools and techniques. Any reading of our magazine and its related forums and blogs should convince him otherwise as would an examination of the current language and tool offerings on i. I bring a working knowledge of most of the languages and all of the concepts he mentions. Someone who has always used a gun may have no idea how to work in a jungle, at close range, where bullets are unavailable. Under those circumstances, a spear looks mighty good.

Mr. Green's mention of the AK-47 is an excellent case in point. While theorists and warfare textbook writers will agree that the AK-47 is outdated, the experience in the field is that low cost and rock-solid reliability make it the weapon of choice for most of the world. Militants in Iraq, Afghanistan, and most of Africa have proven that they can hold off or fight to a draw the most technologically sophisticated armies in the world with little more than an AK and some improvised explosives. There are many stories of allied soldiers in a firefight who throw down their jammed M-16 and pick up a fallen combatant's AK-47 to continue to fight. I would argue that RPG is the AK-47 of the programming world. It loses most intellectual arguments but wins more than its share of real-world battles.

I have had several opportunities to completely replace legacy systems, starting from scratch and having a choice of language. My opinion stems from my experience in creating substantial new systems in Java, Groovy on Grails, and Lotus Domino. In a previous generation, I did so using VB, C, and Pascal. Yes, I am influenced by legacy systems, but I am more influenced by business demands for application functionality quickly and inexpensively.

To paraphrase Donald Rumsfeld, you go to program with the language you have, not the language you might want or wish to have at a later time.

The EGL Has Landed

Just got finished morphing your article to pull back dynamic menu label/options to EGL ["The EGL Has Landed: Calling RPG Programs from EGL," November 2008, article ID 62294]. I never had much cause to use nested array data structures but wish I would have gotten to know them better sooner! I had wanted to present "menu" options on EGL panels based on the signed-on user; this was a perfect way to get there. Really slick and opens up other opportunities.

Jake Berberich

Via email

Dynamic Memory

I just wanted to tell you that your article ["Dynamic Memory for the CL Programmer," August 2007, article ID 20982] was just what I was looking for, and it will save me a huge amount of time discovering concepts that you have already discovered. And that assumes I would have discovered them at all.

Anyway, we have programs like your example; I knew that when we got V5R4 I could revisit programs and change them to use either a larger RCVVAR or base the RCVVAR on a pointer. So we went to V5R4, I started my analysis of the changes, and used Google to search for "allocating memory in cl" (without the quotes), and your article was returned in the list of results.

The point is, I could use the IBM manuals to learn how to use a pointer in CL and then go looking for a built-in-function to allocate memory and find out there isn't one. QC2LE in a CL program would not have entered my mind for three days, then I would have forgotten to get rid of the substring operations for each element in the list, thereby leaving the programs relatively inefficient.

Mike Stephenson

Via email

Author Bruce Vining replies: Thank you very much for your note. It's great to know that I was able to help a fellow developer to take better advantage of the i.

We welcome your suggestions, criticisms, and opinions. Email your comments to editors@SystemiNetwork.com. All letters should include your name, your company name, city, and state or country. We reserve the right to edit letters for clarity and length. We also reserve the right to publish them in all electronic and print editions of System iNEWS unless the sender specifically requests otherwise.

ProVIP Sponsors

ProVIP Sponsors