O'Reilly logo

Learning Oracle PL/SQL by Steven Feuerstein, Bill Pribyl

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

6.1. Organize Your Code

Way too many PL/SQL developers do an absolutely awful job managing their code. They put all their files into a single directory. They use short, cryptic filenames, because who's got time to type long names? And they use a single extension (.sql) for all the files.

These are all bad ideas and, as a newcomer to the world of Oracle development, you have the opportunity to establish good habits. This section offers a number of simple tips you should follow; they will make your life as a PL/SQL programmer much easier.

Before diving into the details, though, it is worth noting a couple of general principles:

We are lazy

The general tendency of most human beings is to do the smallest amount of work (especially anything like administrative work) necessary to get the job done. This "job" is often defined as that thing right in front of our nose, and we rarely take into account the likelihood that we will have to deal with this job for a long period of time.

The reality, of course, is that we (or others) will find bugs in our code, users will request enhancements, we will learn how to do things better and want to fix up our code, and so on. If we are not careful about how we write and organize our code at the start, we will soon be lost in a jungle of software. The result is that in the short term we save a few seconds or minutes, but in the long run we lose hours or days.

It's always more complicated than it first appears

You can be brand-new to programming ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required