Is PHP the Systems i’s Next RPG?
August 21, 2007 Alex Woodie
For years, the System i platform and its followers have marched through the wilderness of development languages, seeking a suitable replacement for the aging RPG, whose benefits aren’t a good fit for a Web world. Now, some platform advocates see the server-side scripting language PHP stepping into that role. Duncan Kenzie, the president of Excel Systems and one of the main developers of BCD‘s WebSmart PHP development environment, is one of the believers, as you’ll soon see in this Q&A. Alex Woodie: You have been working on the System i platform for 30 years, and have seen many technologies come and go. When did you first become interested in PHP, and what was your first perception? Duncan Kenzie: We became interested in PHP six to seven years ago. Both Marc [Hunter, who co-led the development of WebSmart] and I were involved in a project with our church where we wrote a database application that was written in PHP. The reason we did that was because it was so easy to write, and it was hosted on a local ISP. It meant that anybody in the church who we authorized to get into the application could work with it. We’ve been familiar with PHP for a long time. When I heard the rumor that it would be available on the System i a couple of years ago, at that time, we thought that it was a totally natural fit because there really hasn’t been a language that’s easy to use [that could be the] successor to RPG and suited to Web development. I think we all recognize that Java and WebSphere have basically been a bust. I’m not saying that because we wanted it to be a bust. We actually invested a ton of money in Java over the years and wanted it to succeed. But despite Java being a good language, the implementation of it in terms of Web development and WebSphere was just a disaster. Our client base is made up of lot of small to medium sized business or small departments in companies that are running System i. They’re not formally trained in computer science. They’re not interested in all the theory behind Java. They’re just interested in getting things done. So I think PHP is different because it’s very, very easy to start coding in. Any time you have something that can give you good success early on, it helps to build momentum and get into more complex things. I think that’s what PHP does for programmers. AW: At what point did you decide that PHP would be a good language to incorporate into your integrated Web application development and runtime environment, WebSmart? DK: That was basically a decision that we made around February or March of last year. We attended the ISV Tools council meeting at IBM, which was in the middle of May last year [2006], and at that time I was very excited about PHP and we’d already begun doing some research into what we’d need to do to create a tool that would use PHP. I spoke at length to a couple of IBMers involved in the project and I was working with Zend Technology and got a sense of the System i functionality that they’d put into it, which addressed a lot of our concerns. And from there we really started going full steam ahead. AW: How have you implemented PHP into WebSmart? DK: You can write PHP in any text editing or code editing tool you want. Obviously Zend’s tool gives you a lot of capabilities. Some programmers might use a text pad or an HTML kit or something very basic like that where it’s pretty much straight text with a helper kind of routine. So there’s nothing particularly special about having an editor for writing PHP. So what we’ve done differently is what we’ve done with all our products, which is minimize the amount of code that people have to write in order to be successful up front. You can make a comparison to what our application generator, ProGen Plus, was to SEU. With SEU, you could use some tools for writing stuff, but you still have to write it by hand. And Zend’s studio is pretty much the same way, it gives you, granted more sophisticated tools than SEU ever did, but you’re still writing it by hand. Whereas with WebSmart, the templates and the wizards lead you through the creation process, so you don’t have to write a lot of code up front to get the core things that you want working. The other thing we’ve done is separate the screen content from logic, which is something we do in WebSmart ILE. So conceptually it’s a lot like display files in RPG code, they’re separate from one another. So it’s easy to do your Web page design versus your coding, and not necessary to worry about intermingling them. AW: What went into the development of WebSmart PHP? DK: With PHP you get over 5,000 functions that are part of the core of PHP. And there are tons and tons of other people who are doing other function. It took us several man years to develop the product as a whole, and documenting those functions and organizing them. We took the documentation that was available on the Web site and we packaged them in such a way that they’re readily accessible within the tool, so as you’re working with the tool and you’re working with those functions, you get instellisense prompting for what those functions are. The functions are kind of grouped by category on the Web site but the tool itself needed to group them, so in the tool we provide a grouping mechanism for the most commonly used functions or your favorites, or functions by group, so you have lots of ways to get at those functions and to work with them. AW: What’s your take on how Zend and IBM have done with their PHP implementation on the System i? Is it a good package, or what improvements can be made? DK: I think they have done a really, really good first crack at it because they’ve addressed all the major concerns. First of all, they addressed the fact that you need to be able to access your database files. So one of the things that’s going to make it easy for RPG programmers, although all magazines recommend against it, is you can write record-level access code. Everybody is saying lets go to SQL. And I totally agree with that. But for those die hard programmers who know how to do a chain and read in PRG, they can do the same in PHP. The function is different, but the concept is identical. And they put in support for calling other programs, so you can call RPG programs, or CL programs, or COBOL or C programs from PHP. They did a nice job with that. It’s kind of cumbersome, there’s a lot of lines of code you need to write to do a program call. It’s probably four or five times as much code as you would write in RPG. And Zend has done something in their product where they have a little wizard that helps you write that, and what we’ve done with our product is we’ve provided a snippet, so you drag a snippet onto the screen, and you can just fill in the blanks. They also did data queues and spool files. I don’t know why they choose spool files, but they did. That’s kind of interesting. They’ve done a really good first crack at it. There can always be more things that they add down the road, more native object support, like checking authorities on objects, but that’s all stuff you can write in RPG and CL and call from PHP. But it might be nicer to have the native PHP functions. AW: Why will PHP be successful on the System i? How will PHP’s story on the platform be different than Java’s story? DK: Undoubtedly there’s a market for Java and for WebSphere. It’s more of the top Fortune 500 companies that can afford to invest enormous amounts of resources to set up really formal development methodologies and invest the time in bundling the infrastructure that it takes to work with a product like WebSphere. Where Java failed, first of all, it was a pain to install. Secondly, it was a pain to understand. Third, the design tool, WDSc, is an absolute memory hog. IBM really has screwed [it up] in terms of the ease of use of their software. PHP is just much more suited to small and medium size shops, where they want to get things done quickly. So maybe they don’t have the formality. They’re not using the unified model language; they’re not building data models or building entity relationship diagrams or data flow charts, whatever it might be. They’re just getting in, they’re starting to code, and they’re starting to write applications. And that’s where I see PHP fitting in. AW: How do things map in terms of comparing RPG’s functions versus PHP’s functions. Should it be fairly easy for RPG programmers to make the shift? DK: I think it’s going to be as easy as it can possibly get. Some people are going to struggle no matter what and others are just going to go, “Oh, yeah.” If I want to substring a field in RPG its SUBS and in PHP it’s SUBSTR.” Things like that. RPG programmers tend not to be familiar with common programming constructs like curly brackets and semicolons at the end of the lines and things like that, things that have been around in other languages for decades. Some people will take to it immediately and they’re productive in a couple of days, and other people will never get used to it. “If it’s not RPG, I can’t do it.” AW: Is there anything in PHP that will prevent developers from writing good business code? DK: That’s one of the objections that I’ve seen. “Oh it’s a scripting language; it’s a toy language; it doesn’t compile.” So what if it doesn’t compile. Visual Basic didn’t compile for years, and it had one of the biggest followings of programmers of any language, and tons of tons of PC applications were built in Visual Basic. Then Microsoft added sort of a pseudo-compiler to Visual Basic. But that’s the behind-the-scene stuff. Who cares about that? If the script runs efficiently, why should you care if it’s interpreted or compiled? Zend also provides applications that do some pseudo compiling. And really it’s no different than what Java does. So to me that’s sort of a red herring that people throw up. AW: Obviously there’s a big population of programmers out there that know how to use PHP already. Do you think this will help generate excitement for the System i among IT’s youth? DK: That’s the other reason that it excites me for the System i. It really makes the System i seem a lot less proprietary. It opens it up, makes it a lot more attractive platform for the younger crowd. All the kids coming out of college have learned probably two maybe three technologies. They’ve learned Java, they’ve learned Microsoft C# or .NET, and they’ve learned PHP. So there’s a whole new set of resources for System i shops to draw on to write the next generation of applications. Go to Microsoft’s developer Web site. It’s filled with pictures and videos and here’s the tool for creating a Facebook application. IBM probably doesn’t even know what a Facebook is. You go to their Web site and what do you get? You get this boring same standard look every page, nowhere where you can download trials. No pictures, no videos. There’s nothing sexy there. There’s nothing to draw to make it look like it’s cool to work on IBM systems. IBM needs to try and make their systems sexy so people will want to work on it. I have 30 people working for me, and most of them we hired straight out of college. None of them knew the System i, and after they’ve been here and get to know what it’s all about and how it works, they’re just blown away. They love it. So it’s not a generational thing. It’s just an educational thing. And IBM still doesn’t seem to get that. AW: So where are we now in WebSmart PHP? How are the beta tests going? DK: It’s going pretty well. It’s always a struggle to get people to actually do the beta. We had quite a lot of interest in the product, and we have about half the people actually using it. But we have a lot more interest in PHP than we have for other products in the past. In terms of volume, it’s going to be very successful. We’re still on track for releasing in [late] September. In fact there will probably be more features in the product than we announced in beta. We’re all using it internally and it’s pretty stable.
|