• Wakey wakey, Forum thread. 🙂

    I found this during a search and felt compelled to submit my two cents. 🙂

    I am against ubiquitous non-descriptive naming conventions; however, I am for descriptive naming conventions because eliminating the process of [looking at an object's name and not immediately knowing what it is or does without having to go hunting and read some or all of the code which can take a really long time] is possible with a little forethought and the implementation of a descriptive naming convention.

    In an environment with 1000's of database objects and several developers, this "lookup time" can amount to 1000's of wasted minutes when aggregated. Adhering to a not-really-that-hard-to-stomach naming convention can reduce or altogether prevent this waste of time.

    In a situation that wouldn't be better solved using schemata, useful prefixes — like [PJSP_%] - standing for Primary Join Stored Procedure — can be used to categorize many different steps or one of several series of stored procedure executions in an environment where code standardization is required across MANY databases and when multiple people are working on the code base of over one million lines. A object browser skim can take a very long time to find one object in 500 stored procedures, or 500 tables, or 500 views when the object might be a table function. Three characters "vw_" can save the developer from having to look in multiple places for his item.

    Q: But what if the table becomes a view!?

    A: Not a valid excuse anymore. Do some work, and build the solution properly. In the future, build solutions with scalability in mind from the beginning instead of naming objects and coding in a manner that will allow for inefficient design to persist until a scalable solution is required to be built.

    Prefixing also makes following instructions more palpable for junior developers:

    Copy all of the Primary Join Procedures and all of their called functions and called procedures to Database1743 from Database_0000_CODEREPO.

    Imagine, being a junior developer finding non-descriptive procedure names:

    "Table Backup", "Base Table Creation", "Base Table Population", "Data Calculations", "Data Calculation", ... "Final Step"

    You'd come back in a few minutes with questions and have to skim code to find out which functions and other procs are called by the procedures. This is highly inefficient.

    Now imagine, being a junior developer and finding procs and functions named thusly:

    "PJSP_Step001", "PJSP_Step002", "PJSP_Step003", "SJSP_Step001" ... "PJSP_Step167"

    "PJSP_SubStep001Backup", "PJSP_SubStep001ARenameOldIfError", "PJSP_SubStep003Restore"

    You'd probably be able to get started right away and probably be able to finish before coming back with questions.

    Code example:

    WHERE sys.procedures.name LIKE 'PJSP_Step%'

    -- One, elegant condition.

    Keep up the good work, fellas.