• Da expert (unregistered)

    Lots of best practices to learn from here, including adhering to the contract.

  • MiserableOldGit (unregistered)

    "What? no, WAIT, we need you, stop, double pay, triple pay, honest ... !"

    ....

    "An error occurred"

  • snoofle (unregistered) in reply to MiserableOldGit

    So...

    Company hires developer lacking knowledge of best practices. Company hires contractor to assist developer, to save money. Company fires contractor to save money, with virtually no notice, regardless of how it impacts the project. Project blows up because of harmful but innocent mistake due to less-than-best-practices being followed. Contractor leaves when pay stops, regardless of emergency-du-jour. Company pays ten times what they saved by firing contractors in a) lost productivity, b) hiring them back at increased rates.

    Sadly all too par for the course.

  • Kanitatlan (unregistered)

    Reminds me of my favourite WTF implementation from a long, long time ago in a language that is now, fortunately, far, far away.

    IF sensibly_named_function_that_may_return_an_error_code < 0 THEN ANSWER -1;

    peppered all through our source code. Effectively identical to this WTF.

  • Jerepp (unregistered)

    Ah yes the Catch... Anonymize...Rethrow pattern, why didn't this make it into the Gang of 4 again?

  • Chairman Meow (unregistered) in reply to Jerepp

    Well, at one time, it was the Gang of Five... and then the One Who Shall Not Be Named proposed this pattern.

    At least his family could afford the bullet.

  • (nodebb)

    Interesting that there is overt RTTI to decide what new exception to throw rather than a separate catch block for each interesting type, ordered correctly.

  • D-Coder (unregistered) in reply to Kanitatlan

    HyperTalk?

    Its descendants live on.

  • Andrew (unregistered)

    Ian's experience of wishing the best to John and leaving at 5 is one I've shared, though not under quite the same circumstances. Having worked as a contractor, that was actually one of the best "leverage" techniques. There were times that our "host" (or whatever the term is) company would hear us say, "... good luck with that," and in response we'd hear, "Oh, we'll just see about that ...." A few hours later, contracts were extended or over time approved.

  • Quite (unregistered)

    There is of course a sort of fairly quick-ish way to do something about this, but it will be a solid morning's work: that is, to put (at the top of the catch block) a line that logs the exception to the database in its full glory, in every single class that implements this technique. Yeah, sure, that's a large number of edits to do, but muscle-memory coupled with Motorhead on the iPod takes care of that. After this debacle, John is not going to have much stock left to outbid you with.

  • Quite (unregistered) in reply to Quite

    ... I meant of course "to the log file".

  • eric bloedow (unregistered)

    i can't help but think of that idiotic "verification" program i saw in an earlier story: if problem 1 occurs, says "error". if problem 2 occurs, say "error"...dozens of separate tests, with identical error messages on separate lines! completely missing the entire point of having tests!

  • Bidem (unregistered)

    I saw worse :

      try {
        // Entry point to most of the program here
      } catch (Exception e) {
        try {
          ProcessingException pe = (ProcessingException) e;
          throw new ProcessingException("An error occurred");
        } catch (ClassCastException cce) {
          try {
            BatchException be = (BatchException) cce;
            throw new BatchException("An error occurred");
          } catch (ClassCastException cce2) {
            //… more types of exceptions
          }
        }
      }
  • Jeff Grigg (unregistered)

    That's outrageous! Everyone knows that The Best Enterprise Practice is to chain exceptions, like this:

    if ( e instanceof ProcessingException ) {
        throw new ProcessingException("An error occurred", e);
    }
    

    [IE: I added ", e" to the 2nd line, to chain the exceptions, so that the original exception is not lost.]

    .

    ;->

  • WonkoTheSane (unregistered)

    Wait... He broke the system at 4:59 and then walked out because his contract had ended.

    People like this are why my professional indemnity insurance is expensive!

  • Derp (unregistered) in reply to WonkoTheSane

    No, the other developer broke it all and expected the contractor to help fix it after his contract was up.

  • WonkoTheIlliterate (unregistered) in reply to WonkoTheSane

    Yes that's right, that's exactly what happened.

  • Axel (unregistered) in reply to WonkoTheSane

    With reading comprehension skills like that, it's a wonder you can spell "indemnity."

Leave a comment on “An Exceptional Contract”

Log In or post as a guest

Replying to comment #:

« Return to Article