|
The advantage of it (once it's all working) is that you can set the columns that use it as a foreign key so your DB can't hold invalid values. Worth a bit of "ickiness"?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
Duncan Edwards Jones wrote: Feels a bit "icky".
That is a fairly concise definition of a code smell right there, at least when talking about code. Just saying.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
We all know the answer to this one:
It depends.
cheers
Chris Maunder
|
|
|
|
|
That's your answer for everything
Tom
|
|
|
|
|
You are wrong.
That is liquid nitrogen
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Not 42?
Tom
|
|
|
|
|
That's the answer for a concrete question, not the answer for all questions
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Duncan Edwards Jones wrote: I realise this is dangerously close to a coding question Not at all. It's a technical discussion which is encouraged in the Lounge and is greatly appreciated.
I have done it before but mostly to make writing the code a little bit easier, not having to remember what the exact values were that I was looking up. Sometimes it's easier to let Intellisense do the dirty work.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Ofcourse: what is if something is changing? Mostly adding or changing a type.
At least you need some robust error handling with a clear message what to do.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
|
Saved me the effort of finding my article.
|
|
|
|
|
|
I do that often enough, and I don't like it, but it's necessary.
I often use have a method that verifies that the DB and enum match. Better than nothing, especially while developing, and the enum can change. If I don't do that, I put in a SCREAMING COMMENT that the enum and DB lookup table must match.
Marc
|
|
|
|
|
No, but you're looking at it backward.
You should have such a table in your database, so you can have referential integrity and such.
Then you may define an enumerated type that matches it, to serve the same function in your code.
Having a technique to generate that enumerated type from the database (before or at compile time) is a rather simple task.
I did it my way:
GenOmatic[^]
|
|
|
|
|
Hi All,
So we have Brexeted but I have the feeling this is not done by a long shot because Scotland that has an elected body both came down on the stay side. Now the important WTF am I doing I type a couple of nicely worded Emails and sent them to the opposite companies so ' Dear Company A' was sent to company B and 'Dear Company B' was sent to company A!
|
|
|
|
|
Maybe, just maybe, you should take a little break from the pub?
|
|
|
|
|
glennPattonInThePUB wrote: Scotland and Wales that have elected bodies both came down on the stay side. The results I saw showed that Scotland and Northern Ireland voted Remain, but Wales voted Leave.
|
|
|
|
|
Yup, I have no idea what I am typing today Wales is a leaver, Northern Ireland stoopid!
|
|
|
|
|
glennPattonInThePUB wrote: Scotland that has an elected body both came down on the stay side
Scot and Land are two countries?
|
|
|
|
|
I need to start drinking earlier!
|
|
|
|
|
You could argue that certainly. I've often wondered whether an independent Scotland would result in a campaign for independent Gaelland and Scotland before long.
I am not a number. I am a ... no, wait!
|
|
|
|
|
I wouldn't worry. a) they probably won't read your email and b) if they do, they probably won't notice.
Marc
|
|
|
|
|
Considering the events of last night in the UK
Racing one around could be blissful ? (9)
We can’t stop here, this is bat country - Hunter S Thompson RIP
|
|
|
|
|
Ignorance - love the hint - very, very apt!
|
|
|
|