• L' Eomot Inversé (3/26/2013)


    Hugo Kornelis (3/26/2013)


    I think you're reading a bit too much into the code used to create some sample data, Tom. I suspect ROn used this method to eaily visualize which rows belong together, but not with any other intention.

    Oh, I don't for a moment imagine that Ron was intentionally breaking 1NF, or that he even noticed he was doing. And of course it's completely irrelevant to the question - any old table will do as long as it has a foreign key. That's why I said it was a good question apart from the strange wording of the answer options.

    But I've often been hit by junionr developers seeing something and thinking "Oh, that's neat, perhaps I can use that" when the something they saw was absolutely terrible practice but acceptable in a particular context because it wasn't relevant there. So I try to avoid doing such things even when they are not relevant to thetask at hand, and believe that everyone should do so. Especially in contexts where they are likely to be seen by a lot of not particularly experienced people.

    I agree in principle but can we expect everyone who writes a QotD to check their question for best practice in the coding? Might people be deterred from posing a QotD if they're worried about getting the coding practice picked to pieces? Having said that, was there any need for a mixture of @val1 and @val2 to be used in the setting of the first column. Would the question have achieved the same result if some arithmetic on just @val2 was used?