- 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
Yeah, but what if you can't find any Waldorfs anywhere? Then you only got Apples en Mayonnaise.
Admin
Everyone knows it should have been 'App.' instead of 'Apples'.
Admin
Admin
Another WTF is that this code is not international. Apple is only the 0th month in the United States. Almost every where else Orange is the frist month. Except for some Asian countries that use those little ears of corn.
Admin
[quote user="nobulate"]This code is designed for something.. bigger. Any noob can just call:
Your code blows up in production when it encounters an unrecognized value. I see this way too often. Error checking FTW.
Admin
Oh my God! A quintuple-rainbow!
What can it mean????
eros: a feeling of intense arousal at seeing multiples of an object normally observed singly.
Admin
I think we're just out of Waldorfs.
Admin
Best comment I've ever read on TDWTF
Admin
You are so right, and after hours of trying to figure out why $months[1] didn't return "Jan.", he popped in "Apples", et voila!
captcha: causa - produces effectas, three causas equal one trifecta
Admin
Hahaha!
This guy doesn't know about the "elseif" keyword in PHP.
Admin
Have you tried the Ritz salad? It's apples, grapefruit and potatoes in mayonnaise.
Admin
Ohhh I see the Navajo blanket pattern.....or it's half DNA for Fortran++
captcha esse - This code appears to be a poorly written esse
Admin
Admin
Nope, don't think I ever tried that.
Don't think I ever will, either.
Admin
I have had it with these monther-functing apples on this monther-functing site!
Admin
Didn't they (or others for them) just rename existing months? Quintilis and Sextilis, IIRC. (i.e. 5th and 6th, with September/October/November/December, 7th/8th/9th/10th, following. They weren't really creative with their month names. N.B. the Roman new year started in March.)
Speaking of Romans, I'm pretty sure Biggus Dickus or Naughtius Maximus could have written better code than this. And the Romans didn't even have 0, which made it tough for them to indicate successful termination of their C programs.
Admin
Calm down, it's Joomla. That code will fit right in.
Admin
That's why it's called "a period"! It repeats itself, there has to be one every month...Otherwise it wouldn't be a period anymore.
So to fix your question accordingly: Why the hell doesn't "Apples" have a period?
aptent: someone good at building temporary canvas housings
Admin
In fact, "monther" is a completely valid function name. The author is just using the Reverse Hungarian notation, in which "monther" stands for a function that does something with months, "e"choes its output and is "r"eentrant
nimis: misspelled name of an US Navy Fleet Admiral
Admin
Oh, I see the problem! He left out
Add that and the code will be good.
Admin
And if it's okay to appreviate September to 4 letters, why bother to abbreviate June and July at all?
Admin
I recently had to modify an existing system, and as I reviewed the code, I was incredibly impressed at how the authors managed to get this thing to mostly work through shear diligence and hard work, despite an obvious total lack of any skill or talent.
Admin
I know posting "working" code isn't funny, but eh.
The above function will, obviously, coerce any value into a valid one. Coercion not your style? You want to watch the world burn? Look no further:
Admin
At least he used "else if" instead of "if". He's coding for performance! How do you like them apples?
Admin
The apples are pregnant. Apparently they were the same apples with the brief cameo in "American Pie".
Admin
Admin
Admin
By the time you get to the level of indentation that
is on, the air gets thinner, hence the need for a clairvoyant mountain sherpa.Admin
In the spirit of fairness, let's remember that the file is called "learn". It's clearly written by someone who has little/no experience as a programmer and who managed to cobble code that actually did what was expected.
It's worth a good laugh, but let's not be too mean, we don't know the circumstances of this learner.
Admin
Not a WTF:
Thirty days hath September, Apples, June, and November; All the rest have thirty-one, Save February, with twenty-eight days clear, And twenty-nine each leap year.
Admin
I award you one Internet, good sir. Well met.
Admin
Admin
Admin
Because then he'd need 5 characters (for "June." and "July.") -- look at "May.".
This WTF is entertaining on so many levels...
Admin
Easy to know how this brilliant mind created that...
In PHP documentation there's a lot of examples like that: $arrayName = array("apples", "bananas", "oranges", "pears"); http://br2.php.net/manual/en/function.array.php
He just copy/paste the example and "adapted" it. Clever guy hahaha :)
Admin
Yes, because that is what's wrong with this code.
Admin
Any once-a-year food should be none-a-year; if it had any redeeming culinary capacity you'd eat it more often. I vote to outlaw those voluntarily-once-a-year-things, they're just masochism. File together with: inlaws for the holidays.
Admin
Maybe that kind of food (once-a-year) is really good, but it's so caloric that if you eat more than one time a year you may have a heart-attack (like Christmas feast).
But we're talking 'bout a salad... so I assume that is really bad and deserve a vote to outlaw.
Admin
TAN alert!
OTAH, it's a really boring Monday...holidays are specific times when you can indulge: I'm thinking candy (Easter), hot dogs (July 4th), carb-load (Thanksgiving and Christmas). Some people think you should indulge everyday and some think you should never indulge. Others think that it's ok to celebrate special occasions. I'm thinking the never-indulgers are the healthiest and the special-occasion-indulgers are the happiest.
Admin
Admin
(The recipe I use has over 5000 calories in a 9x13 inch pan, and it's a "once-every-several-years" food around here. We never did the calculations on how much fat is in it.)
Admin
You guys are knocking him for not using PHP's native functions, but the "Apples" month should give you a clue. This guy was tasked with working with the new iCalendar, a product from Apple that adds an extra month you can use to play with your iPods, iPhones, and iPads.
Admin
My name is Kevin S. I work on websites for a living.
I don't remember submitting this article, but I swear to God that this is my life. I must have blacked out and send this in and forgotten about it.
Admin
Admin
Thirty days hath September, April, June, and no wonder. All the rest eat peanut butter, Except Grandma, and she drives a Buick.
(That's the way we learned it when I was a kid.)
Admin
[quote user="The Nerve"][quote user="nobulate"]This code is designed for something.. bigger. Any noob can just call:
Your code blows up in production when it encounters an unrecognized value. I see this way too often. Error checking FTW.[/quote]
PHP issues a notice and continues normally. Production sites don't set error reporting thresholds that low, so there is A) no blowing up and B) no error to check.
It's lazy coding, but it's not actually wrong.
Admin
Every Java programmer knows the 0th month is January.
And the 13th month is Undecimber, and is numbered 12.
(And no, I'm not making this up. Check the docs for java.util.Calendar if you don't believe me.)
Admin
Technically, copying and pasting ANY piece of code multiple times and zooming out will create a pattern.
Admin
Although Gregorian calendars don't use it, apparently lunar calendars do.
Admin
I'm still trying to figure out why the dev didn't just subtract a one from the input and not put in "apples" in the first place. The if-then is just... sad.
CAPTCHA: saepius A pious sapient?