To reopen the can of worms, I bet that those who choose tablename_id are older and more experienced programmers. Those who use only id are younger.
Why? because you learn redundancy and constancy is not always bad. the only thing I would like to add to answer # 1, using "_" helps to facilitate the selection of a variable in the code, in the table, etc. .... I do the same for foreign keys. TableName_FK Some will argue about this, but it works for me, and it is obvious what it is.
I had to work a lot on other code for many years. Consistency is critical, obfuscation is useless and meaningful variable names are very useful. There are those who claim that verbosity makes code harder to read. I do not think this argument flies in the modern world of objects. That.derive.from.some.microsoft.class.twenty.layers.deep.that.you.have.to.fully.reference.
BTW - as many have said, this is your choice. Those people who spend time arguing about coding syntax do not have enough work. Learn to be flexible and use the standards of the workplace where you work. If you are fortunate enough to set your own standards, then you have one. The fact that you are wondering is wonderful. But choose one and then be consistent (until you change assignments or decide that you have a paradigm shift, which means you want to change your style.)
You can often choose in which era someone began to learn to code their personal preferences and styles. The guys who write very hard, minmal, hard to read code returned when the memory was very limited (DOS) and probably wrote a lot of assembler, those using Hungarian started working with the Win SDK, etc.
This discussion has been developing for decades. The older I get, the more I document my code, the more meaningful I make my variable names, etc. .... because in a week I will forget what I wrote and I need roadmaps to figure it out. Not so much that I forgot, although this part of the equation, but even more so because I write code in many different projects.
source share