3 ms·
> Dogmatic Programmer: let’s make everything abstract, what if we need to switch databases? > Pragmatic Programmer: we will never switch databases. In other w
by ARandomerDude 5y ago
> Dogmatic Programmer: let’s make everything abstract, what if we need to switch databases?
> Pragmatic Programmer: we will never switch databases.
In other words, the blog author is saying "I don't have much software experience." I used to think I'd never switch databases too, until I built a very large system and had to switch databases.
- zeckalpha 5y agoThe point from the book as I remember it is that of YAGNI: You Ain’t Gonna Need It. Don’t proactively build these layers of abstraction until you discover that you do need them. After a migration, toss it.
- cjfd 5y agoI think both the dogmatic programmer and the pragmatic programmer are wrong here and the truth is somewhere in the middle. The code actually touching the database and doing queries should be a small percentage of a large application. Mixing database logic and application logic in a large application is just bad. This does not mean that one should make everything abstract, it just means business logic should request data from the database through a layer saying things like Customer cust = GetCustomerById(id) (for instance, there are other possibilities but at least one does not see database code in this explicitly). It will still be a bit painful to switch databases but it will not be impossible. It is okay that it is a bit painful to switch databases if everybody was thinking with good reason that it would not happen. It is not okay that it is impossible to switch databases even if everybody was thinking this would not happen.