- Feature Articles
- CodeSOD
-
Error'd
- Most Recent Articles
- Office Politics
- Secret Horror
- Not Impossible
- Monkeys
- Killing Time
- Hypersensitive
- Infallabella
- Doubled Daniel
- 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
Zreoth!
Admin
I really need a t-shirt that just says TRWTF===PHP
Admin
The thinking capacity this developer demonstrated while fixing this bug is in line with the age zero, and emptiness is what's in his head.
Admin
It's probably not the frist time we see this kind of "bug fixing": When a conditional, loop, abort trap or comparison leads to the expected result ALMOST every time, but not EVERY time, the obvious solution is to add an inversion of the conditional, increase or decrease a loop counter's end value by 1, add another exception (to be ignored), or change the direction of a comparison. It is also possible to combine those methods for more advanced "bug fixing", typically used by experensed programers and certified consultends like Paula.
Admin
Maybe the original devs were from East Asia, where certain countries there start age counting at age 1 from the day of birth.
Admin
if ( ! frist(comment) || frist(comment)) then frist
??
Admin
To be or not to be, that is the question...
Admin
Presumably the correct fix is something like this:
Admin
Steve, you're no fun Or is that 0 fun?
or NULL fun?
Admin
Surely the correct fix is not to use PHP?
Admin
ISTM the correct fix is to actually have requirements.
Admin
"child ages are zero-indexed"
No, they are not. Age is a count (of years), not an index.
Admin
The real WTF here is PHP and all languages that have insane concepts like "falsy".
Admin
Oldest programming WTF ever
Admin
At Jeremyp's Nurseries (affiliated with the Hilbert Hotel chain) the rooms are numbered from zero and each child is placed in the room whose number corresponds to their age in years. So, yes, actually, age is an index.
Admin
It's not alone. I hit a BMI calculator that insisted I couldn't be 0 inches tall. Thus I had to shrink from 6'0" to 5'12".
Admin
I was rather surprised that the introduction of booleans to Python at one point was a PEP, and not very popular at that, because "integers already do that".
I wonder where along the line the mindset changed enough to allow the introduction of
pathlib
, because after all, strings already do that.Admin
PHP has a handy function for validating integers:
Admin
But where's the fun in that? Languages like PHP or JavaScript which have wild interpretations of trueiness and falsiness are great, and are perfect candidates for WAT slideshows filled with rubber duckies.
Admin
The real WTF here is that the language's "empty" function returns true for things that aren't empty.
Admin
Ran into a nice example today for the "falsy/truthy" issue, and why Python really still is not explicit enough about it.
Always truthy. Also, given that
path.exists
might as well be a property invoking a getter, this is easy to mix up in Python.So really, a nice example why Python should accept only booleans as booleans... But that would severely break backwards compatibility.
Python4 anyone? :)