Favorite Anti-Pattern



  • @ObiWayneKenobi said:

    On topic, I'd have to say Big Ball of Mud.  Mainly because the worthless system I have to maintain, at least until next week, is a classic example of such a beast - everything just hacked together without rhyme, reason or even basic architectural skills. 

     

    Reminds me of my favourite technology-to-be-invented-yet: Architecture Injection. Apply architecture injection to a Big Ball of Mud,  and you get a well-structured system.

    No, I don't mean refactoring. Refactoring acutally requires a lot of work to be done by skilled developers (especially when started late).

    Architecture injection works automatically by simply pressing a big green button on project manager's desktop.

    Judging on how many project I see that heavily rely on architecture injection, I can only guess it will be released very soon.



  • @JimBastard said:

    You know this is really dumb. I wanted to have a quality post which would be a good read and now it's turned into complete crap because of ill informed noobs who have nothing of quality to say.
     

    I'm not sure what the problem is here - we knew it was really dumb, not quality, and complete crap the second we saw it was you who posted it. 



  • @KenW said:

    who posted it. 
     

    Right. He is just a troll.



  • Cargo cult and Lava flow!  Two great anti-patterns that hurt me together.

    The best thing is when you get "Make feature foo work" on your task list, ask around and find out that foo never worked, then get crapped on for touching code that "may not work but isn't causing any any problems".  This is what it means for managers to have some balls; making the tough decisions.



  • Functional decomposition is my favorite anti-pattern.  Mostly because it was how I was tought in high school, and I assume probably the way many people are tought today. 



  • @brazzy said:

    For a while (often a long, long while) someone affliced by this will never write a dozen lines of code without thinking "where can I use a pattern here?". The probably worst cases are those in love with a specific pattern that gets used everywhere. Often Singleton.
     

     Ugh, this is an insuffereable thing. There's a curve that most programmers go through: starting out patterns are not known about it, then the programmer enters an intermediate stage where they find patterns magical and use them everywhere. Symptoms sometimes include naming folders/packages "model", "view", "controller". Or naming every class with the pattern name appended to it, or worse just the pattern name. Code is usually painfully overcomplicated.

    Later on if the programmer improves he/she will incorporate the concepts and motivations behind the patterns into software, without thinking much of it. 



  • @chebrock said:

     Ugh, this is an insuffereable thing. There's a curve that most programmers go through: starting out patterns are not known about it, then the programmer enters an intermediate stage where they find patterns magical and use them everywhere. Symptoms sometimes include naming folders/packages "model", "view", "controller". Or naming every class with the pattern name appended to it, or worse just the pattern name. Code is usually painfully overcomplicated.

    Later on if the programmer improves he/she will incorporate the concepts and motivations behind the patterns into software, without thinking much of it. 

    Jumping jeebus chrizatch, were you the one who infected our servers with all the trojans? You must have been, because you've clearly used them to get into our source control.

    I'll be the first to admit that I'm a relative newcomer to the wonderful world of code monkeys, but I know a "if(hammer){everything = nail;}" approach when I see one...



  • @LieutenantFrost said:

    Jumping jeebus chrizatch, were you the one who infected our servers with all the trojans? You must have been, because you've clearly used them to get into our source control.

    I'll be the first to admit that I'm a relative newcomer to the wonderful world of code monkeys, but I know a "if(hammer){everything = nail;}" approach when I see one...

     

    WTF are you talking about? Make sense man, its the first rule. 



  • My boss seems to thrive from `crisis mode`. Trouble is he seems to constantly put off long-term fixes in favour of short-term quick fixes which usually take too long to actually implement and become ineffective. Then it becomes apparent to most that the time would have been better spent on a long term fix.



  • @ComputerForumUser said:

    My boss seems to thrive from `crisis mode`. Trouble is he seems to constantly put off long-term fixes in favour of short-term quick fixes which usually take too long to actually implement and become ineffective. Then it becomes apparent to most that the time would have been better spent on a long term fix.

    I wonder if it comes down to risk aversion, and not realizing that letting a problem fester for too long is in itself risky.

    /me feel ur pain. 

     



  • @arty said:

    I wonder if it comes down to risk aversion, and not realizing that letting a problem fester for too long is in itself risky.

     

    Maybe he's in El Cheapo mode. "What does a long-term fix cost? 30 hours? Way to expensive! I'll take the quick fix for 4 hours."



  • My favorite is http://en.wikipedia.org/wiki/Design_by_committee

    I Have a few small and one big customer/project like that.

    They think they run the show efficiently this way, and that they ARE the designers, in the end, we do not care about the commitee decisions, we just do what is right 'cause we know our job and pretend to follow their guidelines, and the whole bunch of useless egos that are part of the committee are just too incompetent to really understand why and how things are working and improving over the years.

    We tried to educate them, useless ( members of the committe are somewhat elected, i can't really explain, lots of politricks involved ) 

    This is a several years lasting successful project, our user-base is quite happy ( they silently support our behaviour, in a way ) we decided not to care about the committee long ago, they are wasting a lot of their time, but meanwhile they do less harm.

    ps : I apologise for any grammar/syntax errors, english is not my language. 



  • Ill stick with a very simple one:

    "Data Normalization" by casting everything to a String

     That way you only have to worry about one datatype



  • Reinvent the Wheel is a pet-peeve of mine. I really hate that.

    But the management anti-pattern Irrational Management is the one that has caused me the most stress over the years. 



  • Various names for the same one: "I forgot what language I'm programming in", "Hey I can do the same things in [new language] that I could in [old language]", "WTF X doesn't have feature Y? Time to roll my own instead of reading the documentation to see that it actually does"



  • My favourite anti-pattern recently has been "Fragile" development.

    It's like Agile, but just not quite there yet.

    It could basically be summed up as "We don't know exactly what this application should do yet, but let's develop something and not give any thought to future features because... hey, it's AGILE!" 



  • @PhillS said:

    My favourite anti-pattern recently has been "Fragile" development.

    It's like Agile, but just not quite there yet.

    It could basically be summed up as "We don't know exactly what this application should do yet, but let's develop something and not give any thought to future features because... hey, it's AGILE!" 

     

     

    Mine is SCRUMFALL  (prounoucned Scrum-er-fall)

     It's where program managment decide on SCRUM, but also commit to a release date and a fixed feature set ..



  • First post :-)

    My favorite anti-pattern is

    • Lava flow: Retaining undesirable (redundant or low-quality) code because removing it is too expensive or has unpredictable consequences

    The story behind it is a standard WTF: we've been creating a sync application for Symbian phones. The previous version worked fine, but we had to rewrite (most of) the application to work on Symbian 9. In case you're not familiar with Symbian, the change between v8 and v9 required that most of the applications be rewritten to accomondate to the platform security thing (it's fairly evident that the major licensees don't want anybody to write any more apps to it).

    So except for one tiny module: rewrite! We got an incompetent manager, who didn't manage, a tech lead who tought that design meant "use the example, and expand it gradually." When I offered the rewrite the hacked-together HTTP handler, the manager said that "We don't have time for that! We need to ship this in September."

    In January, after a lengthy "sent-to-symbian-signed - fix showstoppers - goto 1" we finally had it signed. The client got a buggy v2, but AFAIK they didn't care about the fact that it's a barely working piece of shit. It was a failure for me, even though I've got to the company at the last stage of the developement.

    Sorry for the off-topic story.



  • @JimBastard said:

    Lol he wants me banned.

    Wait, wait.

    HAHAHAHAH



  •  Yeah I get banned from a lot of places. Thanks for googling me and increasing my rank.     



  • @bobday said:

    @JimBastard said:

    Lol he wants me banned.

    Wait, wait.

    HAHAHAHAH

    See, by posting in this ancient thread you have brought back the spirit of Jim to torment us.  Seeing as it was you who unleashed this curse I think it falls on you to take your posse to Broo'lyn and kill him.  If you decline, my associates might have a word with you.



  •  I'm out of Brooklyn for the time. I'm summering in the Hamptons at my new house. Four bedrooms, two bath, and a pool. 

    *not living with my parents so don't make that stupid joke* 



  • @JimBastard said:

     I'm out of Brooklyn for the time. I'm summering in the Hamptons at my new house. Four bedrooms, two bath, and a pool. 
    Ah, yes, the one you're renting with a bunch of other guys in what is, no doubt, the most homoerotic arrangement you could find. Those who know you are quite aware of why you can't buy a house (other than being poor), you worthless piece of shit.



  • Yes I'm staying in a share house....LOL YOU FUCKING NOOB.

     



  • @JimBastard said:

    Four bedrooms, two bath, and a pool. 
     

    Four appliance boxes duct-taped together, a couple mason jars for toilets, and a puddle out front to swim in?

    Quite the upscale place... 



  • @MarcB said:

    @JimBastard said:

    Four bedrooms, two bath, and a pool. 
     

    Four appliance boxes duct-taped together, a couple mason jars for toilets, and a puddle out front to swim in?

    Quite the upscale place... 

    Somebody give this man a goddamned medal!



  • I'm pretty new to programming (just finished my first year of computer science) so I've not yet had the pleasure of working with other people's code yet, so I'd have to say my favourite anti pattern is busy spin simply because its the only one I've actually come across. In my defence I wrote it before we studied event handling and after testing the code I soon realised there had to be a better way and taught myself a little event handeling to remove the busy loop.





  • @Ice__Heat said in Favorite Anti-Pattern:

    Because everytime I write a method, I have to type this damn public/private thing!Like I care if something is public or private!!
    I make them all public to that I can access all the routines I need.

    I hate having to create a private properties followed by getters and setters on POCOs. It's stupid, but if you don't you a lot of coworkers annoying you about encapsulation, duh. I get if I was writing a public library were a change in the API between versions would be a problem it would make sense in some cases, but in most code I write it's just annoying.


  • Considered Harmful

    @sockpuppet7 said in Favorite Anti-Pattern:

    @Ice__Heat said in Favorite Anti-Pattern:

    Because everytime I write a method, I have to type this damn public/private thing!Like I care if something is public or private!!
    I make them all public to that I can access all the routines I need.

    I hate having to create a private properties followed by getters and setters on POCOs. It's stupid, but if you don't you a lot of coworkers annoying you about encapsulation, duh. I get if I was writing a public library were a change in the API between versions would be a problem it would make sense in some cases, but in most code I write it's just annoying.

    Here's a dime, kid, get yourself a better programming language.


  • Banned

    I saved this image years ago, knowing that one day I will find the perfect thread to post it in.

    18ed1f8f-eac6-43c1-8164-49802511028b-image.png



  • The last few years I haven't actually seen many anti-patterns. Not sure why. Mid 2000 I kept running into people that had read about this or that pattern and then proceeded to hamfist it into everything they touched for the next few months until they read about another pattern. I haven't run into that in years. Instead, everyone drops their brain in the gravel and kicks it around regarding processes instead. Agile! DevOps! SAFe! Not a single care being given to Getting Shit Done, but rather sit around and talk about work instead.



  • @Carnage So true, we have weekly meetings to discuss the methodologies but nobody seems to care about code anymore


  • Discourse touched me in a no-no place

    @Carnage said in Favorite Anti-Pattern:

    Instead, everyone drops their brain in the gravel and kicks it around regarding processes instead. Agile! DevOps! SAFe!

    That's just (anti-)patterns on a different level.


  • Java Dev

    <?php
        class something
        {
            function dothing( ... )
            {
                if( condition1 )
                {
                    if( condition2 )
                    {
                        if( condition3 )
                        {
                            // 100+ lines of normalish code
                            //
                            //
                            //
                            //
                            //
                            //
                            //
                            //
                            //
                            //
                            //
                            //
                            //
                            //
                            //
                            //
                        }
                        else
                        {
                            debug( "condition 3 failed" )
                            throw new Exception( "internal error" );
                        }
                    }
                    else
                    {
                         debug( "condition 2 failed" )
                         throw new Exception( "internal error" );
                    }
                }
                else
                {
                    debug( "condition 1 failed" )
                    throw new Exception( "internal error" );
                }
                return $result
            }
        }
    ?>
    

  • Considered Harmful

    @PleegWat said in Favorite Anti-Pattern:

    <?php </blockquote>

    Yeah, that's the worst antipattern.

    Edit: Wait, wtf? Look at the raw of this post.


  • Considered Harmful

    Hmm... :kneeling_warthog: but it looks like PHP tags can break NodeBB's closing tags, which might lead to all kinds of fun hijinks.


  • Java Dev

    @error said in Favorite Anti-Pattern:

    Hmm... :kneeling_warthog: but it looks like PHP tags can break NodeBB's closing tags, which might lead to all kinds of fun hijinks.

    NodeBB, or Ben's HTML sanitizer?



  • @PleegWat I've seen lots if this. I guess the correct fix would be to create an internal function but I'm annoyed the way I name them. Something like internal_thing()?


  • Considered Harmful

    @sockpuppet7 said in Favorite Anti-Pattern:

    @PleegWat I've seen lots if this. I guess the correct fix would be to create an internal function but I'm annoyed the way I name them. Something like internal_thing()?

    If possible, I usually do if( !foo ) return; or throw or whatever.



  • @error said in Favorite Anti-Pattern:

    @sockpuppet7 said in Favorite Anti-Pattern:

    @PleegWat I've seen lots if this. I guess the correct fix would be to create an internal function but I'm annoyed the way I name them. Something like internal_thing()?

    If possible, I usually do if( !foo ) return; or throw or whatever.

    Yeah. Bail out early, then you don't even need an else clause.

    if (bad_thing_1) throw new ArgumentException("Precondition 1 not met")
    if (bad_thing_2) throw new ArgmentException("Precondition 2 not met")
    ...
    //real code goes here, where you're sure that all the preconditions are satisfied and it's not nested a mile deep.
    

  • Java Dev

    @error said in Favorite Anti-Pattern:

    @sockpuppet7 said in Favorite Anti-Pattern:

    @PleegWat I've seen lots if this. I guess the correct fix would be to create an internal function but I'm annoyed the way I name them. Something like internal_thing()?

    If possible, I usually do if( !foo ) return; or throw or whatever.

    That's my usual approach when I've got an excuse to rewrite one. The original author for that component must have been heavy on the 'no early return' coolaid. Which I agree with to a point; in a different component success returns in the middle of a function have bit me bad. But this guy seems to have had a religion going.

    Regarding naming internal functions, a different former team member would use an _ex suffix. That would be C code, and typically the wrapper would be handling locking.



  • @PleegWat said in Favorite Anti-Pattern:

    Regarding naming internal functions, a different former team member would use an _ex suffix. That would be C code, and typically the wrapper would be handling locking.

    I was thinking in some wrappers I used to have new different parameters, because no overloading on C


  • Trolleybus Mechanic

    @PleegWat said in Favorite Anti-Pattern:

    The original author for that component must have been heavy on the 'no early return' coolaid. Which I agree with to a point; in a different component success returns in the middle of a function have bit me bad.

    Does "verify your assumptions before you start working" break "no early return", though? I always considered it an exception to the general rule.


  • Notification Spam Recipient

    @sockpuppet7 said in Favorite Anti-Pattern:

    @Ice__Heat said in Favorite Anti-Pattern:

    Because everytime I write a method, I have to type this damn public/private thing!Like I care if something is public or private!!
    I make them all public to that I can access all the routines I need.

    I hate having to create a private properties followed by getters and setters on POCOs. It's stupid, but if you don't you a lot of coworkers annoying you about encapsulation, duh. I get if I was writing a public library were a change in the API between versions would be a problem it would make sense in some cases, but in most code I write it's just annoying.

    This is annoying in Java but Lombok has gotten rid of most of it thankfully. To get around even using Lombok I see tuple libraries which I'm leaning towards banning outright. Over used, which they always fucking are, leads to code that is indecipherable. I loath seeing methods that return a triplet. That's half an afternoon gone.

    Something that I'm seeing crop up more and more is everything must be a micro service. The place I'm leaving decided that everything should be a micro service with individual dB's per service. They've basically created a highly inefficient monolith and the data model is in complete shit. Not even the biggest wtf! My personal favourite is storing json embedded in a tree structure in a rdbs.

    I love a good tire fire but this took the cake.



  • @DogsB said in Favorite Anti-Pattern:

    @sockpuppet7 said in Favorite Anti-Pattern:

    @Ice__Heat said in Favorite Anti-Pattern:

    Because everytime I write a method, I have to type this damn public/private thing!Like I care if something is public or private!!
    I make them all public to that I can access all the routines I need.

    I hate having to create a private properties followed by getters and setters on POCOs. It's stupid, but if you don't you a lot of coworkers annoying you about encapsulation, duh. I get if I was writing a public library were a change in the API between versions would be a problem it would make sense in some cases, but in most code I write it's just annoying.

    This is annoying in Java but Lombok has gotten rid of most of it thankfully. To get around even using Lombok I see tuple libraries which I'm leaning towards banning outright. Over used, which they always fucking are, leads to code that is indecipherable. I loath seeing methods that return a triplet. That's half an afternoon gone.

    I just use Kotlin, is there any good bits of lombok that would make it preferable over Kotlin?

    Something that I'm seeing crop up more and more is everything must be a micro service. The place I'm leaving decided that everything should be a micro service with individual dB's per service. They've basically created a highly inefficient monolith and the data model is in complete shit. Not even the biggest wtf! My personal favourite is storing json embedded in a tree structure in a rdbs.

    The architect wanted a tables-for-json-in-rdbms. I plonked the entire JSON into a CLOB with a few columns for metadata instead, I've seen graphs saved in node-rows in RDBMSes before, and hell no I'm not doing that.

    I love a good tire fire but this took the cake.


  • Discourse touched me in a no-no place

    @Carnage said in Favorite Anti-Pattern:

    I plonked the entire JSON into a CLOB with a few columns for metadata instead, I've seen graphs saved in node-rows in RDBMSes before, and hell no I'm not doing that.

    That's always been the choice I've preferred too.



  • @Carnage said in Favorite Anti-Pattern:

    I just use Kotlin, is there any good bits of lombok that would make it preferable over Kotlin?

    Lombok isn't its own language, but lets you annotate your Java classes to automagically generate get/setters, constructors, static logger, etc.



  • @hungrier said in Favorite Anti-Pattern:

    @Carnage said in Favorite Anti-Pattern:

    I just use Kotlin, is there any good bits of lombok that would make it preferable over Kotlin?

    Lombok isn't its own language, but lets you annotate your Java classes to automagically generate get/setters, constructors, static logger, etc.

    Yeah, but from a quick glance, Kotlin seems to solve many of the same problems that lombok does.


  • Considered Harmful

    @hungrier said in Favorite Anti-Pattern:

    @Carnage said in Favorite Anti-Pattern:

    I just use Kotlin, is there any good bits of lombok that would make it preferable over Kotlin?

    Lombok isn't its own language, but lets you annotate your Java classes to automagically generate get/setters, constructors, static logger, etc.

    I'll probably start using that in the Minecraft mod.


Log in to reply