- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
"No comments have been added yet."
i feel special
Admin
Boing! I hate akismet!
Admin
I don't know what's worse... the fact that it's called total length in SQFT (square feet), or that it's using VARCHAR(50).
Admin
You seem to have a fundamental misunderstanding, first post must contain 'frist'
Admin
What Sal didn't tell you was that there was another element in the table:
See, it's actually very clever...
Admin
TWTF not using Metric
Admin
pet hate of mine, people getting units dimensionally wrong. especially when people quote energy usage in KW/h . That one, especially, makes me cry on the inside.
Admin
predecessor or colleague?
Admin
Damn, to make long enough to even figure out what SQFT meant. Silly imperial measures....
Admin
Should obviously be Total_Length_NEWTON_SQ_SEC_PER_KILO NVARCHAR(50) NOT NULL
Admin
Length... in square feet? 50 characters? Alphabetic characters allowed? I'm sure there's a "future proofing" joke here somewhere but damn, what sort of bizarre future is this guy proofing for?
Admin
Without context here, this is stretching to justify it, but there's a miniscule chance it might be something like a precalculated string for simplified subsequent reporting (i.e. "The computed length of feet-squared = nnn")...
Of course, it's more likely exactly as it seems at first glance...
Admin
Surely TRWTF is the NOT NULL constraint.
Admin
Tell this retard to do us all a favor and never touch an RDBMS again.
Admin
Charitably, maybe it describes objects that are uniformly one foot wide like classroom rulers or rolls of paper towels, so the length in feet is the same numeral as the area in square feet.
Admin
Admin
I almost bet if you looked at the values in that column you'd see: '14.236m^2' '12 acres' '1,567 square inches' ...
Admin
I was thinking something similar.
Brilliantly, his code copes with all your examples even without the uniform 1ft restriction because he can specify 2PI4ftSQUARED or 6x12x1inches
Admin
Not only is it a VARCHAR its an N varchar, so it can hold all unicode variants of.... a length or a square of feet or something
Admin
That is nothing.
Near the end of my big-corporate working life, I once found a database field called "Money". A VARCHAR, of course. Depending on the record, it would hold:
That field is just an example; the whole "database" was built with the same prowess. It was an Access database, of course. The 3-month work product of a "database expert". He was called (no joke) "Scooby Doo" by his project manager. On his face.
It took me 4 days to understand the requirements and build an equivalent excel-based solution using 4 sheets.
Well, it wasn't really equivalent; my solution actually worked.
Not much later, I was "let go" from that company. Scooby Doo is still there. Apparently he's someone important's nephew. A group of Project Managers have agreed to rotate him from project to project, so the cost is shared among all.
Admin
All your units of measurement are belong to us.
Admin
thanks for explaining the WTF for us. <--- ASKIMET, THIS IS NOT SPAM
Admin
Admin
"Special" as in "school", yes.
Admin
Oh wait, you do that in metric, too.
Admin
Maybe in some n-dimensional space (n > 4), what we think of as a two-dimensional measure gets folded down to a single dimension?
OK, probably not.
On a related note, the chimps that originally built our database defined household number as verchar throughout the database. Then built a function used when inserting a new record which determines the new value by taking the max currently in the table, converting it to int and adding one.
Sigh.
Admin
Or varchar. Ugh.
Admin
My favorite SQL field definition:
some_flag VARCHAR2(1) NOT NULL;
for a boolean field in an MS Access -> Oracle migration project.
As with most Microsoft products true false is zero and true is -1 (signed integer, all bits set) we ended up with '0' for false and '-' for true after the original Access data was imported.
(Do i need to mention that the person who did the schema design and import was the only certified MCSE on the project? ;)
Admin
What makes you so sure that "Total_Length_SQFT" entries are not in meters (or m^2)?
Admin
At a guess, this might be a business practice issue. My immediate thought would be that it could have started out as a sort of GIRTH+LENGTH measurement such as that used by the USPS to determine if a package is mailable and later morphed into an area -- assuming that it actually is an area and not some other hard to label function of object dimensions.
Admin
This lousy predecessor lead to R.A. Salvatore quitting his job and to become a lousy book author -> Dilbert principle fullfilled.
Admin
Oh you silly people. SQFT is clearly "squirrel-feet". It's a length of 0.75644 inches, based on the original King John Imperial Red Squirrel (originally an Argentinian import, but died out in the 17th century). An important measure in the manufacture of shlocks.
Admin
This reminds me of a database where dates were stored as three TEXT fields. Yes, TEXT (would probably be called CLOB in Oracle), not even VARCHAR.
I shall not be rude to that contractor, because recently (and this is over 10 years later) he did some work for us, and it was actually pretty good. For me to think that something is pretty good, it has to be pretty good indeed. People do learn.
Admin
I also like that. There needs to be a facebook styled "like" button so we can all properly appreciate peoples slight witticisms...you know...because facebook hasn't quite reached every corner of the internet yet.
Admin
Admin
TRWTF is that he meant to write:
Total_Length_RTSQFT NVARCHAR(50) NOT NULL
right? So that it's clear that he can store real, imaginary and complex lengths in his nvarchar for the root of square feet?
Admin
You mean KW/h as opposed to KWh? Does this mean I've found an ally in my annoyance at the notation "24/7"? We have customers paying over the odds for 24/7 support. I'd love to take them up on it and support them for roughly 3.4 hours a week. Wednesday afternoons, preferably - I do like a long weekend.
Admin
How many square feet is a square mile?
How many square meters is a square kilometer?
I think that settles it.
Admin
reminds me of a table in a DB at an investment bank I used to work for with a column "day_of_week" containing values 1 .. 31. askign a colleague, he said:"ah well, we unfortunately named in inappropriately."
Admin
Clearly because they are measured in hertz-seconds
Admin
If this is beyond your grasp, there is little hope for you.
Admin
My guess is that you screwed up their database and especially their way of working. That means your clients obviously used to use such a field like a free field where they put things as they liked. It might be correct that referential integrity should be maintained and so on. But sometimes you would like to add a contact to your database without knowing for which company the person works. The same way probably another field in the record indicated how to interpret the value. Sales people can be like that. You probably know the "it used to work like that before", or don't you yet? "Before I could enter << London >> in order to reserve the money for a ticket whatever the cost will be." Draughting a statistical report from these data is, of course, impossible. But that's probably not needed either.
Admin
Of course you need to use VARCHAR(50), otherwise how you gonna put in values like "about 25 feet" or "10 feet, give or take a couple of inches".
PS: fuck you Akismet. Blah, blah, blah, not spam you moron.
Admin
There were two consultants involved: 1 to create the database with varchar as the type (requirement at creation time?). The second one to "fix" the NewValue() problem.
Admin
Admin
Alex, you left out the part where Salvatore dug a little further and discovered that yes, the column also represents length sometimes.
Admin
Admin
Admin
I shudder to think of how CS would be integrated with FaceBook ...
Admin
Obviously, he is protecting against SQL injections. Everybody knows that you can't escape a numeric values, and under no circumstances can you enclose it it qoutes.