Search list, not available



  • Greetings fellow lifers. Can someone tell me what the point of this is:

    private class SearchListNotavailable
    {
        public Exception Ex { get; set; }

        public SearchListNotavailable(Exception ex)
        {
            this.Ex = ex;
        }
    }

    Found in our productive code base, embedded in the codebehind class of an .ascx control. The individual responsible for this has long since left the company but if he was I here and I happened to be doing the code review for this atrocity I'd be drowning him in the creek out back right about now. I'm an angry, intolerant and downright unpleasant person and I no longer want to see such things on a daily basis. A curse on him.


  • Discourse touched me in a no-no place

    @JimLahey said:

    I'm an angry, intolerant and downright unpleasant person
    Hi, and welcome to TheDailyWTF! I'm sure you'll fit right in.



  • Welcome. The beer is in the fridge and the nuts are all over the place.



  • And the bodies are stacking up in front of me. Same codebehind, same author, different WTF:

    upPanel.ChildrenAsTriggers = false;
    // attempt wia...
    upPanel.ChildrenAsTriggers = true;
    

    This should have been set to the following, no?

    upPanel.ChildrenAsTriggers = FILE_NOT_FOUND;
    


  • @Rhywden said:

    Welcome. The beer is in the fridge and the nuts are all over the place.


    ... and being punched, judging by the popularity of the phrases 'cockpunch' and 'ballpunch' around here.



  • @JimLahey said:

    upPanel
     

    Well, there's TRWTF right there: asp.net's update panel. It's just like an ajax call, except that it runs through the entire page lifecycle, takes the length of time of a full postback, breaks all your javascript bindings, overwrites any DOM changes you've made, and will often fuck up the viewstate in interesting ways.

     Oh yeah, and it also hides server-side errors behind an invisible wall of nothing, so that you need a webdeveloper toolbar installed just to inspect the results for an error message that might or might not be there. I'll just use the IE developer network sniffing setting... oh wait.

    I'm sure some or none of those problems can be addressed (but not necessarily solved) by an Extender in the AjaxToolKit, but then you introduce the shitpile of problems that is the AjaxToolKit.

     



  •  @Lorne Kates said:

    @JimLahey said:

    upPanel
     

    Well, there's TRWTF right there: asp.net's update panel. It's just like an ajax call, except that it runs through the entire page lifecycle, takes the length of time of a full postback, breaks all your javascript bindings, overwrites any DOM changes you've made, and will often fuck up the viewstate in interesting ways.

     Oh yeah, and it also hides server-side errors behind an invisible wall of nothing, so that you need a webdeveloper toolbar installed just to inspect the results for an error message that might or might not be there. I'll just use the IE developer network sniffing setting... oh wait.

    I'm sure some or none of those problems can be addressed (but not necessarily solved) by an Extender in the AjaxToolKit, but then you introduce the shitpile of problems that is the AjaxToolKit.

    You are entirely correct. The whole WebForms model is for Windows devs who want to have a go at making web apps or websites. It's also a huge WTF. ViewState FFS and the form doesn't even Gzip that shit so your page bloats to fucktacular proportions if you have anything going on. Unfortunately to make it work as you want you need better knowledge of web technologies which raises the question, why not do it all in MVC and jQuery to start with? The other thing I hate about WebForms is that too often devs treat the codebehind as the data layer which is just fucking bullshit. You might as well go and use PHP if you give that little of a shit about it.

     



  • @Lorne Kates said:

    @JimLahey said:

    upPanel
     

    Well, there's TRWTF right there: asp.net's update panel.

    update panel, well, well, I thought it was the upper panel.



  • @JimLahey said:

    Greetings fellow lifers. Can someone tell me what the point of this is:

    private class SearchListNotavailable
    {
        public Exception Ex { get; set; }

        public SearchListNotavailable(Exception ex)
        {
            this.Ex = ex;
        }
    }
    This is not a WTF. Everyone knows there are two ways of extending functionality of existing classes. Either through inheritance (private class SearchListNotavailable : Exception) or through composition as your cow-orker did.



  • @bjolling said:

    This is not a WTF.
     

    OK, it's not a WTF. Tell me what the point of it is then. Oh yeah, it is a massive WTF because all I can do with it is the following:

    searchListNotAvailableInstance.Ex..
    

    It's not extended anywhere, not through inheritance, composition, extension method or IL rewriting and because it's nested inside a codebehind class AND marked as private it's useless outside of the codebehind anyway. If all I can do with it is access the exception, I might as well just use the exception so to me writing code that I don't need and that has zero added value is a huge WTF, as is the fact that it has a public setter and a constructor parameter. This isn't even showing off, it's just shit.



  • @JimLahey said:

    OK, it's not a WTF. Tell me what the point of it is then. Oh yeah, it is a massive WTF because all I can do with it is the following:

    Before replying to a post, always ask yourself: "was it serious, or was it a troll (or a joke)?"



  • @dargor17 said:

    @JimLahey said:
    OK, it's not a WTF. Tell me what the point of it is then. Oh yeah, it is a massive WTF because all I can do with it is the following:

    Before replying to a post, always ask yourself: "was it serious, or was it a troll (or a joke)?"

    Filed under: though some people blur the lines 

    Only one bite, so it was obvious enough for most



  • @JimLahey said:

    @bjolling said:

    This is not a WTF.
     

    OK, it's not a WTF. Tell me what the point of it is then. Oh yeah, it is a massive WTF because all I can do with it is the following:

    searchListNotAvailableInstance.Ex..
    

    It's not extended anywhere, not through inheritance, composition, extension method or IL rewriting and because it's nested inside a codebehind class AND marked as private it's useless outside of the codebehind anyway. If all I can do with it is access the exception, I might as well just use the exception so to me writing code that I don't need and that has zero added value is a huge WTF, as is the fact that it has a public setter and a constructor parameter. This isn't even showing off, it's just shit.

    Nothing like having another well-spoken, borderline psychotic around... Welcome!
    Have you met blakey yet?


  • @JimLahey said:

    ViewState FFS and the form doesn't even Gzip that shit so your page bloats to fucktacular proportions if you have anything going on
     

    [url="http://www.codeproject.com/Articles/28378/Efficient-Server-Side-View-State-Persistence"]Server-Side Viewstate to the rescue![/url]

    I've put that in every single project I touch. Copy a few files, quick modification to global.asax, give IUser full permission on App_Data\Cache , and you'll never have to worry about viewstate bloat again.

    I have no idea what Microsoft was thinking when they came up with their Viewstate strategy.

     "Here's a fuckton of information that we want to have on postback.  What should we do with it?"

    "Why not handle it like we handle sessions? Store it in a persistent medium (hard drive, db, memory), then rely on sending the user a unique key to retrieve that information?"

    "FUCK no. We've done that already. Let's just send the user ALL the data in a hidden field, so we'll be sure to get it back."

    "Umm, but the user might fuck with the data."

    "ENCRYPT IT! Sure, that just makes the data bigger, and there's zero use-cases where the user should decrypt it, and it creates a non-zero chance that a bad implementation will expose server-side keys, and it uses up a fuckton of bandwidth (x2 since they have to send it back)-- but aside from all those issues, I see no reason to use our already existing, security and bandwidth friendly strategy!"



  • @C-Octothorpe said:

    Nothing like having another well-spoken, borderline psychotic around... Welcome!

    Have you met blakey yet?

     

    Don't you ever, and I mean ever call me a borderline psychotic again.. I'm so much worse than that.

     


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.