You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After spending ten years typing "street_edge" / "street_edge_id" / "street_edge_region" / "street_edge_priority' and such, I think that we could probably rename these things to "street" / "street_id" / "street_region" / "street_priority". It really is a pain while I am constantly typing out SQL queries to diagnose issues on the fly.
The change is primarily for QoL when typing stuff out, but it also will make our code shorter and easier to read. I would argue that the word "edge" doesn't actually help anyone understand what we're working with, it probably is more confusing than anything to most people!
I got so annoyed by this today, that I finally looked up something that I had thought didn't exist but certainly does! You can shorten your join if the column names match with the "USING" keyword! My least favorite join to write has always been:
FROM street_edge
INNER JOIN street_edge_region ON street_edge.street_edge_id = street_edge_region.street_edge_id
Which it turns out can be significantly easier:
FROM street_edge
INNER JOIN street_edge_region USING(street_edge_id)
But... what if it was even easier...
FROM street
INNER JOIN street_region USING(street_id)
Obviously low priority, but would be nice to have an intern make the change!
Potential solution(s)
To make this change, we would need to:
Change all instances of "street_edge" -> "street", "streetEdge" -> "street", "StreetEdge" -> "Street", etc. throughout our code.
Note that we would have to take care to make sure that if we named a variable streetEdge that we didn't also name another one street nearby already. It's possible that this poor practice was used once or twice in the JavaScript 🤷
We should also just check for any other instances of the word edge/Edge/EDGE. It's possible that we used that as a shorthand in places where space was at a premium.
Add an evolutions file that renames all of the tables and column names. Should also verify that the indexes, foreign keys, etc are updated automatically. I expect that they are.
The text was updated successfully, but these errors were encountered:
Brief description of problem/feature
After spending ten years typing "street_edge" / "street_edge_id" / "street_edge_region" / "street_edge_priority' and such, I think that we could probably rename these things to "street" / "street_id" / "street_region" / "street_priority". It really is a pain while I am constantly typing out SQL queries to diagnose issues on the fly.
The change is primarily for QoL when typing stuff out, but it also will make our code shorter and easier to read. I would argue that the word "edge" doesn't actually help anyone understand what we're working with, it probably is more confusing than anything to most people!
I got so annoyed by this today, that I finally looked up something that I had thought didn't exist but certainly does! You can shorten your join if the column names match with the "USING" keyword! My least favorite join to write has always been:
Which it turns out can be significantly easier:
But... what if it was even easier...
Obviously low priority, but would be nice to have an intern make the change!
Potential solution(s)
To make this change, we would need to:
streetEdge
that we didn't also name another onestreet
nearby already. It's possible that this poor practice was used once or twice in the JavaScript 🤷The text was updated successfully, but these errors were encountered: