Frustration
-
Why does the column name in my code have to match the column name in the database? It just feels so.... restrictive.
It doesn't. SQL allows you to alias names. You can also use a view. You can also map things in a slew of other ways too. For $19.95 USD, I'll show you how. Inflation...
Jeremy Falcon
-
Why does the column name in my code have to match the column name in the database? It just feels so.... restrictive.
And if this was a joke on the programming question issue.... mad respect. That was quite nice. :laugh:
Jeremy Falcon
-
Why does the column name in my code have to match the column name in the database? It just feels so.... restrictive.
-
Because it makes sense. What reason, to have the name 'X' in database and in the code it is 'Y'.... If you like that, happy confusion in the future ;)
It sort of like calling people by another name, that is not theirs. "Hey Bob, how are you today?" "I'm not Bob, I'm Charlie!" "Who's Charlie? You must mean Debra. Wait right here, I'll get her/she/they/them." :laugh:
-
Why does the column name in my code have to match the column name in the database? It just feels so.... restrictive.
You use column names in your code?
-
Why does the column name in my code have to match the column name in the database? It just feels so.... restrictive.
Having worked on a system that used some of Jeremy's mapping alternatives I recommend that you NEVER do this, attempting to track through from a field name on a form/class that is different to the column name in the database is a nightmare. You would be just adding complexity for the sake of it, adding multiples to the support cost and the supporting dev will have a wax effigy of you and be sticking needles in it!
Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP
-
Why does the column name in my code have to match the column name in the database? It just feels so.... restrictive.
string MyName => SomeOtherName;
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
-
Having worked on a system that used some of Jeremy's mapping alternatives I recommend that you NEVER do this, attempting to track through from a field name on a form/class that is different to the column name in the database is a nightmare. You would be just adding complexity for the sake of it, adding multiples to the support cost and the supporting dev will have a wax effigy of you and be sticking needles in it!
Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP
Mycroft Holmes wrote:
Having worked on a system that used some of Jeremy's mapping alternatives I recommend that you NEVER do this
I'm trying to collect $20 though...
Jeremy Falcon
-
Having worked on a system that used some of Jeremy's mapping alternatives I recommend that you NEVER do this, attempting to track through from a field name on a form/class that is different to the column name in the database is a nightmare. You would be just adding complexity for the sake of it, adding multiples to the support cost and the supporting dev will have a wax effigy of you and be sticking needles in it!
Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP
I have frequently seen that kind of arguments, and very similar ones, used to justify that end user with a vague idea about the meaning of English terms nevertheless have to accept them, because those are their real names, and using anything else would be confusing and misleading. It would be fascinating if Chinese hardware and software developer switched to a similar approach.
-
I have frequently seen that kind of arguments, and very similar ones, used to justify that end user with a vague idea about the meaning of English terms nevertheless have to accept them, because those are their real names, and using anything else would be confusing and misleading. It would be fascinating if Chinese hardware and software developer switched to a similar approach.
More of a guideline really.
-
Why does the column name in my code have to match the column name in the database? It just feels so.... restrictive.
Don't worry, it's just a temporary thing. Next migration will change the database column names and (dis)order will be restored in universe. ;P
Mircea
-
I have frequently seen that kind of arguments, and very similar ones, used to justify that end user with a vague idea about the meaning of English terms nevertheless have to accept them, because those are their real names, and using anything else would be confusing and misleading. It would be fascinating if Chinese hardware and software developer switched to a similar approach.
-
Having worked on a system that used some of Jeremy's mapping alternatives I recommend that you NEVER do this, attempting to track through from a field name on a form/class that is different to the column name in the database is a nightmare. You would be just adding complexity for the sake of it, adding multiples to the support cost and the supporting dev will have a wax effigy of you and be sticking needles in it!
Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP
What's so hard about COL1, COL2, COL3? /s
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
-
It sort of like calling people by another name, that is not theirs. "Hey Bob, how are you today?" "I'm not Bob, I'm Charlie!" "Who's Charlie? You must mean Debra. Wait right here, I'll get her/she/they/them." :laugh:
-
Why does the column name in my code have to match the column name in the database? It just feels so.... restrictive.
So, I smiled when I read this, thinking of the because it's easy and makes sense answer. But really, this is a deeper question that depends on what language you are using and what the application interaction with the user is. I'm assuming you're comparing local variable names to the DB columns; and not accessing the actual DB object. There are cases where this may not be best practice and maybe a case could be made to argue it is not best practice at all.
-
Why does the column name in my code have to match the column name in the database? It just feels so.... restrictive.
I assume you're not using an ORM? All the ORM's I've used (EF, Linq2SQL, Dapper, etc) have the ability to attribute the model with table and column aliases.
Latest Article:
Create a Digital Ocean Droplet for .NET Core Web API with a real SSL Certificate on a Domain -
Why does the column name in my code have to match the column name in the database? It just feels so.... restrictive.
-
I assume you're not using an ORM? All the ORM's I've used (EF, Linq2SQL, Dapper, etc) have the ability to attribute the model with table and column aliases.
Latest Article:
Create a Digital Ocean Droplet for .NET Core Web API with a real SSL Certificate on a Domain -
What's so hard about COL1, COL2, COL3? /s
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
As punishment for that you get sent to Q&A for a week!
Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP