DEV Community

Readability for Real - Using Meaningful Names for Database Queries

Alvaro Cavalcanti on October 16, 2018

Readability matters Anyone that has programmed for a while and had to deal with someone else's code knows it (especially when this som...
Collapse
 
theodesp profile image
Theofanis Despoudis

Ideally, you also don't want to hard-code any values there in your filters. They do not scale very well.

Collapse
 
alvarocavalcanti profile image
Alvaro Cavalcanti

I see your point, Theofanis, and it's a valid one. But just for clarification, in my context, those hard-coded values will never change. The query might get extra exclusion clauses in the future, but the definition of those plans will remain the same.

And in this case, I weighed the pros/cons for readability versus extensibility and concluded that hiding the information away in constants or even external parameters would not pay off.