Peter Wainwright is the author of Wrox's "Professional Perl Programming". In this virtual interview he shares his thoughts on Perl, being an author and more...
When did you first start programming with Perl, and why? I first looked at Perl when I needed to write some simple CGI scripts, for which the build-compile-test cycle of C was too cumbersome and long-winded. At the time I was already well-versed in C, so using Perl wasn't a case of knowledge but of convenience: It was quicker to learn Perl and then implement scripts in it than it was to apply my existing C experience. At the time I wasn't aware of Perl's other advantages like taint checking, but in hindsight they would also have been good reasons to adopt Perl.
In your opinion is Perl well suited for real-world applications beyond scripting for the web and for system administration? Any language - well, almost any - is potentially suited to real-world applications, but to actually be useful for serious application development, a language needs to be well supported. Java, for example, is popular as much for the wide array of supporting APIs as it is for any advantages conferred by the language. Originally pitched as a client-side language, Java's popularity in server-side programming only took off when servlets appeared. Perl is similarly fortunate to be very well supported in third-party libraries and modules. This is what makes the difference between a language that is theoretically capable of large-scale application development and one that is practical. Every conceivable application area is covered.
There are Unix shells that are now almost as capable as Perl, but they don't have the same range of library support and nothing like CPAN (Comprehensive Perl Archive Network) to encourage them. Technically, there is no reason why they might not have grown to challenge Perl as the scripting language of choice, but since they were traditionally thought of as "for scripts only", they never did. In this respect the defining moment for Perl was the introduction of proper support for modules and packages (and as a side-effect, objects) in Perl 5, which transformed it from a better tool for shell scripts into a language that supported and encouraged the use of libraries. Since then, Perl has exploded in both scope and popularity. So yes, Perl is well suited for real-world applications - and if you don't believe me, just list the modules available on CPAN (www.cpan.org).
What are the most powerful aspects of the Perl language? There are many common answers to this question - regular expressions, for example. But I would say that the single most powerful aspect of Perl is simply its ease of use. It is a very easy language to think in, which means that I can spend more time working out how to solve a problem and less time working out how to implement that solution. That means more constructive use of my time, which is ultimately one of the key traits that any language should have.
Perl's motto is "there's more than one way to do it". Do you think that this is a positive trait for a language, or does it have drawbacks? Both - the counter motto is "Just because you can do it doesn't mean you should". I actually thought I'd come up with this on my own until I found it hidden in Perl's own documentation one day :-) Perl tries to impose as little control over how you use it as possible; that's the reason why it is so flexible. Perl's particular appeal is that it manages this while still providing a powerful basis for programming. The catch with this is that if you're a sloppy programmer then Perl won't snap you into line, unlike more rigorous languages.
How would you respond to those who accuse Perl of encouraging programmers to write illegible code? This follows the last question. Perl will support almost any programming style, which makes it very easy to migrate existing practices. Of course, if they're bad practices, they won't magically improve just because you're now writing in Perl. It's not the language but what programmers bring with them to the language that leads to illegible code. That's true of any language, but Perl's strength and weakness is that it is more permissive, which leads to greater flexibility but less strict enforcement.
One of the defining characteristics of a programming language is the stance it takes on whether and how much to control how code is written. I would disagree that Perl encourages illegible code, but equally it doesn't try to enforce legible code through its syntax. Plenty of other languages do, and each finds its own compromise between flexibility and control. Some argue that Perl lets programmers get away with bad coding, and they may be right, but that doesn't alter the fact that bad coding comes from the programmer or suggest that writing in a stricter language will magically turn a poor programmer into a good one.
Are there any changes/improvements that you would like to see made to the Perl language? Actually, a lot of changes and improvements to Perl are already in hand in the shape of Perl 6. For details of the current specification and progress see http://www.perl.org/perl6/ If I had to pick one feature I'm looking forward to, though, it would be threads. Perl already supports them, but only experimentally. Other than that, I would like to see Perl remain recognizably Perl and not suffer from feature bloat. Perl manages to leave in code features that other languages implement internally, which allows it to remain both versatile and free of ideological dogma. I wouldn't want to see that change.
There are already many Perl titles on the market. What makes Professional Perl stand out from the others? It seems to me that a lot of books put the cart before the horse - they start out with the features and then explain how to use them to solve problems. That's great if you already know how to do something in general, but it's not very handy if you have a problem and want to know the best way (or ways, as there are often different approaches, especially in Perl) to solve it.
In my previous book, Professional Apache, I tried to write from the point of view of the problem rather than the solution, covering the features of each approach to solving it and covering other ideas and drawbacks in passing. Judging by reviews this seems to have been largely successful.
I've applied the same logic in writing about Perl. If anything, given Perl's motto, "There's more than one way to do it", it's even more appropriate for Perl than it is for Apache. So I hope that readers of Professional Perl will find it a more accessible book, which will result in less time actually reading it and more time programming.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
More Interviews Articles
More By Wrox Team
developerWorks - FREE Tools! |
IBM Enterprise Modernization solutions help organizations evolve core IT systems towards modern architectures and technologies—reducing the burden of maintenance and freeing up resources to develop new business requirements and capabilities. With the IBM Enterprise Modernization Sandbox for System z you can evaluate IBM Enterprise Modernization solutions focused on five key areas: Assets, Architectures, Skills, Processes and Infrastructures, and Investment. Each solution is based upon real customer experiences and offers a proven path to get you started with your modernization projects. FREE! Go There Now!
|
|
|
|
Asset Reuse is a key strategy for companies looking to create innovative solutions to solve complex software development problems. Searching for, identifying, updating, using and deploying software assets can be a difficult challenge. Listen to this webcast, to learn about strategies and tools that you can leverage for a successful project, including Rational Asset Manager, Rational Software Architect and WebSphere Service Registry and Repository. FREE! Go There Now!
|
|
|
|
Join this Rational Talks to You teleconference on November 29 at 1:00 pm ET to participate in an interactive discusssion with Grady Booch around architecture and reuse. Get your questions answered! FREE! Go There Now!
|
|
|
|
Discover how Rational tools and best practices for testing can make your job easier. The new Rational Testing eKits provide you with valuable resources – including demos, webcasts, tutorials, and articles – that help you address your specific testing needs across the software lifecycle. Five new eKits are available covering the topics of Requirements and Test Management, Functional Testing, Performance Testing, Code Quality and Embedded Systems, and SOA and Web Services Testing. FREE! Go There Now!
|
|
|
|
Learn the basics of the IBM Customer Information Control System (CICS). With a hands-on exercise, learn how to get your first CICS application up and running on your desktop using TXSeries V6.1 for Windows. The tutorial shows you how to download and install a free trial version of TXSeries V6.1. FREE! Go There Now!
|
|
|
|
Try the latest version of IBM Rational Manual Tester V7.0.1 by downloading a free trial from IBM developerWorks. This manual test authoring and execution tool promotes test step reuse to reduce the impact of software change on testers and business analysts and addresses the needs of teams performing at least a portion of their testing manually. FREE! Go There Now!
|
|
|
|
Get a free trial download of the latest version of IBM Rational Method Composer V7.2 which helps you deliver customized yet consistent process guidance to your project teams and IT organization, and includes the latest version of IBM Rational Unified Process (RUP), which has provided process guidance to teams since 1996. FREE! Go There Now!
|
|
|
|
IBM Lotus Notes 8 provides a wide range of developers the ability to provide customized, integrated user interfaces via composite applications and via custom sidebar and toolbar plug-ins. This webcast provides you with tips and techniques to use with out-of-the-box capabilities of Lotus Notes 8, and survey how you can share useful components within your own company and within a larger community. FREE! Go There Now!
|
|
|
|
Viper 2 brings a great value to developer communities including SQL, XML, PHP, Ruby, .NET and Java. You probably already know that DB2 Express-C is free for developers to develop, deploy and distribute. Viper 2 provides a variety of means that help move your application from the development stage to deployment more rapidly. This webcast shows how to best utilize the latest tools available for developing DB2 applications. FREE! Go There Now!
|
|
|
|
The unprecedented scope of a service-oriented architecture (SOA) initiative brings to the forefront a number of management and governance issues that were sidestepped in the past. The key to a successful SOA implementation is managing and governing activities throughout the entire SOA delivery lifecycle by ensuring that services conform to the needs of all of the business’s stakeholders. Learn how service lifecycle management allows the business to ensure that the process by which services are defined, created, tested, deployed, optimized and retired is manageable, repeatable and auditable. FREE! Go There Now!
|
|
|
|
All FREE IBM® developerWorks Tools! |