• (disco)

    Roberto explained both the Factory pattern ...

    Uh, oh; I sense trouble already.

  • (disco)

    After reading:

    	    switch (value)
    	    {
    	        case "Change Date":
    	            dateStrategy = new DateFormatProcessor();
    	            break;
    	        case "Contract Date":
    	            dateStrategy = new DateFormatProcessor();
    	            break;
    

    and

    
    	        if (DetailSet.LabelName == "Contract Date")
    	        {
    
    ...
    
    	        if (DetailSet.LabelName == "Change Date")
    	        {
    

    I think I'm starting to see a Pattern…

    The offshore programmer seems to have written code which reeks more of a Prototype than a maintainable codebase. I would make QA pay them a Visit or at least make the development boss change his Strategy. That way they will at least not be able to keep up the Facade that off-shore is better in the long run.

    If you want to burn Bridges though: suggest that they go work in a Factory, the damn Singletons.

  • (disco)

    Maybe he should have used a few more design patterns…

    Ummm...no. You've already seen what they'll do with one hammer. Give some people a hammer and everything looks like a nail...and that's not a good thing. With this group, you give them a hammer and they start knocking holes in the walls.

  • (disco) in reply to JBert
    JBert:
    I think I'm starting to see an Observer of a Pattern…

    FTFY

  • (disco)

    Oh well, at least the variant spacing indicates that the Copy-and-Paste antipattern wasn't used!

  • (disco)
    1. There is a difference between "use a pattern" and "abuse in the name of a pattern"
    2. Where was the code review before this was committed??? <ducking and running>
  • (disco) in reply to TheCPUWizard
    TheCPUWizard:
    2) Where was the code review before this was committed???

    There was a code review. He did it himself. The company has a policy of a own-code review, as to develop a sense of responsibility within its employees, which in turn improves code quality (case in point).

  • (disco) in reply to Vault_Dweller
    Vault_Dweller:
    There was a code review. He did it himself. The company has a policy of a own-code review, as to develop a sense of responsibility within its employees, which in turn improves code quality (case in point).

    FacePalm!

  • (disco) in reply to Vault_Dweller
    Vault_Dweller:
    There was a code review. He did it himself. The company has a policy of a own-code review, as to develop a sense of responsibility within its employees, *in the MBA-inspired belief that avoiding duplication of effort will save money in the long term* which in turn improves code quality *management bonuses* (case in point).
    ftfy
  • (disco) in reply to dkf

    I'm not sure about that, looks pretty neat to me except for the vars. Lots of empty lines though,

  • (disco) in reply to Vault_Dweller
    Vault_Dweller:
    There was a code review. He did it himself.

    :wtf:

  • (disco)
    //Use the Strategy pattern

    A DRY pattern would have been better.

  • (disco) in reply to chreng

    Well, ignoring the fact that implicit typing actually increases code readability, every line in these methods are inane. I'm not 100% sure what this code is trying to accomplish - since it seems to do the same thing for every piece of data it "processes" and it never even uses the results of the MLS query besides checking to see if LabelName is null or empty - but I am certain that whoever wrote this needs to have their programming license revoked.

    Tell me if I'm wrong, but I do believe all of this be replaced by: https://gist.github.com/nelsonlaquet/18eb3ca0867762075de8

  • (disco) in reply to CoyneTheDup
    CoyneTheDup:
    give them a hammer and they start knocking holes in the walls.

    http://www.youtube.com/watch?v=Ymp3ZyHjC68

  • (disco) in reply to flabdablet

    I don't know if that carries the right connotation. I mean the people in the article aren't crazy, just, well, prone to misuse any heavy-duty tool that comes to hand.

    (Rethinks comparison.)

    OTOH, maybe it does have the right connotation. :smiley:

  • (disco) in reply to CoyneTheDup
    CoyneTheDup:
    Give some people a hammer and everything looks like a nail...and that's not a good thing. With this group, you give them a hammer and they start knocking holes in the walls.

    Actually, if you wanted to get management's attention on how offshoring is actually costing them more money, this is a really GOOD way to do it.

  • (disco) in reply to Shoreline
    Shoreline:
    //Use the Strategy pattern

    A DRY pattern would have been better.

    Well of course it's dry. Do you know what happens when you get computers wet? Simple, dude, the magic smoke gets out, and then everything's broken!

    Geez, don't you people know anything?

    ;)

  • (disco) in reply to Steve_The_Cynic
    Steve_The_Cynic:
    Do you know what happens when you get computers wet? Simple, dude, the magic smoke gets out, and then everything's broken!

    Have you considered replacing the magic smoke with WD-40?

  • (disco) in reply to dkf
    dkf:
    Have you considered replacing the magic smoke with WD-40?

    Preferably while it's still running.

    <!-- Bonus points if it's in the middle of writing something to HDD -->

Leave a comment on “A Winning Strategy”

Log In or post as a guest

Replying to comment #:

« Return to Article