|
||||
|
|
Perl Coding Style and Maintenance
"TMTOWTDI" aka "Flexibility Incurs Responsibility"The funny-looking acronym shown above is frequently sighted in Perl programming forums online, and stands for "There's More Than One Way To Do It". Perl gives programmers a lot of flexibility in terms of program design and coding style, but this comes at a price. Unfortunately, in some circles the language suffers from a reputation for "obfuscated" (unreadable) code. This not usually Perl's fault, but the fault of programmers who elect to write their programs in a manner that defies comprehension (even to themselves, in some cases). When you write a program that's intended to serve as more than a one-off script that solves a temporary problem, try to follow some basic guidelines:
Any programming language can be used to write unmaintainable software. As you explore the wealth of freely available Perl scripts found on the web, you're bound to find some truly horrid examples of programming gone dreadfully wrong. Likewise, you'll see scripts that obviously reflect the time and effort the author put into usability considerations.
If you make you work available to others (a practice that is strongly encouraged), try to put yourself in the shoes of someone who's never seen your program before. Does it solve a particular problem in an efficient fashion? Does the code look like it's been through a bit grinder? Especially if the software you write have the potential to outlast your tenure at your current employer, put some effort into making sure future staff members will be able to easily maintain them. Writing "spaghetti code" is never a recommended tactic for improving job security, and only reduces your reputation among your peers. The next chapter explores some basic guidelines for avoiding common security pitfalls. Continue: Security Considerations Table of Contents
|
|||
| All contents Copyright © 2007-2011 ClassHelper.org®. Please see our Privacy Policy. | ||||