- 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
Comment On A Comment of Comments
Admin
the following CSS-Rule makes it quite hard to read
.comment { /*... border-top: 1px solid #eee; */ }
(don't want a github account to submit a bug report there)
Admin
Er, giggity, I think.
Admin
I am sure most of us know this SO thread, but for the few uninitialized: there's tons of really funny comments at https://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered
Admin
My favorite part...
//echo $workingDays; return $workingDays + 1; Because i can relate so much... "Ok, i made a mistake somewhere on my calculation, and i'm one unit shorter than i must... I should find where this error is... Oh F... it, let's add 1 and hope it work every time."
Admin
I spotted a bug.
date("Y-m-d 00:00:00", strtotime($startDate));
Should be:
date("Y-m-d 12:00:00", strtotime($startDate));
Admin
WHY WOULD YOU DO THAT?!?!?!?!
Admin
Yeah, that was the point where I just started staring in slack-jawed bamboozlement.
Admin
If you follow that to the SO page, there's a link to the original guy who wrote one of the things, and he talks about a line of code that he thought he could delete, but instead served as a lesson that languages with property setters and getters should die in a fire, along with the moron(s) who invented the idea.
foo.x = foo.x;
Apparently, deleting this line of code broke lots of stuff...
Admin
I have countless more . . .
Admin
Duh, because ... ahem ... management wants it done that way.
Admin
Comment by "genius" prima donna programmer when told to comment all of his code:
/**
Admin
It's the first answer on https://stackoverflow.com/questions/336127/calculate-business-days
Admin
I lost it at:
// Subtract the holidays crickets
I wonder how long he spent trying to extend that ball of unmanageable cruft before giving up entirely.
It might not be as fast as a few formulae, but it's dirt simple to generate and count up a list of dates with holidays and other shutdowns included.
Admin
Admin
Pretty similar, looks like they used it as inspiration sometime before May 20, 2010.
https://stackoverflow.com/revisions/336175/2
The community has since "fixed" some of the bugs, but it still looks like a dog's breakfast.
Admin
The first one isn't funny, unless you are a bro and don't want any women on your team, ever.
Admin
My most memorable comment:
The really sad part of that was it was probably true. Management had dictated a 3 layer structure in the data, which the code had implemented. And then management changed their "mind" and said it's a four layer structure, but you have to keep the three layers and encode the fourth into the top layer of ids. So all the variables (and presumably comments) used the wrong names for what they were in the structure.
Admin
And why in the world would you think that guys aren't able to give head?
Admin
I completely understand. The screaming rage with which people who crack rude jokes are excoriated never ceases to amaze me. Such encounters are likely to bolster up the perception of the stereotype (thoroughly misguided, of course) of the "humourless feminist". I hasten to reassure readers that of course it is an obvious truism that of course there is no such thing as a humourless feminist, of course, that completely goes without saying.
Admin
Thanks. TIL what I thought to be females cracking worse sex jokes than nearly all males I know are actually pre-homone-treatment pre-surgery transgenders.
Admin
I'm guessing if you were to ask the original coder, they would reply in all sincerity: "Because we need to calculate things like 8.5 days, so we have to use floating point".
Admin
//The total number of days between the two dates. We compute the no. of seconds and divide it to 606024 //We add one to inlude both dates in the interval.
Mmm... What about daylight savings time; leap seconds; leap year? And that's just for starters.
Admin
coment my pp in ur vajayay #owned