Slashdot Mirror


Elements of Programming with Perl

Bringing a little competition to O'Reilly, this Manning Publications book Elements of Programming with Perl seems to be have struck a nerve with reviewer chromatic. Click below to find out how - and possibly add a new book to your library. Elements of Programming with Perl author Andrew L. Johnson pages 352 publisher Manning Publications, 09/1999 rating 8/10 reviewer chromatic ISBN 1884777805 summary New to programming, and think Perl may be up your alley? Andrew Johnson's excellent Elements of Programming with Perl will teach you both disciplines. What's the Purpose? Hundreds of books teach programming. Dozens of good books teach Perl. Where's a book for someone who wants to learn Perl and programming, at the same time? Thankfully, that's just what Elements of Programming with Perl does. What's Good? From the start, Johnson's explanations are clean and clear. It's obvious that he's polished his didactic style through years of real world teaching. Also from the start, good programming practices receive due emphasis. Though it's not specifically mentioned until chapter 9, Johnson advocates and demonstrates good program design through a mixture of Donald Knuth's Literate Programming and his own code tangling style (mingling documentation, design notes, and code in a single source file, similar to POD on steroids).

The teaching flow is logical and consistent, with chapters dividing the material into logical divisions. By the end of chapter flow, students should be capable of writing moderately complex programs. Subsequent chapters build on that foundation, and most provide a specific example program to tie things together. These programs all have a practical concentration.

On the Perl-specific side, Johnson does not shy away from recommending the copious Perl documentation, CPAN, other books like the Camel, and many other excellent resources. Much of the value of an education is learning where to go for further information.

What's not Great? Some of Johnson's focus is on mathematical applications, which may distract some readers. Also, this book may not serve as a future reference after you've become more comfortable with the language. Look to the Camel or Perl in a Nutshell for that -- Johnson concentrates on teaching the basics rather than documenting the iotas and tittles of internal Perl functions.

Finally, the example program in Chapter 19 may be hairy for novice programmers. Sit down in a very quiet room with a pad of note-paper and your beverage of choice. Consider it a final exam after you're familiar with everything preceding it.

Summary This is a good introduction to Perl, and a very good introduction to programming in general. Johnson promotes good habits and discipline. Elements may not sit on your shelf as a reference, but it will help you to become an effective programmer. It's a rare book that teaches as well as it informs, so take the plunge and teach yourself Perl and programming.

Pick this book up at ThinkGeek.

Table of Contents
  • preface
  • acknowledgments
  1. Introductory elements
    1. Introduction
    2. Writing code
    3. Writing programs
  2. Essential elements
    1. Data: types and variables
    2. Control structures
    3. Simple I/O and text processing
    4. Functions
    5. References and aggregate datastructures
    6. Documentation
  3. Practical elements
    1. Regular expressions
    2. Working with text
    3. Working with lists
    4. More I/O
    5. Using modules
    6. Debugging
  4. Advanced elements
    1. Modular programming
    2. Algorithms and data structuring
    3. Object-oriented programming and abstract data structures
    4. More OOP examples
    5. What's left?
  • appendix A Command line switches
  • appendix B Special variables
  • appendix C Additional resources
  • appendix D Numeric formats
  • glossary
  • index

4 of 194 comments (clear)

  1. This fills a void by predictive · · Score: 5

    Putting aside the (flamebait) arguments that Perl is or is not a good first language, I've seen several people turn to other languages that were less appropriate for their needs (like sysadmins) because of the lack of a good beginner book for Perl

    Until now, it's been relatively easy to find books on C, C++, Java, etc for the non-programmer, but Perl has historically been supported by tomes that double as reference manuals, which are not really the best for first-time language instruction

    Even the excellent Llama book (Learning Perl) assumes some familiarity with the use of logic and simple programming concepts (like variables). This makes it doubly difficult for a newcomer who wants to harness the text-processing power of Perl but quickly becomes lost in its (admittedly unique) syntax.

    I'm glad to see a better entry point to perl for the programming newbie. Maybe now the c.l.p.m. s/n ratio will improve

    --
    So E is relatively prime to (P-1)(Q-1)... Odd, that.
  2. Re:Perl as A First Language Is Scary by Matts · · Score: 5

    Before you dismiss Perl altogether as a friendly robust large scale programming language, I seriously recommend a read of Object Oriented Perl by Damian Conway. It's a truly awsome book which just brings together clean programming and perl. Something a lot of people didn't think was possible!

    After reading it I built XML::XPath - an implementation of the XPath spec in perl. It uses lots of classes to do its work, and I feel it's coded very cleanly. And it remains pretty quick (Damian has a discussion of Perl's OO speed issues in the book). If you want to check it out see CPAN. If you don't or can't understand the code I feel I've done something really wrong.

    --

    Matt. Want XML + Apache + Stylesheets? Get AxKit.
  3. Perl does NOT have just one datatype by King+Babar · · Score: 4
    For example, in Perl (like most scripting languages) there is a single data type to represent everything from strings to characters to all sorts of numbers.

    There are many reasons why Perl may or may not be a good first language, but this can't be one of them, since it just isn't true. TCL used to be the textbook example of a language that used the string as its representation for everything, but TCL isn't string only anymore, either.

    Really, I don't know where people get this idea about Perl, which certainly isn't the most typeful language on the block, but is hardly short of interesting types. I suppose it comes from the fact that Perl does provide a lot of automagical operators and conversions (although the fact that conversions are involved should make it clear that Perl has more than one underlying type).

    But one thing I'd like to point out in particular:

    Java/C++/C/Fortran/Basic etc...have different data types (short, long, char, String etc...) for very good reasons.

    Says somebody who clearly hasn't ever had to justify the difference between a short and long to a beginning (or non-)programmer. I would actually argue that the short/long difference is exactly the kind of "people working for the computer" stuff that doesn't belong anywhere near somebody's first exposure to programming.

    If you want to teach the importance of types at the same time you teach programming, you would do better to use a language that has a more interesting and flexible type system; one obvious candidate would be Haskell, or it's interpreted cousin Hugs.

    --

    Babar

  4. What's the best thing about C? by hey! · · Score: 4

    The best thing about C is that almost anybody with any sense teaching or learning C uses K&R. Beginners consciously or unconsciously absorb a standard style and approach to common programming problems that are within the purview of the language.

    What's the worst thing about Perl? The biggest complaint I hear is that Perl is cryptic; however I think this is bit of a bum rap. It isn't hard to make C programs that rival the worst Perl examples. Also, I've found some largish Perl systems that were a breeze to maintain, very clear and well organized.

    I think a lot of this complaint really can be traced to the Camel book, which while generally admirable and clear in its explanations is a bit too hung up on the Perl motto: "There's more than one way to do it". It is an interesting, and perhaps essential element of the Perl philosophy (I haven't decided which), but unfortunately every new Perl programmer who uses the Camel book to learn makes up his own idioms, and they don't always choose well.

    I'd be interested in the consistency and quality of the Perl style in the book. It may be time for an "elements of Perl style" handbook.


    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.