- 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
Don't woory booger, I thought you was funny (for once)
Admin
Although I agree that Case-Sensitivity is a wonderful way of ensuring you know what you are doing, I'm not sure whether calling an Item item would be allowed in a case insensitive language.
If nothing else, I think Case-Sensitivity aids readability, not just because there is a consistency with each instance, but because it allows using standards to distinguish between Constants, variables, methods etc. Although this is still possible in case-insensitive languages, insisting on case ensures that this standard (if used) is used for each occurrence aiding readability and therefore maintainability.
(I'm not a big fan of instance variables mimicking Object names in different case - although I suppose as a parameter to a method it might make sense (eq myObject.equals(Object object); )).
Admin
I'll fix that boolean code!
Just remember one thing: You can't write too much code that compares booleans against true and false.
Admin
You put stack traces in your logs?
Admin
Obviously negative numbers don't count either.
Admin
Python's reliance on line continuation is much aided by the fact that unbalanced (), [], or {} imply line continuation. So, in practice, my multi-line Python code rarely requires a line continuation character.
Admin
The good thing about it is that you'll never have a moron write hoodaticus's code snippet, because Item would be either the class, the instance, or the method, but not all of them. (OTOH, other WTFs are still available to the moron)
There's a way around if you are evil enough, but I can't remember what it is anymore.
Admin
Admin
Admin
I have to agree. The worse VB.NET code gets, the more it looks like C#
Admin
Yor
Admin
Admin
Who is this Jessica in Berlin?
Admin
It looks as if he's simulating a log entry in the terminal window. This code does not log at all. Probably the real actions are logged like "Log-Function $logTime "Applying action X" instead of using Write-Host.
Captcha: aliquam - A question asked Ali
Admin
TRWTF is the tortuous way the random numbers are used?
Admin
Admin
Admin
Admin
It's been build so there's a random (1% per run) chance to call a random (out of 15) phrase.
Captcha: paratus - the missing part when it is shortened to "ap."
Admin
I wonder if John Connor has been destoried properly.
Admin
Admin
I feel like I went into Python with an open mind about the line endings and indentation-sensitivity. I wound up liking not needing semicolons and rather disliking the indentation thing. (IMO it makes editing harder, and I've definitely seen websites complete destroy the meaning of Python code by not preserving the indentation.) I do sometimes wonder if the time I spent with Basic back in the day contributed to my like of the line-ending thing.
Admin
Your syntax is way off though. You can't combine the inc/dec operators like that because they need an lvalue to work on, and after the first one has been applied you don't have an lvalue any more, just the result of that first operation, which is a plain old integer rvalue. So you can't write "x++++" for the same reason that you can't write (e.g. if x == 3 to start with) "4++".
What you were looking for is "return 1 + x--;".
Admin
The inBool one accidentally had a comment line removed:
FTFY.
Admin
Isn't it vital to know which way to destroy things?
private function "destroyEverythingYouTouch" {
}
Admin
There are two things that jump out at me here.
IsNumeric was left out of VB.Net 1.x! What were they thinking? Were they thinking? Probably, not; it is Microsoft after all. They finally put it back in version 2.
This thing has a false positive with a null string ("") and false negatives with -5, 3.4, 2e5, 3e+4, etc. Adapting this general design to allow these, however, would allow invalid strings like "3..4", "-e5", "3+4", etc.
You actually have to break the string into fields (leading, integer, decimal point, fraction, E, exponent) to parse this properly without a built-in function.
Admin
I am stealing this. Thank you.
Admin
The sad thing about the PrBoolFlag function is, it doesn't handle FileNotFound.