| « Prev | Page 1 | Page 2 | Page 3 | Next » |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:01
•
by
Frist?
(unregistered)
|
|
Frist, frist, frist, etc.
|
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:02
•
by
Yep
(unregistered)
|
|
Yep, I was waiting for that
|
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:03
•
by
1234
(unregistered)
|
|
What happens if we need $lastlastlastlastlastlastlastlastyear or
$lastlastlastlastlastlastlastlastlastyear or even $lastlastlastlastlastlastlastlastlastlastyear luckily we will never need $lastlastlastlastlastlastlastlastlastlastlastyear ... |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:03
•
by
highphilosopher
(unregistered)
|
|
What's so bad with this? Next thing you know people will be complaining about my use of $TheDayBeforeTheFirstMondayOfThisMonthLastYear.
|
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:04
•
by
Severity One
|
|
Whenever I see such a lot of code simply copied, I wonder, have these people ever heard of loops?
Whenever I see such a lot of code simply copied, I wonder, have these people ever heard of loops? Whenever I see such a lot of code simply copied, I wonder, have these people ever heard of loops? Whenever I see such a lot of code simply copied, I wonder, have these people ever heard of loops? |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:05
•
by
me
(unregistered)
|
|
what are the odds that the probeility of the month being frebruary?
|
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:10
•
by
Techpaul
(unregistered)
|
Bessy says "Content Blocked" |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:13
•
by
Richard T. Roll
(unregistered)
|
|
Totally not a wtf. This is just an optimization so that you can access the previous years by numerical value, like this:
$which = ""; I've used this a lot in my programming career and I know some might disagree but tbh it's just a different approach. |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:14
•
by
Techpaul
(unregistered)
|
|
Having seen websites with PHP code where three groups of modules were 99.9% identical, except for the WHERE clause of what to serach the database for, nothing on websites amazes me.
Don't even get me on the inability of some hosting companies, to understand the differences between even Windows and Linux. Anyway "that was so lastlastlastlastlastyear". |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:15
•
by
Tim
(unregistered)
|
|
ah, a good old fashioned 100% bad code indefensible WTF (and using PHP into the bargain)
this is what we like to see |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:17
•
by
Dascandy
(unregistered)
|
|
Imagine the code for the date-of-birth field...
|
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:17
•
by
akatherder
|
|
Optimize!
|
|
Geez, don't they realize the numberline goes in two directions?
|
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:23
•
by
Appellles
(unregistered)
|
|
Shoemaker, stick to your $last.
|
|
I wonder what would happen if they set error_reporting to report E_NOTICE as well...
|
|
I decided to improve the code to a degree:
You see, you grab a random equation, and apply it randomly across the board, and you get the same results, while having crazy code. Job Security. |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:26
•
by
me_again
(unregistered)
|
+1 captcha: enim -> Eminems little brother |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:30
•
by
Anon
(unregistered)
|
|
Could have been worse:
$year2008 = 2008; $year2007 = 2007; $year2006 = 2006; etc. I mean, this is php after all. |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:35
•
by
jonsjava
|
PHP isn't a bad scripting language. It's just that 99% of the PHP coders give the rest of us a bad name. I use it for server-side coding (both windows/linux) when I need a script to do something, and I don't have the time to build a real app. Handy little system in a pinch. |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:35
•
by
operagost
|
The frobbitz on the jim slam blempglorf bandersnatch! |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:37
•
by
Salami
|
Or $year = 2010; $yearlast = 2009; $yearlastlast = 2008; etc with an optional comment saying "TO DO: Changes years on Jan 1st" |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:43
•
by
M.C.
(unregistered)
|
|
LastYearToInfinity...
|
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:45
•
by
Jared
(unregistered)
|
|
That'll fail on a leap year. ;-)
|
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:48
•
by
grizz
(unregistered)
|
I've used cannibalism a lot in my food-procuring career and I know some might disagree but tbh it's just a different approach. Sometimes "bad" really is bad, not just different. |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:49
•
by
raluth
(unregistered)
|
|
Pah; this story is just so date("Y")-1
|
|
Well, on embedded systems like Bessy, it's much more efficient to unroll the loop. Paula Bean taught me that.
|
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:54
•
by
APK
(unregistered)
|
|
TRWTF is the lack of underscores. It should be "$last_last_last_last_year" which is much more readable and maintainable.
|
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 09:55
•
by
Voodoo Coder
|
|
What REALLY surprises me is that PHP doesn't have a built-in method for this year minus seven.
I suppose it'll be in the next release... |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 10:01
•
by
Bob
(unregistered)
|
|
Applause!
|
|
Last week I wrote code to display a drop-down-field for birthday, with the last 120 years (1890-2010). That was done with a few (~5 or so) lines of code.
Would be interesting to see this in your notation. Great code example! |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 10:04
•
by
silent d
(unregistered)
|
|
I want to hear more about the OP's previous job, where business analysts wrote requirements to implement bugs.
|
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 10:05
•
by
Bob
(unregistered)
|
|
strtotime("-7 years") is pretty close.
|
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 10:08
•
by
Dirk
(unregistered)
|
|
Last post.
|
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 10:08
•
by
Dirk
(unregistered)
|
|
Last last post.
|
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 10:09
•
by
Dirk
(unregistered)
|
|
OK I'll stop now.
|
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 10:11
•
by
Slink
(unregistered)
|
You were writing that as a reply to a post made by Richard T.Roll... Sarcasm detector offline? ;) Or am I the one missing that sarcasm tag in your reply? |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 10:21
•
by
Manniakk
(unregistered)
|
|
$TheDayBeforeTheFirstMondayOfThisMonthLastYear = "Sunday";
sooo simple :D |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 10:25
•
by
NightDweller
|
Whenever i look at stats like "99% of php code is crap" i wonder - is it that 99% of the PHP programmers are crap, or that all php programmer are crappy 99% of the time? |
|
ThisYear - 7 is not allowed as 7 is a magic number.
LastLastLastLastLastLastLastYear is much better. |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 10:29
•
by
kftt
(unregistered)
|
smarch |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 10:58
•
by
java.lang.Chris;
|
Yes it is. PHP is poorly designed and inconsistent. The most popular implementation is also a mess and unlikely to get better - one of the leading guys working on improving the stability and security of the code quit in disgust at the unwillingness of Zend to accept changes. |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 11:05
•
by
1234
(unregistered)
|
Thank you. |
|
And did you have any 120 years old visitors on that site?
I'm curious. |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 11:07
•
by
aBase
(unregistered)
|
Yeah, they're the ones who go around saying things like "99% of..." |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 11:09
•
by
MetalPig
|
Isn't she on the same network as Rachael Array? |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 11:10
•
by
Dascandy
(unregistered)
|
|
That's a comment that's so rational yet so wrong that my stomach contracted. I can imagine that actually being brought forward by somebody.
That somebody wouldn't be my colleague for long, one way or another. |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 11:11
•
by
drive-by proofreader
(unregistered)
|
|
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 11:16
•
by
Enterprise Architect
(unregistered)
|
Aaah… the wonders of open source. http://qdb.us/301603 To Akismet: Who spams by posting links to QDB? |
Re: Last, Last, Last, Last, Last, Last, Last Year
2010-02-17 11:26
•
by
forgottenlord
(unregistered)
|
"Wouldn't be a little more 'casual'? But then....how is the code casual if it wouldn't be more casual? </pedantic-bastard> |
|
Those names are going to get totally unwieldy after a while, because of their length. The programmer should have gone with:
$thisyear=date("Y");
|
| « Prev | Page 1 | Page 2 | Page 3 | Next » |