Posted by Tyler Muth on June 1, 2008
Last week I was talking with a colleague about some upcoming projects. Some of them involve some pretty challenging concepts like repeating calendar events. He asked me if some of these concepts had already been written so we could get a head start on the projects. While I know they have been written before (I worked on a calendar with the APEX team back in the day), I can’t say that the code was very reusable beyond the specific project they were written for.
When I look at other languages like Java, Python, Perl, PHP, etc., I see a lot of reusable libraries that are common in those communities and simply imported or referenced in many projects. Outside of the PL/SQL libraries that ship with the database, I just don’t see a lot of this in the PL/SQL community. Don’t get me wrong, there is a lot of PL/SQL sample code out there which is very helpful, but it’s typically not a library that I simply import and call, more like a block of code that I would re-write for my specific project.
So, a few questions for the community. Am I on to something here about the community as a whole, or is it just my own coding style that needs to become more reusable? If this is an issue, is it a symptom of all procedural languages? Could it be that a big part of the problem is that PL/SQL is compiled in a schema right next to tables, so it’s just too easy to couple your logic and DML, thus making your code less reusable?