📖 Overview
Perl Best Practices presents a comprehensive guide to writing maintainable, readable, and efficient Perl code. The book outlines 256 specific guidelines that cover naming conventions, data structures, subroutines, testing, and debugging.
Each guideline includes detailed explanations of the reasoning behind the practice, along with code examples demonstrating both recommended and discouraged approaches. Conway addresses common pitfalls and programming challenges while offering practical solutions that work in real-world development environments.
The text devotes significant attention to topics like documentation, error handling, and code organization - elements that impact long-term project success. Built-in Perl features and popular CPAN modules are examined with a focus on their strategic use in production code.
The book stands as a systematic approach to elevating code quality through consistent practices and proven patterns. Its principles reflect broader software engineering concepts while remaining grounded in Perl's unique capabilities and culture.
👀 Reviews
Readers value this book as a reference for writing maintainable Perl code. They appreciate the detailed explanations behind each practice and the included Perl::Critic tool for automated code checking.
Liked:
- Clear rationale given for each recommendation
- Practical examples showing good vs bad approaches
- Thoughtful discussions of tradeoffs
- Focus on readability and maintainability
Disliked:
- Some practices seen as too strict or opinionated
- A few recommendations considered outdated
- Dense reading that's hard to absorb all at once
- Some readers found the Hungarian notation suggestions controversial
One reader noted: "Changed how I write Perl - wish I had this years ago." Another said: "Good ideas but too dogmatic in places."
Ratings:
Amazon: 4.5/5 (80 reviews)
Goodreads: 4.1/5 (369 ratings)
Safari Books: 4/5
Stack Overflow users frequently recommend it in Perl-related discussions, though often with caveats about selectively adopting practices.
📚 Similar books
Clean Code by Robert C. Martin
This guide presents specific techniques and principles for writing maintainable code with examples across multiple programming languages.
Code Complete by Steve McConnell The book provides programming best practices and principles that span the entire development process from requirements gathering to testing.
The Pragmatic Programmer by Dave Thomas This work covers programming fundamentals and best practices through practical examples and real-world scenarios.
Effective Python by Brett Slatkin The book presents specific ways to write better Python through concrete examples and established patterns.
The Art of Readable Code by Dustin Boswell and Trevor Foucher This guide focuses on techniques for writing code that other programmers can understand and maintain across any programming language.
Code Complete by Steve McConnell The book provides programming best practices and principles that span the entire development process from requirements gathering to testing.
The Pragmatic Programmer by Dave Thomas This work covers programming fundamentals and best practices through practical examples and real-world scenarios.
Effective Python by Brett Slatkin The book presents specific ways to write better Python through concrete examples and established patterns.
The Art of Readable Code by Dustin Boswell and Trevor Foucher This guide focuses on techniques for writing code that other programmers can understand and maintain across any programming language.
🤔 Interesting facts
🔸 Damian Conway holds a PhD in Computer Science and has been a three-time winner of the Larry Wall Award for Practical Utility, recognizing the most useful Perl tools.
🔸 The book contains 256 specific guidelines for writing cleaner, more maintainable Perl code, each explained with detailed rationale and practical examples.
🔸 Many of the practices recommended in the book influenced the development of Perl 6 (now known as Raku), particularly in areas of code readability and maintainability.
🔸 The author created several popular Perl modules including Lingua::EN::Inflect and Switch, which later became part of Perl's core distribution.
🔸 The book comes with a companion toolkit called Perl::Critic, which automatically analyzes Perl code for compliance with the best practices outlined in the book.