• Hanzito (unregistered)

    And what's with AJAX and AJAX2? Two AJAX objects/namespaces for two different calls to the same host?

  • AzureDiamond (unregistered)

    i guess its different clients where "AJAX" is faster but "AJAX2" works on old explorer versions. they could still do var ajaxClient; if (AJAX) { ajaxClient = AJAX } else { ajaxClient = AJAX2 } instead of duplicate code

  • (nodebb)

    Code reviews are only good if you give people time to do them correctly, which takes almost as much time as the programmer did; otherwise you wind up with lots of LGTM. They also only work if the reviewers are at least somewhat as competent as the programmer. If both the reviewers and the programmers are incompetent you are just making fodder for this website.

  • (nodebb)

    We've all heard "If your only tool is a hammer, everything looks like a nail." I think it's also sometimes true that "If the tool in your hand at the moment is a hammer, everything looks like a nail." BTDT.

  • Drak (unregistered) in reply to AzureDiamond

    Ah, but you missed the fact that both AJAX and AJAX2 could be true, which would mean different results from your code.

    And.. var ajaxClient == AJAX ?? AJAX2; or var ajaxClient == AJAX || AJAX2; is probably more what people on this site like.

  • (nodebb)

    Maybe they were thinking of other code where the parameters in the AJAX.open() calls were more dynamic. Although you can still limit the `PHP section to just that part, like

    AJAX.open("POST", '/timesheets/v2/rapports/<?php echo $blah; ?>');
    
  • NotYourLocalJavaWizard (unregistered)

    The fact that AJAX and AJAX2 are used to determine if we're looking for a "Debut" report or a "Fin" report suggests a lot more fun in this codebase than just redundant string creation via round-trip through the PHP interpreter.

  • (nodebb) in reply to RogerC

    A boss who thought he could program led me to invent this saying:

    If all you have is a hammer with three heads, everything looks like three nails.

  • (nodebb) in reply to d-coder

    That would be a boss who took a one-day training course / seminar things on "how to code", and thought afterwards(1) that "how to code" and "how to program" are the same thing, right?

    (1) And probably before as well...

  • (nodebb) in reply to d-coder

    Now I'm picturing a three-headed hammerhead shark...

  • Mike Sandbox (unregistered)

    I have occasionally been guilty of similar things. Usually comes from solving a problem by taking the code for a similar problem and adapting it under a time crunch to Get It Done. I'll come back later and realize the other code was either not written well or had to handle more use cases, so it's way more convoluted than what was actually needed.

  • (nodebb) in reply to NotYourLocalJavaWizard

    Was about to comment same. That the two URL are not the same depending on the "AJAX" version used is ... juicy.

  • xtal256 (unregistered)

    Are we sure these are two different versions of AJAX? I'm not familiar with the old AJAX way of doing things, but this just looks like two variables named "AJAX" and "AJAX2", not classes or namespaces.

  • Kirby Wallace (unregistered)

    My guess would be that he might already have connections open that he wants to reuse, and only open a connection if he didn't already have one open.

    That "if (AJAX)" might be determining that.

  • Tgape (unregistered)

    Anyone can make this kind of mistake, but only organizational failures get this code merged.

    I am envious of the kind of privilege you need to think this. It takes a combination of organizational failure and success to get this kind of code merged. For most of my career, I've been on various teams that do both development and operations, and it seems like there's always at least one person who likes to deploy code directly to prod without version control. To be clear, not me, I've always been the guy who championed the idea of version control and used whatever version control was available to manage my changes prior to having an approved version control product for the team.

    For one small part of my career, I was on a team where development and operations were split between two teams. The dev most prone to deploying code without version control or review was on the ops side, where he was able to continue doing that (and, in fact, in order to do development, he had to, as they didn't give operations approval to commit stuff. Not that he was supposed to do any development)

  • (nodebb)

    Said another way, when everyplace is a shithole of universal evil, someplace merely middle-class ordinary seems like an unrealistic paradise.

Leave a comment on “An Echo In Here in here”

Log In or post as a guest

Replying to comment #684498:

« Return to Article