DEV Community

Discussion on: A junior, a mid and a senior dev walk into a bar

Collapse
 
rafaelsales profile image
Rafael Sales

I disagree with never using *. There are data access design patterns that play really well with *. So, one can easily blame the code that uses the result of the * query.

Collapse
 
anwar_nairi profile image
Anwar • Edited

Star is bad for 2 reasons:

You do not know what to expect from the query, and your code becomes less easy to maintain because the fog of star query does not make it easy to perform changes (e.g. refactoring).

You will fetch fields that you do not care in case migrations added new fields on the table. Unoptimized bandwidth it is for sure.