- 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
Let's party like it's 99/99!
Admin
I guess being a PHP god doesn't make him a design god, or db god, or any other type of god.
King of such a small domain.
Admin
The gods must be crazy
Admin
This seems like the work of Hephaestus.
Admin
Once, I went to the Amiga fair in Cologne, Germany, around 1990. A friend of mine was demonstrating a product of his, and I showed him a Mandelbrot set generator that didn't include such niceties as boundary crawl, or zooming for that matter, but it drew the standard set in 40 seconds on a stock Amiga 500, in 320x256 resolution, using hand-optimised assembly code. And on an Amiga with a faster processor, it obviously ran much faster.
Armin boasted that he could make it run twice as fast.
A little later he came to ask how to actually draw a Mandelbrot set.
Admin
Admin
This year/month representation also doesn't handle dates prior to 2000 (or later than 2099), which is quite unforgivable after the panic caused by Y2K...
Admin
Once, I was the King of Spain.
Admin
Admin
Or perhaps if someone is conceited enough to call themself a god they should realise there is ALWAYS something you dont know how to do in any area of IT. No one knows everything.
Or sometimes some people seem to know nothing.....
Admin
I am an inexperienced programmer, an so I use the CodeSODs to identify the problems with the code and write something better (someone normally posts a better solution somewhere in the comments).
I would do it with:
<personal_achievement> nearly first </personal_achievement>
Admin
It does. What do you think 5 in varchar(5) is for? This guy was thinking over millenium!
Admin
TRWTF is the base-12 calendar, obviously. We should move to the decimal system.
Admin
The column is a VARCHAR(5) so it can store the 4 characters of the year/month, plus the null terminator. Duhuh!
Admin
FTFY
Admin
That's the date format on the Gibson, isn't it.
Admin
Is there really a difference when you are selecting 2 of 2 fields? Is it so you don't have to look up somewhere else the fields you are returning? Other reasons?
Admin
Somebody remind me of the psychological phenomenon that stupid people are too stupid to know how stupid they are, while wiser people are clever enough to know they're not really all that clever. Therefore people who think they're as clever as "god" must be the stupidest people in the world.
Admin
If you're going to go around calling yourself 'a god', or indeed 'god', you had really better make sure in advance, that you are actually any good at the something.
At the very least you had best not totally suck at what you're trying to be god of.
Thats "calling yourself 'god' 101".
Admin
Also, if you do 'select *' and then get rows 1 and 2, and somebody modifies the table structure and inserts a field between what used to be rows 1 and 2, your application ceases functioning. (Pre-empting another common mistake here.)
'select *' is a sign of laziness. And whilst certain kinds of laziness are good assets for a developer (spending a week to write a program that will save you 10 minutes on each new project that you start), other kinds of laziness are liabilities (doing something the easy way because you couldn't be bothered to do it the proper way, like copy-and-paste code).
Admin
$last_three_yearmonths[] = (string) $i;
Wait, what? Array index much?
Admin
I thought the WTF was the SQL Injection vector.
Admin
I love these people that just blindly repeat the claim that "SELECT *" is somehow evil, without any kind of understanding of whether is actually is, or why it could be.
Admin
Admin
Obviously, his name was "Gregory Oliver Davis" (or something like that) and they named everything with initials.
Admin
this isn't really much of a wtf. I mean, the code simply won't work. Any reasonable test of this will fail. Side bar has seen much better wtf's recently.
Admin
Could have been called Godfrey.
Then there was the place where our username used to be our first name (or diminutive) concatenated with the first letter or our surname. Yes, Chris T had an attitude problem.
Admin
Reminds me a bit of a versioning system I designed when working for a now-defunct big box chain. We'd use a character representing the quarter of the year (A-Z starting in a specific quarter of a specific year), and two digits to represent the day in the 99-day quarter of the year (because some programmer's years aren't metric, but at least they have a nice round number of days [400]). The lead developer pointed out it not only wasn't Y2k compatible, it would blow up in 1997. "Yeah,", I replied, "but we both know we won't be working here for anything like that amount of time..."
Admin
What do you mean, "works only about 10 months of the year"?!!
Clearly, this is meant to get the last 3 months of the most recent full year, and it works just fine when the most recent full year is from February 1 to February 1.
If you were "god" then you would understand "god's" plan.
Admin
Tom Kyte would approve. People storing typed data as a string is one of his bug bears.
Admin
The dude manipulated time and space to create new months. Clearly he is god of everything, and was being modest by claiming to only be the god of PHP.
Admin
One argument is it brings back more data than you need. Which is frequently true, but not usually relevant. What's more relevant is that it will often result in poor usage of indexes.
Admin
Thats fine, thats an easy way to 'pop' an element on the end of a php array.
Admin
You're thinking of the Dunning-Kruger Effect https://secure.wikimedia.org/wikipedia/en/wiki/Dunning%E2%80%93Kruger_effect
Admin
Admin
Why don't we actually move to a hexadecimal system?
Admin
Unrelatedly the punctuation in this WTF was horrible
Admin
Just imagine the kind of trouble you're going to get if you drop a printout of this from an airplane into an ITT Tech campus.
Admin
I thought maybe it was GOD Over Djinn.
Admin
Not only is it potentially a performance killer, it's also just bad form from a 'clean code' perspective. Select only what columns you will use (including columns used in group by, where, having, etc) there's really no good reason I can see not to.
Admin
Admin
I still am the King of Spain. I am also the Queen
CAPTCHA acsi --- ver close to ascii
Admin
Picoseconds since the Big Bang is probably more appropriate. If we need to know how many that is, just ask god. He's in the next cubicle.
Admin
Admin
Admin
I can't tell if you're trolling or being sincere, so if it's the former- good work. I'm biting on the latter.
Why are we hitting the database for something as simple as a month? There are very few reasons why we need to hit the database for this.
Why are we storing months in a database table in the first place? Months are available in the database, and they are available for a multitude of regions and languages. For example, in SQL you'd say something like this SELECT DATENAME(MONTH, GETDATE()). This would display 'AUGUST' for me, for someone in a different country it would display the month in their respective language.
Definitely should be DATE instead of varchar or DATETIME
Admin
[quote user="Matt Westwood"][quote user="hoodaticus"]Why don't we actually move to a hexadecimal system? [/quote]For that matter, why don't we move to a unary date system and count the hash marks since Genesis Chapter 1?[/quote] Picoseconds since the Big Bang is probably more appropriate. If we need to know how many that is, just ask god. He's in the next cubicle.[/quote] The only cubicle next to me is empty. Does this mean I can eat at Mooby's with no worries?
Admin
Admin
Not sure what happened to my initial quote here... Doh.
Admin
Now I vacuum the turf at Skydome. Err... Rogers Center.