Name

DEV-01: Set standards and guidelines before writing any code.

Synopsis

These standards and guidelines would, if I had my way, include many or all of the best practices described in this book. Of course, you need to make your own decisions about what is most important and practical in your own particular environment.

Key areas of development for which you should proactively set standards are:

  • Selection of development tools : You should no longer be relying on SQL*Plus to compile, execute, and test code; on a basic editor like Notepad to write the code; or on EXPLAIN PLAN to analyze application performance. Software companies offer a multitude of tools (with a wide range of functionality and price) that will help dramatically improve your development environment. Decide on the tools to be used by all members of the development group.

  • How SQL is written in PL/SQL code : The SQL in your application can be the Achilles’ heel of your code base. If you aren’t careful about how you place SQL statements in your PL/SQL code, you’ll end up with applications that are difficult to optimize, debug, and manage over time.

  • An exception handling architecture : Users have a hard time understanding how to use an application correctly, and developers have an even harder time debugging and fixing an application if errors are handled inconsistently (or not at all). The best way to implement application-wide, consistent error handling is to use a standardized package according to specific guidelines.

  • Processes for code review and testing : There are some basic tenets of programming that must not be ignored. You should never put code into production without having it reviewed by one or more other developers, and without performing exhaustive testing. Astonishingly, many (if not most) PL/SQL development shops have neither standard, mandatory code reviews nor a strict testing regimen.

Best practices throughout this chapter and the rest of the book address these crucial aspects of software development. You will also find many relevant examples throughout the book.

Benefits

By setting clear standards and guidelines for at least the areas just listed (tools, SQL, error handling, and code review and testing), you ensure a foundation that will allow you to be productive and to produce code of reasonable quality.

Challenges

The deadline pressures of most applications mitigate against taking the time up front to establish standards, even though we all know that such standards are likely to save time down the line.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset