My TL;DR style notes from articles I read today.
Effectively Naming Software Thingies
“Programs are meant to be read by humans and onl...
For further actions, you may consider blocking this person and/or reporting abuse
I'm feeling bad about the database I tossed up last week where all the ID columns are called ID rather than <tablenameID now... 😳
I actually prefer that instead of tablenameID. I typically don't like alliteration in my SQL queries or code function calls. I'd much rather invoke
select * from users where id = ?
instead ofselect * from users where userid=?
I find the first one more readable and understandable as well.
This isn't generally bad. I worked with both and having TableNameID makes a lot of sense when you write more SQL code. It makes join conditions way easier to read.
Yeah definitely, and since I'm using the ids to correspond to other numeric columns in one base table then using a view to display strings instead of underlying integers, I think it's passable for the time being.
It seems pretty okay for a database since the context gives it meaning and using 'id' is pretty common in database lands. i.e. don't feel bad!
I've recently made a change in our api where we had three
data
properties where each meant totally different thing. 🤔Are they now named
data1
,data2
anddata3
? 😛No! : ) It is paginated research data and JSON previously looked like this:
Now it's been renamed to be as follows, which is 1000 times better!