• cut thread (unregistered) in reply to fennec
    Comment held for moderation.
  • Auschunky (unregistered)

    I'm currently writing an application that must display a list of items (like a catalogue). The items can live online to be downloaded and displayed, or retrieved from the client PC. The user can choose to view either online items, offline items or both. Perhaps this code is for something similar.

  • element[0] (cs)

    The only possible reason i could think of for this are

    The user has subscribed for some content which has both an online and offline component and this checks whether to provide them with both, that would also explain why it's in a stored proc.

    If this is the case it's still a bit wftey but kind of understandable

  • Jman (unregistered)

    The 'users' of this application are actually spin-1/2 particles, and thus need the possibility of being in a linear superposition of two states. Come on guys, basic quantum mechanics.

  • Spinner (unregistered) in reply to Slacker
    Slacker:
    Welcome to the world of quantum computing, where a system can be online and offline at the same time. Until you measure it that is.

    ...at which point the entangled system goes into the opposite state. Bugger!

  • Samah (cs)

    The real WTF is T-SQL's stored procedure syntax. I mean, who needs semicolons when the DB can just guess the start and end of your queries!

  • Michael (unregistered) in reply to emurphy
    Comment held for moderation.
  • Anonymous (unregistered) in reply to Samah

    It's not a guess. The end (and thus the start) of each statement is precisely defined. The only reason to require semi-colons would be that you like typing.

  • Anonymous (unregistered) in reply to Trash
    Comment held for moderation.
  • Daef (unregistered)

    but online and offline are undefined in some cases!!

    Captha: smile ;)

  • Dougal Matthews (unregistered)

    The guy is just a retart. face it.

  • FridayUK (unregistered)

    To use a clichéd pharse around here, "The real WTF is..." is the discussion in defence of this outrageous wackyness (or grudging grossly understated acknowledgments along the lines of "well it is a bit wacky...").

    I see no compelling argument that this any but a complete "WTF?!".

    Sadly, I see madness like this fairly frequently (I can think of a similar very specific case of DB failover handling I've come across not too long ago) and find it depressing that people stick up for this sort of nonsense, let alone try and justify it.

    I'm entirely understanding of the sort of icky code and dubious kludges we all do from time to time, but the ingenious stupidity of the person who thought this up terrifies me.

    The poster who brought up the 'Gloves!' article was spot on.

    I might print this off and show this to canidates during interviews to see if I can get a feel for their revulsion to this sort of thing.

  • Daef (unregistered) in reply to gwenhwyfaer

    i think you even cannot compare to null - you have to use the IS statement

    (WHERE col IS NULL // WHERE NOT col IS NULL instead of WHERE col = NULL // WHERE col != NULL)

    Captcha: dreadlocks - funny... i have problems with deadlocks in here...

    who messed the r into my captha!?

  • Anonymous (unregistered)

    the real WTF is his failure to handle the "isVeryOnline" or "isVeryOffline" status.

  • Dave (unregistered)

    This is a clear example of Childhood Logic. Children do crazy-dumb things everyday that make perfect sense to them, and yet they don't know why they did it in the first place!

  • Dave (unregistered)

    Also, I want to see the rest of the code, especially the part that sets OnlineOffline to 'Both'. Only then can I determine if this code is truly WTF-Worthy or if it indeed makes sense from a larger perspective....or 'Both'!

  • Incen (unregistered) in reply to DDT
    Comment held for moderation.
  • coditza (unregistered)

    You CAN have a system both online and offline. For example Yahoo Messenger. You have a setting there that allows you to apear offline to everyone else, while you are actually online. Then you can stare for ages at the buddy list wondering why isn't anyone saying something to you. The varchar was used for extensibility. Maybe a module that would be developed latter will require a stronger Yes, like someone sugested before. However, I wonder what would happen if you finish with a value for that thing like: "YYYYYYNYYYY". This sounds like that computer nightmare.

    Captcha is "waffles" and you can see from my post I'm not hungry. Or sleepy.

  • bebo (unregistered) in reply to coditza
    coditza:
    You CAN have a system both online and offline. For example Yahoo Messenger. You have a setting there that allows you to apear offline to everyone else, while you are actually online. Then you can stare for ages at the buddy list wondering why isn't anyone saying something to you. The varchar was used for extensibility. Maybe a module that would be developed latter will require a stronger Yes, like someone sugested before. However, I wonder what would happen if you finish with a value for that thing like: "YYYYYYNYYYY". This sounds like that computer nightmare.

    Captcha is "waffles" and you can see from my post I'm not hungry. Or sleepy.

  • S (unregistered)

    Actually I know one place where this "both offline and online" stuff would've worked. Some years ago I worked for a company that tried to do messaging crap with huge money pouring in after they made some slideshows about projections and stuff that never realized. There the person could get their messages delivered online (directly to their messaging app), offline (to the offline store, e.g. IMAP mailbox) or both. So in that case it would be reasonable to see a state "both" for offline and online.

    You're just too narrow minded to think that it's always a question of someone's online status... :)

  • GrouchyAdmin (unregistered) in reply to denz
    denz:
    "Both" is obviously the authors implementation of the third boolean value...

    Precisely what I thought. I mean, what the... even if he wanted to do something dumbtarded, there's a reason for SET (Which I still feel would be inappropriate), however, if this was used to test, say, if a user has access to a feature both in 'online' and 'offline' mode..

    It's still fucking wrong, though.

Leave a comment on “Online Offline”

Log In or post as a guest

Replying to comment #:

« Return to Article