- 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
Could be my sarcasm detector was still using a config from lastlastyear. ;-) If so, sorry!
Admin
Agreed. If there's no file system to store a calendar, you do what you gotta do. It's not pretty, but it works and is fairly standard practice.
Admin
Admin
That's something like the optimistic document-naming convention we use when passing edits around:
Specs-final.txt Specs-final-final.txt Specs-final-final-edits.txt Specs-final-final-final.txt Specs-ReallyTrulyfinal-final.txt Specs-ReallyTrulyfinal-final-v2.txt
Admin
go on, you've sparked my interest with that
Admin
hahahahaha
Admin
I liked her in The Matrix.
Admin
The new Epoch and Y2K is now when that variable name gets too long that the compiler can't support it!
CAPTCHA Similis: Each line of that code was similis to the previous...
Admin
Nothing wrong with PHP per se (you can write a WTF in any language), but this is pure butchery.
Admin
The problem here is field names that are insufficiently descriptive. A much better approach would be:
Etc.
Admin
I think Slink's sarcasm detector is only half operational anyway... Dick T.Roll
Admin
Admin
The rest of the code would, of course, remain as is.
Admin
Maybe it's my limited knowledge of the English language, but I found the following gem quite enlightling:
Admin
Which leading guy was that?
Admin
..... stupid spam system...
Admin
Admin
When on any site that i have to input DOB but dont have to register, i always choose the oldest date possible.
verto - Vertical spaghetti-oh's,
Admin
Shovel-ready code
Admin
Here's his profile: http://en.wikipedia.org/wiki/Rickrolling
I would post the link, but Askimet is being a douchebag...
Admin
Ahem,
But thanks for the momentary panic caused by thinking that I may have lost a decade.
Admin
Admin
This is bad (indefensibly bad), but the sad thing? I have seen worse, much worse.
Admin
This is PHP. It should be:
$last_year $last_last_year $lastLastLastYear $last_last_last_last_year $lastLastLastLastLastYear
Admin
That's a lot nicer:
<?php $thisyear=date("Y"); $lastyear=date("Y")-1; $lastlastyear=date("Y")-2; $lastlastlastyear=date("Y")-3; $lastlastlastlastyear=date("Y")-4; $lastlastlastlastlastyear=date("Y")-5; $lastlastlastlastlastlastyear=date("Y")-6; $lastlastlastlastlastlastlastyear=date("Y")-7; $nextnextnextnextnextnextnextyear=date("Y")+7; $nextnextnextnextnextnextyear=date("Y")+6; $nextnextnextnextnextyear=date("Y")+5; $nextnextnextnextyear=date("Y")+4; $nextnextnextyear=date("Y")+3; $nextnextyear=date("Y")+2; $nextyear=date("Y")+1; ?>Much more readable, I say
Admin
And this is why good (or aspiring) developers should avoid small companies like the plague unless it's new, hip startups. Inevitably the existing code will have been written by some hack with no car or knowledge how to properly write software; typically somebody who "knows MS Access" or "worked with Foxpro years ago" and taught themselves VBScript/PHP in a couple of days.
95% of small businesses are career killers.
Addendum (2010-02-17 15:34): meant "career", not car, of course.
Admin
You are welcome, gentlemen.
Admin
Lemmon Curry?
Admin
Why does it matter if he has a car?
Admin
Admin
If you live in a VAN close to the river...
Admin
Woohoo! FirstFirstFirstFirstFirstFirstFirstFirstFirstFirst(...etc...) Post!
Admin
I've seen the lastlastlastlast... style of programming implemented in C and of course LISP.
PHP is great for what it does, but bad Java, C#, etc programmers (or typically just C-wannabe programmers) always complain about it because they fear for their job security. A bad PHP programmer can get things done much faster than a bad <insert other language> programmer.
In the end, good programmers are good at writing programs with C and LISP (and related languages). Additionally, good programmers can handle languages like PHP without doing silly things.
Admin
Here is an improvement:
Admin
Stefan Esser. See the following Register article for more info: http://www.theregister.co.uk/2006/12/21/php_security_scrutinised/
(And the Akismet thing that this site uses sucks donkey balls).
Admin
This is just a shop that paid by the KLOC.
Admin
Meh. The article even says in the first paragraph that the flaws in PHP programs are generally the fault of developers, rather than the language. They list SQl injection, XSS, and file inclusions as the major flaws. That's just dumb developers.
PHP has problems (only just now getting namespaces and late static binding, messy standard function library, etc). But the problems it has don't correlate to the things people blame it for. This developer didn't understand loops. That's not a PHP thing, that's not understanding basic programming. The doofus who wrote this would have implemented it the same in C, Java or Fortran.
Admin
Looks similar to a snippet from an 'internet' company (PHP) I once worked for. In the user control panel of a guestbook service, users could delete 10, 20, 50, 100, 200 or 500 messages at once. It was literally implemented like:
if ($nr == 10) { $q = "DELETE FROM message WHERE UserId=" . $id . " LIMIT 10"; } if ($nr == 20) { $q = "DELETE FROM message WHERE UserId=" . $id . " LIMIT 20"; } if ($nr == 100) { $q = "DELETE FROM message WHERE UserId=" . $id . " LIMIT 100"; }
and so on :-). Actually, I managed to keep working there for almost 2 years...
Admin
FTFY.
Admin
No, no, no, no. You've got it all wrong. This is clearly the way to go:
Not only do the lines earlier in time come first, it's arranged in the only sane way time-related code can be arranged.
Admin
I think that word probeily doesn't mean what you think it means.
Admin
http://thedailywtf.com/Comments/Classic-WTF-The-Network-Batch-File-Virus.aspx?pg=2#297392
Basically moved customer website and database between servers WITHOUT TELLING THE CUSTOMER that were originally Linux/Apache to Windows/IIS Server and did not check if things like .htaccess or version control etc.. would cause any problems.
Obviously as a web hosting company that took over another, the new company only understood windows.
Admin
Methinks there's a typo in the article.
Admin
Exactly what user ever wants to interact with a drop down that's over a foot long? It might surprise most developers that even the saddest luser can often type in the four digits of their birth year (some of them even have it memorized).
Admin
If you want stuff like that, look at Ruby on Rails.
Admin
Admin
By our calculations, we predict global warming will hit...
Two days before the day after tomorrow
</southpark>Admin
This has to be my favourite, it's arranged chronologically AND it looks like an hourglass. It works on so many levels!
Admin
As a user of both PHP and other languages I can say that PHP is a terrible language. There's no coherent design, they can't even decide what kind of language they want it to be. They say they want to be object oriented like Java, but it's done halfway (especially in 4, 5 is better). No standard classes. No multiple inheritance (though arguably that's a good thing)
Then all the examples in the official documentation are procedural, something it's worse even worse at. Seriously do we need 20 some odd functions to manipulate an array? Is it really fun to type yet_another_long_ass_function_name()? Do we have to have low level database drivers, and other third party tools embedded into the language (with no real way of implementing proper security)
Memory management is a mess. References (pointers) don't work right. There are random bugs in minor versions. There are multiple official add-ons to do the same stuff. Global variables for getting website request information (are named parameters too much to ask for?)
There are workarounds for all the problems of course but there's not any good documentation. You have to dig through mountains of forums to find them and the official examples often give bad programming advice. PHP does create a low barrier to entry which is fine, but it throws security and basic programming design out the window and has created an army of horrible developers.
PHP took the worst ideas from Java, Perl and C. Then they blended it together and called a language.
Admin
Mutating an abomination ever further. Truly there is no magic in code, otherwise it would have opened a portal to the lower levels of hell.