• Bill C. (unregistered)

    EndDate precedes StartDate if Hillary catches me.

  • (cs) in reply to Anonymous') OR 1=1; --
    Anonymous') OR 1=1; --:
    The end date is just missing the year and the month (and separators):

    1328033230-0500

    becomes

    YYYY-MM-13-28 03:32:30 -0500

    Yes, it's a WTF (why are you taking substrings of your dates and then stuffing them back into dates?). But the fluffy story is even more of a WTF.

    No, TRWTF is that you apparently think there is some month that has a day numbered "13-28". Of course, perhaps you meant the 28th day of the 13th month, but that doesn't really get rid of the WTF.

  • (cs) in reply to jpa
    jpa:
    The beginning of the article reminds me of some scifi story, perhaps one by Asimov. I can't pinpoint which one, though.

    More like Galactic patrol By E.E. 'Doc' Smith

  • (cs)

    Unfortunately the setup for this article is very poor. It's a very klunky introduction to what is essentially "Help us get the date format consistent in our database because we use it every day and still don't get SQL". It really needed a different narrative angle, although the prose was well-written. I was utterly confused by what the hell they were trying to say.

    I would much rather see a return of Best Of The Sidebar. Take inspiration from those posts and write articles based on them, preferably with a more consistent narrative than this one.

    (Sorry to the OP, I'm trying to be constructive.)

  • QJo (unregistered) in reply to eVil
    eVil:
    Clement:
    I'm sensing a completely unmerited amount of nerd rage in these comments. I quite enjoyed this WTF. Sure I've read better, but it certainly was not bad.

    I don't think anyone is raging... I think they are calmly, and rationally, expressing a negative opinion of an article that they didn't think was even up to the low standards that we have come to expect from this site.

    So go back to reading your well-thumbed and probably by now rather soggy copy of 50 Shades of Grey.

  • QJo (unregistered) in reply to faoileag
    faoileag:
    QJo:
    Okay, for the hard of thinking, hard of understanding and hard of learning:

    WTF1: the end date and start date not both being date/time fields. The only reason for the end time to be held in the db as a long is laziness. You can do it for the start date, you can do it for the end date, bozobrain. Now make your code sophisticated enough for this to happen. If you find yourself unable so to do, then I have a pile of CVs here of people who are more than keen enough to take your place.

    WTF2: the end date is before the start date. Clearly something has gone wrong in the business logic, but that will probably take some time to debug, especially if this is an isolated example of an old data set. It would be nice if you were to establish the source of the problem, ubnless of course it's a current bug in the application, in which case I would like you to be on the case immediately.

    WTF3: It is impossible to tell at a glance that the end date precedes the start date without processing the date-as-a-long into a date-as-a-date (or the other way about, but that's just silly). The fact that nobody has realised that the suffering incurred by enduring the tedium of performing the operation means they're just not very good programmers. A good programmer is far too lazy to let something like that sit around in the database for any length of time.

    Ok, for the "I know precisely the circumstances under which todays wtf came into existence" and "I am right and you are wrong, fullstop" sort of people:

    WTF1: That the StartDate and EndDate do not have the same type is pretty obvious. But misleading names are so common in the world of programming (ref: TDWTF) that without knowledge of the code that makes use of that db, I simply consider this a very minor wtf.

    WTF2: EndDate before StartDate is a problem? So you know for sure that these two Dates refer to the same event? That EndDate is only legal if it is greater than StartDate? If you simply assume that this is the case, then your logic is fundamentally flawed. Yes, better naming would make things clearer, but without knowledge of the problem domain, EndDate and StartDate could well be shorthand for "EndDateOfLastSeason" and "StartDateOfNextSeason".

    WTF3: If you think that every programmer can just fire up a mysql console and use it to debug his application, than your experience is a bit limited. Not everyone has access to the database server to say the least. If you don't use the console than the limitations caused by the differing datatypes do not apply. Same goes for the suggested database refactoring: once the codebase depending on your existing schema is large enough, you don't do it.

    Finally: have you ever selected a DateTime and a long together on a mysql console? On mine, I would see a nice Date with the time and a very long number. What I would not see is "Date(1328033230-0500)" because that is a string.

    WTF 1: Yes I know it's "obvious" that start date and end date don't have the same type. In a consistently designed and maintained application, that is unacceptable. It should have been caught at code review. Storing a date/time in any format but a date/time is suboptimal. If you want to continue to argue with me, then you can do it from someone else's department, I'm not having silly little boys with attitudes like yours working on my team.

    WTF2: If they don't refer to the same event, then the fact that they are not named according to the events they are referring to is also completely unacceptable. Unless they come from separate tables, and that within the context of those tables it is obvious, then again, absolutely no good at all.

    WTF3: I expect any programmer working on MySQL to be at least competent enough to have learned how to do obvious stuff like handle date/time processing. I perceive a bit of a training opportunity here. You have a week to take advantage of it, on pain of being promoted to a customer.

    Now get out of my office and stop wasting any more of my time and the company resources.

  • Taemyr (unregistered) in reply to QJo
    QJo:
    WTF 1: Yes I know it's "obvious" that start date and end date don't have the same type. In a consistently designed and maintained application, that is unacceptable. It should have been caught at code review. Storing a date/time in any format but a date/time is suboptimal. If you want to continue to argue with me, then you can do it from someone else's department, I'm not having silly little boys with attitudes like yours working on my team.

    WTF2: If they don't refer to the same event, then the fact that they are not named according to the events they are referring to is also completely unacceptable. Unless they come from separate tables, and that within the context of those tables it is obvious, then again, absolutely no good at all.

    WTF3: I expect any programmer working on MySQL to be at least competent enough to have learned how to do obvious stuff like handle date/time processing. I perceive a bit of a training opportunity here. You have a week to take advantage of it, on pain of being promoted to a customer.

    Now get out of my office and stop wasting any more of my time and the company resources.

    I do in fact have some questions before I leave.

    In general; Why do you think that "Date(1328033230-0500)" is an example of a date-as-a-long? And why do you think anyone who claims this could be seen as authorative on anything in IT.

    To point 1; Why do both you and faoileag assume that StartDate and EndDate have different types? To me it seems far more likely that both fields are strings.

    To point 2 and 3; Why do you assume that any single programmer has enough clout to impose a project to identify and correct all the cases where the fields are used in a project so that the database schema can be corrected? Or more severely, why do you think that the changing the database without first identifying the places where this field is used is a sane decision?

  • (cs) in reply to Zebsy
    Zebsy:
    A good WTF is like a good joke - if you have to explain it then it's not good! I was left confused by this one
    If you are confused on what's wrong with storing a data as a VARCHAR that has to be send through an eval to become an actual date you have no business in IT.

    TRWTF is the stupid story constructed around this GEM of a CodeSOD / representative line!

  • faoileag (unregistered) in reply to Taemyr
    Taemyr:
    To point 1; Why do both you and faoileag assume that StartDate and EndDate have different types? To me it seems far more likely that both fields are strings
    Because sometimes I fail to spot all possible eventualities! :-)

    Of course you are right and both fields could be of a string type. If I recall correctly some database wtfs published here, this might even be highly likely :-)

  • faoileag (unregistered) in reply to QJo
    QJo:
    WTF 1: Yes I know it's "obvious" that start date and end date don't have the same type. In a consistently designed and maintained application, that is unacceptable. It should have been caught at code review.
    You haven't worked in many companies, have you? Especially not in ones where deadlines must be met no matter what the cost in quality? Code reviews are the first thing to go if everybody is working 110% just to make the code work in time.
    QJo:
    If you want to continue to argue with me, then you can do it from someone else's department, I'm not having silly little boys with attitudes like yours working on my team.
    Well, I wish you luck that you can stay in that little heaven of yours until you retire. Otherwise you could find out that your superiors might express the attitude that if you don't deliver on time you will get fired, "because we do not have the budget for such fancy things as code reviews".
    QJo:
    WTF2: If they don't refer to the same event, then the fact that they are not named according to the events they are referring to is also completely unacceptable.
    You really haven't seen much legacy code, have you? But of course whereever you work you have all the time you need, so you can just go to your boss and say: "these two database columns are not well named. I need to change that, so the new feature our anchor customer requests will have to wait."
    QJo:
    and stop wasting any more of my time and the company resources.
    Nice remark. Could be used by your superiors in your next company if you complain to them about not well named database columns. Or the absence of code reviews.

    Should it ever come to that: welcome to the real world!

  • (cs)

    ". . . You really haven't seen much legacy code, have you?" True that. Remember the good old days...like now in some cases...where you get 8 characters to name your columns? Because you know (26 + 10)^8 unique names is way more than anyone will ever need, right? Until you try to make those 8 characters make some kind of sense. Especially in a flat-file with 100 or so fields.

  • Qvazar (unregistered)

    There's another wtf hiding here. That date string is in the MS json sterilization format (which is a whole other WTF). In a MySQL database.

  • eVil (unregistered) in reply to QJo
    QJo:
    So go back to reading your well-thumbed and probably by now rather soggy copy of 50 Shades of Grey

    I wasn't even complaining... I'm here enjoying the avalanche of other peoples complaints because they are, at least, entertaining.

  • neminem (unregistered) in reply to QJo
    QJo:
    So go back to reading your well-thumbed and probably by now rather soggy copy of 50 Shades of Grey.
    What the shark? His (entirely accurate) complaint was that the writing of this article was crap, and your response was that he should go back to re-reading a book whose writing was *also* crap? Why would you think someone complaining about crappy writing would be a fanboy (or even have read once) an entire *novel* of crappy writing? If you'd used one of those authors that literary snobs love to love and normal people love to make fun of, like Hemingway or James Joyce or some crap, then it would actually have been a vaguely-funny comment, as well as apt.

    Crap, I just fed a troll, didn't I. >.>

  • TortoiseWrath (unregistered)

    This is why I don't read TDWTF very often anymore.

  • Akismet (unregistered) in reply to faoileag
    faoileag:
    QJo:
    WTF 1: Yes I know it's "obvious" that start date and end date don't have the same type. In a consistently designed and maintained application, that is unacceptable. It should have been caught at code review.
    You haven't worked in many companies, have you? Especially not in ones where deadlines must be met no matter what the cost in quality? Code reviews are the first thing to go if everybody is working 110% just to make the code work in time.
    Obviously all of us are victims of this kind of WTF, but at least let's describe it properly:

    Code reviews are the first thing to go if everybody is working 110% just to make the code fail in time. TRWTF.

  • faoileag (unregistered) in reply to Akismet
    Akismet:
    faoileag:
    Code reviews are the first thing to go if everybody is working 110% just to make the code work in time.
    Code reviews are the first thing to go if everybody is working 110% just to make the code fail in time. TRWTF.
    No, fail is so... complete. Like, perfect. Like, "it fails all the time".

    "Work" on the other hand can mean: "it didn't crash when presented to the customer because we didn't let him fiddle with it at will".

    In the absence of unit tests, "it works" is an extremely flexible description! ;-)

  • Kirby Wallace (unregistered)

    I prefer the old days of TDWTF, when a simple expression of the problem/WTF was sufficient, and we could immediately begin riffing it in the comments.

    Seems now, every one of them has to be whipped up into a sort of mini-novella with a lot of excess verbiage.

  • Axel (unregistered)

    Jan 31, 2012. That's the end date. Might save someone having to look it up, as I had to.

Leave a comment on “A Rip in Time”

Log In or post as a guest

Replying to comment #:

« Return to Article