- 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
TRWTF is that the comment links worked date( strtodate( date( strtodate($TODAY) ) ).
Admin
Hey at least the interns used Y-m-d as internal format, could've been m/d/Y :smiley:
Admin
Is that some custom function? If so, can I has the codes?
Admin
Hasn't the manglement there ever heard the adage "you get what you pay for"?
Admin
Well, those interns, were in their first or last year? I mean, after 4-5 years of a CS course in college you've got to know how to develop software. At least I did know. Not that it was perfect, but at least I knew about SQL injection (even though it was kind of a new fad which I blame on the explosion of PHP usage)
Yeah, I was in college when PHP was the NodeJS of the time.
Admin
not necessarily.
the good ones, sure, but the cargo cult programmers? not so much.
and accademia tend to actually be very forgiving of cargo cult programmers in a way the job market isn't.
Admin
DOES_NOT_COMPUTE
PHP is..... special. yeha i'm being PC here so i'll stick with special.
and NodeJS is awesome!
..... nope. doesn't make sense.
Admin
strtotime
is a PHP core function and takes a more or less well-formed date string likeYYYY-MM-DD HH:MM:SS
and turns it into a UNIX timestamp. Similar tostrptime
, which allows you to specify the format (strtotime
guesses).Admin
My intention wasn't to compare both, but that PHP was cool and new. So much that I drank its Kool-Aid for a few years. I won't make the same mistake with NodeJS unless I'm paid for it.
Fuck it.
Admin
NodeJS is fun, but i wouldn't reach for it for business development.
personal development like @sockbot and @zoidberg sure, business not so much
(and yes this won't summon those yahoos. mention them in a different category to see what they do)
Admin
On the other hand, dates ARE hard, they have always been. For instance, ive wondered for so many years why javascript was so stupid using zero based months... Days were in the 1-31 range, years in 1900+ range but months started with 0.
It was only untill i discovered it mimiced C when studying the c standard library!! .. some nitwits who wrote the C standard library thought it was a good idea to have zero based months :dizzy_face:
Admin
Probably because it was originally used as an index into an array of month names. (Consistency? What's that? :facepalm: )
Admin
there should a try catch block, just incase date-to-string-to-date-to-string again fails.
Admin
Obvious troll is obvious?
Admin
PREACH!
Admin
Is this a @kupfernigk sockpuppet?
Admin
I'm not sure what the title has to do with the article
Admin
Maybe someone showed them the "Iron Triangle": http://en.wikipedia.org/wiki/File:Project-triangle.svg
As you clearly see, "cheap" is the base for the rest.
Admin
First, mandatory xkcd comic covering Universities, exemplifying their typical proportion of usefulness in the real world: [image] Source: http://xkcd.com/773/
Ok, now I'll just review the obvious.
So First: "Against the objections of everyone who did the actual work within the company, management partnered with the local University to have graduate students, most of whom had zero experience outside of academia, develop the new system for internship credit. Unpaid, of course."
Then the Fix: "The next day, he learned in a meeting that the company wouldn't afford the time to fix it. Instead, they would partner with the local University and hire a new team of unpaid interns to fix the system up."
Cue Benjamin Franklin: "The definition of insanity is doing the same thing over and over and expecting different results."
Of course, TRWTF is PHP - almost goes without saying. Paging @Arantor (in case he ever makes it back)...
Admin
I think it was the other way round: someone persuaded the data structure designers to let the days start with 1 instead of 0 like any sane programmer would have done it.
Admin
Mr Franklin lived a few eras before Windows & co., though. Today, expecting very different results from the same actions is totally reasonable.
Admin
I've learned something new today: ASAP stands for "As Sordid As Possible".
(Or does the P stand for Putrid?)
Admin
But it's "Enterprise Ready"!
http://blog.risingstack.com/node-js-is-enterprise-ready/
Admin
just because they say they are doesn't mean they are.
:-P
Admin
A. We don't really tolerate it, unless it's our :heart_eyes: of C#.
Admin
To be fair to PHP (I know, I know),
strtotime
follows GNU's date format specification, so you can't blame PHP for the wackiness that happens there.Admin
If it was a "True Computer Science" program, then there's no requirement that you know anything about professional software development and engineering. A lot of computer science professors consider programming to be beneath them. It's far more important to them that you can write a formal proof of an algorithm for the Towers of Hanoi than it is for you to be able to write the code for it.
Admin
I don't normally post reaction videos or "MFW" type responses, but I felt that this one really did perfectly summarize my response to the representative line.
https://www.youtube.com/watch?v=WH0z00t8OlM
So let me see if I have this straight (I don't frequently use PHP). It takes a date string.... converts that to a UNIX timestamp, which it then converts into a date string, which it then converts into a UNIX timestamp, which it finally converts back into a date string?
I feel like I must have something wrong, because a sane person cannot possibly have conceived such idiocy.
Admin
Ah, you must mean: [image] http://dilbert.com/strip/2004-02-01
Note PHB's expression in the last frame...
Admin
a single sane person couldn't. As Nietzsche said, "Insanity in individuals is rare, but in groups, nations, and epochs, it is the rule."
And a single person could have done that without much insanity by repeated replacing of expressions. (I've done such things myself.)
Admin
I admit I didn't think of this comic strip this time, thanks for reminding me. It is just that clicking on a screenshot of a webpage seldom works at all, but trying to connect to a ressource or using an API function can work differently every time.
Admin
I always wonder if that means it renders timestamps as Stardates…
Admin
Only when printed to the Captain's logs.
Admin
I didn't do "True Computer Science". I was required to write code as well as learn plenty of CS theory.
University is not trade school. You can't trust graduates of any degree to write decent code because it's just not possible to gain the required experience in three years, or even five in an academic setting.
Admin
There is a difference between insanity and persistence. The insane cannot distinguish it. ;-)
Admin
If you work in a crayon reference, we can tie that to that other thread.
Admin
I wish I could say I haven't seen literally this exact line of code at least 10 places in our codebase.
Admin
Well, it's like Linux. It's free if your time worth nothing.
Just see how much time is spent on "try and error" those interns for adequate skill to fix the website.
Admin
TRWTF is that unpaid interns were writing production code. That's illegal in all 50 states; unpaid interns cannot do work for the benefit of their employer. That makes them regular employees, which are owed minimum wage, must be put on a payroll system, have payroll taxes withheld and all that jazz. In the real world, computer science internships are paid positions.
Admin
Plot Twist: WTF takes place in Elbonia.
Admin
Probably "unpaid interns" was part of the frontpagification process, and they were new hires on probation or some such.
Alternatively, given the article, you could make a persuasive case that the work they did didn't in fact benefit their employer in any way.
On the IDGI front, why would unpaid interns be a thing at all if they aren't allowed to do anything that benefits you?
Admin
I know this is a waste of time but I will just explain the thinking, and then you can tell me why it's stupid. Years and days are referred to by numbers, months by numbers and names, and days of the week normally by names only. As days do not alias to names, there is no point to having zero based days. So the days go 1...n because that is a familiar representation. In effect, the name of day zero of the month is "1", and so on. Months on the other hand not only have names but even in the Gregorian calendar world they have many different names in different languages. There will be many arrays of month names. Arrays are nowadays almost always zero based and so if months are numbered 1...12 there is a potential wtf in a programmer failing to remember this and creating a month array which starts at index 0. So because month names are used far more often than month numbers in presentation, it makes more sense to make the internal representation zero based; reduced chance of error. Days of the week are only referred to by number in ERP systems, in my experience. The same array issue arises as with months but the calculation for day of week does not coincide with a month or day border. Therefore the internal representation of day of week may also be zero based, but nobody notices and complains. The potential wtf in ERP is that day zero of the week can be Sunday or Monday depending on implementation. Dates have been around for a long time, and it's inevitable with legacy systems that cannot be updated that there will be issues when they have to work with computers.
Admin
Well, that and the Cantonese language. (OneDay, TwoDay, ThreeDay, FourDay, FiveDay, SixDay, SunDay)
Filed Under: Yeah, fuck Sunday.
Admin
And many other places besides, but that doesn't stop employers from trying to get away with it.
Admin
To be fair some big players are using it for business critical things.
Admin
Plus it doesn't help when you go into employment most places don't have anything resembling a process
Admin
When I went to university, Computer Science was part of the School of Mathematical and Physical Sciences, and it dealt with the theoretical notion of "computation"; you needed to be able to program as far as proof-of-concept, but that was a requisite, not the objective. If you wanted University degrees in the design and development of commercial/industrial grade software, you'd be studying Software engineering at the School of Engineering across the street (BAs and DBAs, please follow the signs to the business school).
What is this obsession among businesses with using CS students for coding gruntwork? I wonder where all the software engineering interns go.
Admin
The aphorism always reminds me of flight BA009. The crew lost count of the number of times they went through the engine start checklist somewhere around the 30th iteration.
Admin
This is where I disagree with you. Even if you're right, numbers are used all the time.
This is "reducing" the error for the library writer instead of the zillions of people who will use it. And who all have numbers associated with the dates. Now they have the extra cognitive burden of figuring out if they have to do math whenever they want to use a month. Because the library developers hate people and are in love with zero based indexing even when it contradicts the real world.
You're welcome.
Admin
I assume it's because most schools, including mine, in the United States don't have Software Engineering degrees. Most colleges consider Computer Science and Software Engineering to be the same thing.