- 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
:wtf: You're right. Words are hard. Numbers, apparently, are also hard. You seem to have used either the wrong word or the wrong number.
Admin
Good catch
Admin
Ironically, the correct number cannot be represented numerically, and instead must be represented by a character, which sort of makes it a word, too. So it's doubly hard.
Admin
That doesn't sound right to me. The way I heard it, it came from recording the ship's speeds into a book. To measure the speed, sailors threw a rope with a log tied to the end into the water (counting knots in the rope, etc.). Then they wrote the measurements into the "log book".
Admin
Pff, debating
urbannaval myths is not the point of this site.Admin
Admin
I think you may have oversold this a little; all you need is an
@
before the keyword to make it a variableAdmin
Don't do that. Please. The English language has plenty of synonyms so that you don't need to abuse interop features to have your variable named exactly as you want.
Admin
FTFY.
also :wtf: why do you need to do special effort to avoid keywords?
you can have more than one word in your variable name
@class
works, sure, as doesaClass
, orsession
ortheClass
or_class
or even justClass
!Admin
Unfortunately, MS has already forced the use of that in Razor views if you want to be able to set classes dynamically
Admin
Admin
Or use c++...
Admin
I wonder if
#define
had been invented by someone that loved debugging ...But "class" allows for only 31 additional keywords by using different cases. Maybe we could use the methods described in https://what.thedailywtf.com/t/how-to-write-be/54375 to get a "class" only programming language?
(It would be much easier to just create yet another variant of Whitespace, though.)
Admin
I'd much rather process an
@event
than I would anoccurance
or ahappening
.Admin
The story completely glossed over the :wtf: in the original xxLog function. Why are they calling something in SQL to calculate a logarithm?
Admin
Besides trying to be enterprisey™, you mean?
I suppose if you are a Hammer ...
Ooops, I meant "if all you have is a hammer (of the other kind)" of course ...
Admin
Nothing is off topic here....
##Nothing!
Admin
Thought about mentioning that, but if they're writing a scripting language, it might have been a reasonable tradeoff. I don't know enough of the context to really judge there.
Admin
Ouch.
This article reminds me of my biggest WTF that has ever reached production.
I overloaded the log() function to do error logging (who wants to write errorlog(string) when log(string) would work just as well right. All was well, as my application (data logging and hardware control) did not do any real math until I had to do some post test processing of the data and imported my utility module....
The biggest problem was that the return value of my log() function was either 0 or 1 depending on success or failure to write to the log file and those results are perfectly valid numeric values for calculations as well so it took me surprisingly long to figure out what ws wrong as the argument to log() vas suficiently close to 2.7 that a result of 1 was not too far off. DOH
Admin
http://cdn.meme.am/instances/500x/42994652.jpg
Admin
Uh, that's not valid C++ code ... or perhaps I missed the joke.
Admin
I like your corporate jargon!
"reasonable tradeoff" :smile: "enough of the context" :smile:
With your explanations, TDWTF could be easily converted to "Excellent Practices Bible" site.
Admin
As a mathematician, log(x) is for unnatural logarithms - if you don't specify the base, it's base 10. Natural log is written ln(x) (if you're being really precise and formal. Usually we can't be bothered with the brackets unless the argument is complicated) and pronounced 'lon'. We're not writing three whole letters for the logarithm we use most often.
Admin
It's the log files! The exponent is out there…
Admin
WTTETFY
Also, :hanzo:'d
Admin
Is that a reference?
Admin
Or in my case, the argument was is in the log files..... :-)
Admin
Some of this reminds me of PL/1 and keyword abuse. In that language, one could have variables the same as keywords, and the compiler (hopefully) could figure it out given the context. With a bunch of defaults, one could write a program using only the words READ and WRITE and get a job done (I don't have a reference). It took a while for the human to understand what was going on, and then you would really tear your hair out, but it did work in the end. Of course it wasn't recommended, but that never stopped someone.
Somehow the PL/1 compiler did its best and made LOTS of assumptions on just what you "intended" to do and then spewed out errors/warnings to let you know. Probably a WTF in its own right, but I'll save that for another day.
Admin
You are correct and the author of this article made that etymology up. I've checked several etymology sources, and they agree both with you and with the way stuff was written in various 18th-19th-century sailing novels I've read.
And really, FoxBlackCinder, since when don't we jump all over authors for the tiniest error in their submission? :stuck_out_tongue_closed_eyes:
Admin
If only. The base used for "log(x)" varies wildly by language, sadly.
Admin
If you write write right, you write write with a 'w'. It's not right to write right when you mean write. All right?
Admin
That's an evil thing to do to the next person who has to maintain that code.
Maybe not as evil as that, though. Just name your class "StudentClass" or something like that and don't abuse InterOp.
Admin
Let me consult...(pause for drama)...the Log Tables!
http://intmstat.com/blog/2010/05/log-table2.jpg
Admin
Wooden tables? Logs are made of wood, aren't they?
Admin
Only if they weigh the same as a duck.
Admin
I hate "new" now my code is all filled with
neu
.Admin
Admin
Reading this aloud sounds to me like a new dance hit.
Admin
TRWTF is spelling out Intelligence when the abbreviation 'Intel' would work just fine. ;-)
Admin
Or just shadowing
int
. It's not like you'd need those in a game about dice anyway.Edit: You don't even need to shadow it: http://play.golang.org/p/PH4rSBSou0
Admin
Strangely, this reminds me of: "War does not decide who is Right. War decides who is Left."
Filed under: Yes, I know the bad jokes thread is :arrow_backward::arrow_down_small::arrow_forward:
Admin
Admin
Just because a wooden ship sinks doesn't mean another piece of wood sitting on the deck and not secured wouldn't float. The question is, how do you make sure it would float up if the ship sank but also make sure it wouldn't get swept overboard or kill someone in a storm that didn't sink the ship?
http://boards.straightdope.com/sdmb/showthread.php?t=381393
Admin
Admin
The tag-line of the X-Files series was "The truth is out there".
Admin
And so do ducks. So as long as the log weighs the same as a duck, it will float even when the ship doesn't.
[EDIT: :hanzo:'d, should have scrolled up first.]
Admin
Intel usually means "Information" though, rather than "A character's academic smarts".
If you're not going to do
Str Dex Con Int Wis Cha
, it makes more sense to doStrength, Dexterity, Constitution, Intelligence, Wisdom, Charisma
.Admin
Everyone knows that Charisma doesn't matter.
Admin
Str Dext Const Intel Wisdm Char
is what I used in my teenage years before I even used computers on a regular basis, never mind programming. Pencil and Paper.But then, while some choose-your-own-adventure books instruct you choose a number from the random number table at the back of the book while not looking, I simply rolled a D10 instead.
Good memories.
Guess I'm just weird.
Admin
What about SAN?