Comment On The Tautology Type

Consider the tautology: an unnecessary construct that adds no meaning, context, or understanding and may as not exist. In linguistics, it can come in the form of superfluous modifiers such as adequate enough and true fact. In procedural code, it’s simply wrapping code in an “if (true) {…}” block. But in a database table, representing the tautology can be especially tricky. [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: The Tautology Type

2010-05-10 09:03 • by Ziplodocus (unregistered)
Does this comment exist?

Re: The Tautology Type

2010-05-10 09:03 • by bl@h (unregistered)
CREATE TABLE [CustomerComment] (

[CommentId] INT IDENTITY(1,1) NOT NULL,

... snip ...

[IsComment] BIT NOT NULL
CONSTRAINT [CK_Comments_IsValid]
CHECK ( [IsValid] = 0 )

)

Re: The Tautology Type

2010-05-10 09:11 • by Mean Mr. Mustard (unregistered)
CREATE TABLE [BarberShop] (

... snip ...

[HairOnTheFloor] BIT NOT NULL

)

Re: The Tautology Type

2010-05-10 09:11 • by fjf (unregistered)
That's why the Paradox database went down -- it couldn't represent tautology.

Re: The Tautology Type

2010-05-10 09:12 • by ObiWayneKenobi
Fortunately, John’s has solved this problem


So... did John do this or is there something missing like maybe one of the words "predecessor", "coworker", "team lead" or "boss"?

Re: The Tautology Type

2010-05-10 09:15 • by Josephus (unregistered)
308044 in reply to 308043
ObiWayneKenobi:
Fortunately, John’s has solved this problem


So... did John do this or is there something missing like maybe one of the words "predecessor", "coworker", "team lead" or "boss"?


Fortunately, John’s something has solved this problem by inventing a new SQL data type..


FTFY, at a high level.

Re: The Tautology Type

2010-05-10 09:19 • by fnord (unregistered)
The first rule of the tautology club is the first rule of the tautology club

Re: The Tautology Type

2010-05-10 09:21 • by Knux2 (unregistered)
308046 in reply to 308043
ObiWayneKenobi:
Fortunately, John’s has solved this problem


So... did John do this or is there something missing like maybe one of the words "predecessor", "coworker", "team lead" or "boss"?


Yes.

Re: The Tautology Type

2010-05-10 09:21 • by Alargule (unregistered)
What's a tautology?

Re: The Tautology Type

2010-05-10 09:22 • by Markp
308048 in reply to 308043
ObiWayneKenobi:
Fortunately, John’s has solved this problem


So... did John do this or is there something missing like maybe one of the words "predecessor", "coworker", "team lead" or "boss"?


You've clearly never heard of the famous Saint John's.

Re: The Tautology Type

2010-05-10 09:22 • by @Deprecated (unregistered)
308049 in reply to 308044
Josephus:
ObiWayneKenobi:
Fortunately, John’s has solved this problem


So... did John do this or is there something missing like maybe one of the words "predecessor", "coworker", "team lead" or "boss"?


Fortunately, John’s something has solved this problem by inventing a new SQL data type..


FTFY, at a high level.


I was thinking that John's's legal name is "John's".
Or maybe it's short for Johnas?
Which leaves us to wonder why Johnas posted a WTF that he invented?

Re: The Tautology Type

2010-05-10 09:23 • by A nanny mouse (unregistered)
308050 in reply to 308040
bl@h:
CREATE TABLE [CustomerComment] (

[CommentId] INT IDENTITY(1,1) NOT NULL,

... snip ...

[IsComment] BIT NOT NULL
CONSTRAINT [CK_Comments_IsValid]
CHECK ( [IsValid] = 0 )

)


You forgot adding a unique constraint on CustomerComment.IsComment.

Re: The Tautology Type

2010-05-10 09:25 • by Lastchance
I'm guessing someone got mixed up on the concepts of constraint and default constraint.

Fortunately, John’s has solved this problem...

John's what?

Re: The Tautology Type

2010-05-10 09:30 • by Matt (unregistered)
308052 in reply to 308047
A miserable little pile of secrets.

Re: The Tautology Type

2010-05-10 09:33 • by anon (unregistered)
308053 in reply to 308051
Lastchance:
Fortunately, John’s has solved this problem...

John's what?

I guess someone accidentally John's.

Re: The Tautology Type

2010-05-10 09:36 • by dpm
What's a tautology?
Say 'tautology' again. Say 'tautology' again, I dare you, I double dare you motherfscker, say 'tautology' one more Goddamn time!

Re: The Tautology Type

2010-05-10 09:38 • by operagost
One word tautology: "factoid".

Re: The Tautology Type

2010-05-10 09:39 • by Martin Milan (unregistered)
Erm, actually, you could only implement DoesThisRowNotExist with the given constraint - and IsValidOrNotValid would be impossible, as it would always be false...

Me? Pendantic???

Martin

Re: The Tautology Type

2010-05-10 09:40 • by Remy Porter
CREATE TABLE catch22 (
a INTEGER NOT NULL CONSTRAINT aRule CHECK (a = 1 AND b = 0),
b INTEGER NOT NULL CONSTRAINT bRule CHECK (a = 0 AND b = 1))

Re: The Tautology Type

2010-05-10 09:41 • by lolwtf
308059 in reply to 308047
Today's news: database is poorly designed; sky remains blue.

Alargule:
What's a tautology?
No it isn't.

Re: The Tautology Type

2010-05-10 09:45 • by My Name (unregistered)
308060 in reply to 308045
fnord:
The first rule of the tautology club is the first rule of the tautology club


I am the president of the tautology club, because I am the president of the tautology club.

Re: The Tautology Type

2010-05-10 09:46 • by Ziplodocus (unregistered)
308061 in reply to 308047
Alargule:
What's a tautology?


Tautology: the study of the tension of the string in a dangling object.

captcha: odio - A massive event in which competitors ride Garfield's chum and try to stay on as long as possible, much to the delight of several spectators dressed in ritual 'John' attire.

Re: The Tautology Type

2010-05-10 09:54 • by OMG (unregistered)
308062 in reply to 308061
[quote user="Ziplodocus"][quote user="Alargule"]ritual "John's" attire.[/quote]

FTFY

Re: The Tautology Type

2010-05-10 09:55 • by runfaraway (unregistered)
308063 in reply to 308047
Alargule:
What's a tautology?

http://en.wikipedia.org/wiki/Tautology_%28logic%29

"In logic, a tautology is a formula which is true in every possible interpretation."

Re: The Tautology Type

2010-05-10 09:56 • by toth
308064 in reply to 308058
Remy Porter:
CREATE TABLE catch22 (
a INTEGER NOT NULL CONSTRAINT aRule CHECK (a = 1 AND b = 0),
b INTEGER NOT NULL CONSTRAINT bRule CHECK (a = 0 AND b = 1))


And thus the evil robots were blown up and the Earth was saved.

Re: The Tautology Type

2010-05-10 09:58 • by opp (unregistered)
Adequate enough isn't tautology. It just implies that your aim is mediocrity (or the worst possible implementation that still works).

Re: The Tautology Type

2010-05-10 09:59 • by toth
308066 in reply to 308062
OMG:
Ziplodocus:
Alargule:
ritual "John's" attire.


FTFY


FTFY

Re: The Tautology Type

2010-05-10 10:05 • by PITA (unregistered)
WHAT?! No embedded comment? FAIL!!

Re: The Tautology Type

2010-05-10 10:16 • by Kef Schecter (unregistered)
308070 in reply to 308047
Alargule:
What's a tautology?


A tautology.

Re: The Tautology Type

2010-05-10 10:21 • by Lorne Kates
That's so you can fulfill the order:


string sql = "insert into CustomerOrder (OrderQty, OrderAmt, IsFulfilled) VALUES(" + intOrderQty + ", " + dblOrderAmt + ", " + (blnFulfilled ? 1 : 0) + ")";

Try
{
DBUtility.ExecNonQuery(sql);
}
catch (SqlException ex)
{
sql = sql = "insert into FulfilledCustomerOrder (OrderQty, OrderAmt, IsFulfilled) VALUES(" + intOrderQty + ", " + dblOrderAmt + ", " + (blnFulfilled ? 1 : 0) + ")";

DBUtility.ExecNonQuery(sql);

// So Visual Studios won't complain about unused variable
ex.HelpLink = "";
}

Re: The Tautology Type

2010-05-10 10:23 • by Phlip
This isn't a WTF, it's just a standard sanity check. They're just encoding the business rule that customers' orders should never be fulfilled. Now, thanks to that forward-thinking, should a bug in the code ever accidentally fulfil a customer's order, it'll raise an error condition.

That's just robust coding.

Re: The Tautology Type

2010-05-10 10:24 • by Robert (unregistered)
Wow, no one has linked the xkcd yet. Shocking!
Granted, someone referenced it, but still...

Re: The Tautology Type

2010-05-10 10:28 • by Ziplodocus (unregistered)
308074 in reply to 308065
opp:
Adequate enough isn't tautology. It just implies that your aim is mediocrity (or the worst possible implementation that still works).


Is there a spectrum of adequacy? I would say adequate is an absolute. As good as necessary. I would, however argue that enough is the tautologic word in the case of Adequate Enough

Re: The Tautology Type

2010-05-10 10:34 • by gdjfkghl (unregistered)
308075 in reply to 308045
The second rule is the same as first, except that it is second.

Re: The Tautology Type

2010-05-10 10:40 • by Faxmachinen
In most languages, an "if (true) {}" block creates a new scope. Hardly a tautology.

Re: The Tautology Type

2010-05-10 10:44 • by DCRoss
308077 in reply to 308047
Alargule:
What's a tautology?

No, what is on second base.

Re: The Tautology Type

2010-05-10 10:47 • by Bob the builder (unregistered)
Ah, to be paid by the line.

Re: The Tautology Type

2010-05-10 10:49 • by nonpartisan
308079 in reply to 308076
Faxmachinen:
In most languages, an "if (true) {}" block creates a new scope. Hardly a tautology.


It is when creating the new code block sans the "if (true)" creates the same scope.

Re: The Tautology Type

2010-05-10 10:50 • by Mike (unregistered)
308080 in reply to 308071
Of all the things for me to reply to:

Lorne Kates:
That's so you can fulfill the order:


string sql = "insert into CustomerOrder (OrderQty, OrderAmt, IsFulfilled) VALUES(" + intOrderQty + ", " + dblOrderAmt + ", " + (blnFulfilled ? 1 : 0) + ")";

Try
{
DBUtility.ExecNonQuery(sql);
}
catch (SqlException)
{
sql = sql = "insert into FulfilledCustomerOrder (OrderQty, OrderAmt, IsFulfilled) VALUES(" + intOrderQty + ", " + dblOrderAmt + ", " + (blnFulfilled ? 1 : 0) + ")";

DBUtility.ExecNonQuery(sql);

// So Visual Studios won't complain about unused variable
//ex.HelpLink = "";
}



FTFY.

Re: The Tautology Type

2010-05-10 11:03 • by drachenstern
308081 in reply to 308058
Remy Porter:
CREATE TABLE catch22 (
a INTEGER NOT NULL CONSTRAINT aRule CHECK (a = 1 AND b = 0),
b INTEGER NOT NULL CONSTRAINT bRule CHECK (a = 0 AND b = 1))
So on the terms I'm too chickenshit to try this, what happens to SQL Server if you try to implement this?

Re: The Tautology Type

2010-05-10 11:06 • by illtiz (unregistered)
308082 in reply to 308057
Martin Milan:
Erm, actually, I could only implement DoesThisRowNotExist with the given constraint - and IsValidOrNotValid would be impossible, as it would always be false...

FTFY

Re: The Tautology Type

2010-05-10 11:10 • by ObiWayneKenobi
308083 in reply to 308052
Matt:
A miserable little pile of secrets.


But enough talk! Have at you! Mwa-ha-ha! *teleport*

The real translation of that is SO much better...

Re: The Tautology Type

2010-05-10 11:10 • by drachenstern
308084 in reply to 308068
PITA:
WHAT?! No embedded comment? FAIL!!
Since databases are known to not have filesystems, it's obvious no embedded comparison was necessary.












if you feel the need to seriously compete with this for trollishness, then you're really whooshed aren't you?

Re: The Tautology Type

2010-05-10 11:13 • by drachenstern
308085 in reply to 308066
toth:
OMG:
Ziplodocus:
Alargule:
ritual "John's" attire.
FTFY
FTFTFYFY
FTFTFTFYFYFY

Re: The Tautology Type

2010-05-10 11:14 • by Abdiel
308086 in reply to 308081
drachenstern:
Remy Porter:
CREATE TABLE catch22 (
a INTEGER NOT NULL CONSTRAINT aRule CHECK (a = 1 AND b = 0),
b INTEGER NOT NULL CONSTRAINT bRule CHECK (a = 0 AND b = 1))
So on the terms I'm too chickenshit to try this, what happens to SQL Server if you try to implement this?


I don't see anything wrong, or even paradoxical, about this code. You simply state that in every row inserted, a must equal one and b must equal zero. Also, a must equal zero and b must equal one. Hence, whatever you try to insert in the table, you will only get a constraint violation error.

I do not see any (at least no obvious) way to implement the paradox Remy Porter probably had in mind in procedural code.

Re: The Tautology Type

2010-05-10 11:18 • by Faxmachinen
308087 in reply to 308079
nonpartisan:
It is when creating the new code block sans the "if (true)" creates the same scope.

Good point. I didn't actually know C++ allows you to do that either.

Re: The Tautology Type

2010-05-10 11:19 • by Zylon
How embarrassing... I was about to post in defense of the if(true) construct, but realized I was actually thinking of while(true). Oops!

Re: The Tautology Type

2010-05-10 11:19 • by Chucara (unregistered)
308089 in reply to 308072
Phlip:
This isn't a WTF, it's just a standard sanity check. They're just encoding the business rule that customers' orders should never be fulfilled. Now, thanks to that forward-thinking, should a bug in the code ever accidentally fulfil a customer's order, it'll raise an error condition.

That's just robust coding.

I agree. Just create a HasError column like this and set to to 1 whenever there is a problem with the row. PRESTO! Error free programming!

Re: The Tautology Type

2010-05-10 11:21 • by Crash Magnet (unregistered)
You wouldn't have won if we'd beaten you.
You can observe a lot by just watching.
It's like deja-vu, all over again.
It ain't over till it's over.
A nickel ain't worth a dime anymore.
Congratulations. I knew the record would stand until it was broken.
- Yogi Berra

Re: The Tautology Type

2010-05-10 11:29 • by anon (unregistered)
That WTF was very unique.
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment