• Andrew (unregistered)

    Frist * 000

  • djingis1 (unregistered)

    Sceond * 0.5

  • Gerald (unregistered)

    It's amazing how many people fail to grasp order of operations.

  • Ulysses (unregistered)

    "Time tested method" indeed. The test passes for quite some time.

  • I'm not a robot (unregistered)
    think solid state disks vs. local physical disks vs. ...
    Is this supposed to imply that SSDs are non-physical?
  • Chronomium (unregistered) in reply to Gerald

    What does this have to do with order of operations? You're multiplying by 000 = 0 either way.

    This is a case of failing to grasp that asterisk is not a thousands separator. (Has it ever been, anywhere? I thought just comma, period, and grave were.)

  • Chronomium (unregistered) in reply to Chronomium

    (And by "grave" I might mean "apostrophe". I dunno, I've only seen the top-tick notation a few times.)

  • MaxArt (unregistered) in reply to Gerald

    Uh... it doesn't matter, in this case? You're still multiplying by 0. At best, you'll get timeOut (and that's the case), at worst you'll get 0.

  • Chronomium (unregistered) in reply to Chronomium

    And of course after reading the code more careful-er I see that yeah I guess the order of operations would matter, to an extent - it would make the difference between a delay of timeOut (what happens) and a delay of 0 (would happen if + came before *). But that's not the point.

  • Mason Wheeler (unregistered) in reply to I'm not a robot

    think solid state disks vs. local physical disks vs. ...

    Is this supposed to imply that SSDs are non-physical?

    SSDs are non-discs. They're made of (physical) solid-state memory rather than (physical) spinning platters.

  • JG (unregistered) in reply to Chronomium

    Perl uses _ and some locales use a space

  • chreng (unregistered)

    I thought that "timeOut + 60 * 000" is the same as "timeOut + (60 * 000)". I never remember precedence so I always use parantheses. Maybe I am the real WTF.

  • CE (unregistered) in reply to chreng

    They are the same. The order is PEMDAS: parenthetical expressions, then exponents, then multiplication/division, then addition/subtraction.

    Using parentheses is a nice way to give yourself peace of mind when you don't know who will touch your code...

  • Sandman (unregistered)

    Please Excuse My Dumb Ass Sibling

  • David Jackson (unregistered) in reply to CE

    BODMAS in the UK.

  • Anonymous (unregistered) in reply to David Jackson

    And according to minutephysics, wrong.

  • Llarry (unregistered)

    We're always concerned with Divide By Zero errors. Doesn't mean we don't need to worry about Multiply By Zero errors.

  • Mijzelf (unregistered)

    Of course it didn't work. He is multiplying a decimal number with an octal zero. You can't mix up number systems this way.

  • Colin (unregistered) in reply to Anonymous

    Neither PEMDAS or BODMAS are "wrong", they're just acronyms, meant to help you remember what you've been taught. If your maths teacher didnt tell you that addition and subtraction have the same precedence in the absence of brackets/parenthesis, as do multiplication and division, then they werent a very good maths teacher.

  • Peter (unregistered)

    cow- orking .... ??? wtf

  • Jedi Mind Trick (unregistered) in reply to David Jackson

    And a Merry Bodmas to you too, my good sir!

  • Joseph Osako (google) in reply to Mason Wheeler

    Perhaps "mechanical" would be a more acceptable term than "physical", though even that could be argued (as the flow of electrons is a mechanism of sorts, I guess...).

    Still the term 'physical disk' for a mechanical platter (in contrast to a solid-state memory) has been in common use for years, and if "I'm not a robot" hasn't run across it before, I'd be surprised. Chalk it up to Pedantic Dickweedery, or a joke that fell flat.

  • Joseph Osako (google)

    My guess is that the original error wasn't quite so easy to spot, and that Mike had been using some formula that looked legit on a quick glance, but which he'd made some not-exactly-subtle-but-still-easy-to-miss mistake when changing it at some early point in things.

    At the very least, it is likely that the original had a variable for offset, which it would multiply but a constant factor such as 1000 to get how much to add to the timeout. If 'Mike' deleted the leading character in the number when changing something else, he might not have noticed it later, as it would have been a part he 'knew' was already working and he never consider that it might not be working any more.

    So TRWTF boils down to repeatedly failing a spot check.

    Addendum 2016-12-21 12:23: That, and failing to ask his cow-orkers for code reviews.

    But as for the actual error, I'm guessing we've all been there - not seeing the mistake because we don't actually look in the right place. The problem lay not in that, really, but in his lack of professionalism in not asking other coders to put eyes on the code.

  • Wobble (unregistered)

    How does O become "exponentiation" in BODMAS?

  • Loren Pechtel (google) in reply to Joseph Osako

    Aha! I was thinking this made no sense at all but inadvertently deleting a 1 makes sense. The time is probably in milliseconds. Expressing that as 30 * 1000 makes it much clearer what the unit is and costs nothing at runtime.

  • Patrick (unregistered)

    I have never understood how people manage to use hard loops as delay on actual computers. Typically if you need timing it's a game - i.e. graphical - and then you should be running locked to the vertical retrace anyways. So an exact timer kinda comes automatically with the territory...

  • Chakat Firepaw (unregistered) in reply to Peter

    From the jargon file:

    "Cow-orker" : Someone you work with, (note that orking cows is illegal in the state of Iowa).

    More seriously, it's one of those online terms that developed from a common typo.

  • isthisunique (unregistered)

    I really hate stuff like this. I've brought down boot processes from minutes to seconds fixing scripts that do this. They are more reliable as well. I get very angry when all I can do is sleep (although for things like network it is sometimes a must). A couple of cases still curse me today.

    One is where you need to start (or ensure started) a database process but it daemonises immediately then loads which usually takes several seconds. There's no good way (or obvious good way) in a script to wait for it to finish. Thinking about it, my script is a bit flawed because it wont bail if the process dies, leaving it to time out and fail. I could make it better in places but I'd rather wait instead until I have the chance to replace the current means of persistence.

    The other is a horror story. What should be a single application is a dozen applications. A Frankenstein of processes linked together from IPC. This resulted from many things, importing things from other applications, developers each doing their own thing in their own language, extreme deadlines and so on. There are a few methods for IPC, nearly all various network processes that aren't particularly useful for a cluster of applications that work together and have to run on the same machine. This means in some places to maintain consistency things like system wide semaphores are used as well as horrific hacks. Again it's one of those things you don't fix. You leave it until a rewrite is on the cards. In this case there's a process that sleeps for a minute just to hold the lock long enough to make sure the receiving application has finished processing the data before it starts consuming data from other sources that might be out of sync.

    On a Linux system there are places where simply polling for something is a while lot less effort than hooking events as long as nothing is blocked arbitrarily on that polling. Out of the box Linux with init.d and the normal conventions isn't that brilliant in terms of convenience. It is improving though but gradually.

  • Zenith (unregistered)

    I can actually kind of see this, excluding that multiplication by zero.

    Wait until you're forced to call a stored procedure to launch a job to kick off an SSIS package that runs for several minutes before abruptly failing without explanation. This is after you've spent an hour writing 20 lines of code to do exactly what you want in 20 seconds only for a manager to flip out because she expected you to squander days clicking through a package builder to get something that kindof sortof almost works, eventually, unless it crashes. You're daisy chaining this idiocy together with polling because the little dictator won't push operations to open the ports for SSIS and sp_StartJob literally just starts a job and returns immediately. And then el Stupido says "dur hur, this uploader is too confusing, users should have to browse 20 folders deep into a network share instead..."

  • Brian Boorman (google) in reply to Mason Wheeler
    SSDs are non-discs

    SSDs sure start out as discs. Have you never seen an IC wafer during processing?

  • Brian Boorman (google) in reply to Peter
    Comment held for moderation.
  • Olivier (unregistered) in reply to Chronomium

    In France (could not say for other French speaking countries) we use a space as thousand separator.

  • Me (unregistered) in reply to Mason Wheeler

    Hence why the D stands for "drive". Which is still iffy, granted, but it IS driving data lines!

  • Pjrz (unregistered) in reply to Wobble

    "O"bviously its exponentiation

  • Pjrz (unregistered) in reply to Wobble

    "O"bviously its exponentiation

  • David Jackson (unregistered) in reply to Wobble
    Comment held for moderation.
  • Blerg (unregistered)

    The real WTF is a programming language that allows leading zeroes in integer literals

  • Garreth Q. (unregistered)

    I have to say, that one (with a Sleep function in WinAPI) did catch me a couple of times.

  • Not That Doctor (unregistered)

    Obviously timeOut is a fixed point in time. You just can't change those or the universe will be destroyed.

  • Bananafish (nodebb) in reply to Peter

    Cow-orking is the opposite of cow-tipping. To "ork" a cow is to set it right back up on its feet.

  • Bananafish (nodebb) in reply to isthisunique

    You make a valid point about the improper use of IPC resulting from legacy practices. But you fail to recognize that most of the problems encountered "on a Linux system" with IPC are due to the fact that, on Linux, IPC is broken by design. There are some implementations where it is partially fixed, but for the most part it does not work correctly. Broken IPC is the reason Oracle database does not run on Ubuntu and some other Debian derivatives. This is one correct use of IPC. My favorite incorrect implementation of IPC is when ERP systems have a "data connector" process that employs IPC to get and send actual data between the applications and the database client driver. Needless to say, said ERPs are not able to run on Linux and must continue to run on Big Iron SystemV.

  • Anon (unregistered)

    I think the multiplication by 000 is a red herring, and maybe a typo when this article was submitted.

    Clearly the real problem is that the function was adjusted in the sequence 10,20,30,60 - which is not exponential.

    The narrative implied some sort of exponential relationship between on-site and client-site deployments. Although I'm having trouble figuring out what units would be on the x-axis of that graph.

  • Chris (unregistered)

    I was taught the "O" in BODMAS was operations. This includes powers, logarithms, sin, etc. I.e. sin(2x) != sin2x. +1 for always using brackets to ensure everything happens in the order you want it to. Improves readability, and there are probably some languages out there which have their own order, likely undocumented and involving a lot of internal parsing to and from strings, in which case you pray that at least they do the brackets part first. I have a lot of mistrust for many scripting languages. I think that's healthy.

  • Joseph Osako (google) in reply to Loren Pechtel

    I'm not saying it was a good design, just that it wasn't quite as obviously ridiculous as it looks.

    If it was something like 'timeout_sec * 1000', rather than a literal constant, it becomes plausible. Using seconds when you need milliseconds is still stupid, yeah, but it isn't exactly uncommon.

  • PTO (unregistered)

    Or possibly Mike was using a language where an asterisk indicates that the remainder of the line is a comment.

  • nasch (unregistered) in reply to Chris

    "there are probably some languages out there which have their own order, likely undocumented and involving a lot of internal parsing to and from strings"

    PHP right? It's got to be PHP.

  • A Robot (unregistered) in reply to Mijzelf

    Of course not. Octal Zeros are much smaller!

  • David Nuttall (google) in reply to Wobble

    BODMAS = Brackets, Order, Division/Multiplication, Addition/Subtraction. Order in UK English = Exponents for the rest of us English.

  • Hassan (unregistered)
    Comment held for moderation.

Leave a comment on “1 Moment in Time”

Log In or post as a guest

Replying to comment #:

« Return to Article