DEV Community

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

Collapse
 
cardosocharmoso profile image
CardosoCharmoso

Sounds like Go. Is there any other language that complains about mismatched columns-structs?

Collapse
 
fluffy profile image
fluffy

This is a problem in any database binding that retrieves stuff as an array of values rather than as key-value pairs. This is the default behavior for many, many things, although it’s generally a sign of micro-optimization when it’s being used. (There are definitely systems where it makes a real performance difference though!)

For the reason of stories like these, I feel that doing positional row access is a mistake and you should always use key-value retrieval instead. Even if everything goes right in a migration you don’t really want to be relying on the order of columns in a table. (Which is another reason to avoid SELECT * as well.)