Can SQL be a good thing in itself?

I currently work on a project that is not my own, to implement new functionality all over the place. This project is basically done in a level 2 style with a lot of static function calls. It’s totally procedural with class names to separate different areas of logic. And the SQL is there for all to see.

Jeff Atwood and Rob Conery had a small argument over the issue of languages inside languages. I do agree with Rob that regexes are a pain in the ass, I rarely have to use them and when I do it’s brushing up time first, every time. I wouldn’t mind having a nice interface for writing them. That would be easier to handle than the regexes themselves even if it’s not as succinct.

However, when it comes to SQL I’m starting to feel ambivalent. Approaching and getting into this project has been extremely easy. Since the SQL is there out in the open I have had no problems at all with understanding various logic very fast. I know, writing something like $row->getParentRow() is a hell of a lot quicker and less redundant than writing a whole SQL statement every time, and you can use it with different databases and so on. But if I didn’t know the framework in question I would have to do some studying first, before being productive. The million dollar question is what would be quicker? I think it depends on the size of the project but that just transforms the question into an exercise in finding out where the threshold limit is.

In addition, since everything is declared statically PDT has no problems finding it’s way. The F3 button takes me where I want to be without a glitch which adds speed to my work.

Sure, having everyone learn the Zend Framework would be a solution to the problem, then when something like $row->getParentRow() is encountered, we would all know what that means. The problem is employee turnover, we’ve got people quitting and starting left and right. Every new face would have to get into our framework of choice first, and would probably need help with it too which wastes even more time.

Level 2 style projects with pure SQL would not pose a problem though, most people can be up and doing maintenance or adding features to such a project in no time. So in a way this simpler way of doing things could actually be more maintainable for us than using a framework.

We are hardly doing gigantic enterprise projects over here. I’m not saying that this style would work on such projects. However, when it comes to these middle sized things I’m beginning to believe that maybe we are already doing things the right way. A few weeks ago I had a different opinion, it’s funny how fast things can change.

Related Posts

  • No Related Post

Tags: ,