Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Based on my experience, I do not agree with the author.

DB Abstraction layer has helped me reuse the same libraries on different DB engines more than once.

I had one occurance when I needed to install my new webapp in a hurry (for demonstration purposes) and couldn't arrange for a database with the server administrator fast. Well... I just changed "mysql" to "sqlite" in my DB config, fixed a few problems with SQL CREATE statements and it worked.

On a side note I also agree with the "PHP is the best templating languge" idea. I just use a template class for it that has a similar API to Smarty.

So yes, I use abstraction layers in both cases. I guess that is more convenient because I do not work on any one web application for too long and I need to carry my libraries and knowledge painlessly from place to place. If I had only one application to build and support at one location... who knows, maybe I would even write php extensions for it in C.



I agree with you 100%. Smarty (or similar templating engines) can make it much faster to get a website up and running; as for the speed complaint, Smarty compiles it's templates to PHP the first time you run them, so there's really not much difference after that.

I'm also kind of tired of programmers who complain and complain about others taking the easy way out, people don't program like they used to, etc.; the whole reason for having abstractions is to take some of the 'real' programming out of the equation and let you focus on the actual task you want to accomplish. It may not be the most efficient method of programming, but there are only so many hours in a day...




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: