Formatting rant, plus more



  • So where I work now we are building a RIA using mostly just plain ol javascript with some Ext thrown in here and there.

    Our team lead has a fundamental misunderstanding of object oriented programming and has developed some interesting anti-patterns,  such as all functions go in one file, all vars declared in another file, everything global, fun stuff like that.   You can find variable and function names like 'cancel', 'cancel2', 'bobs_cancel2', 'mySampleGrid' etc.  

    Any deviation from his f'd up "standards" results in a whine fest, then he'll come back behind you and 'fix' your code up the way he wants.  He has the full support of management because, you know, well he's been doing this for twenty years.... right.

    You can imagine the process to build this project is just as scattered and broken as the system's architecture.  We have ant, maven, .bat files, a dll, java, and shell scripts all used to build the project. Certain parts only build on certain operating systems.  Following this, most IDEs want to restructure the project files in order to  build them which breaks everything, so most folks do dev work in plain text editors.  

    Our illustrious team lead has a new wonderful idea he's implementing.  Once a piece of functionality goes through QA and passes (which amazingly does happen)  he is going back through the code base and flattening out the functions and related vars that were tested so that they take up one line.  Usually extremely long lines. 

    I pried an explanation out of him, he is trying to mimick 'code collapse' features you see on IDEs that will expand/collpase chucks of code by brackets.  Good thing I have an auto-format function, but even that wont get everything lined back up again when I have to go back and modify things due to ever-shifting requirements. *headdesk* 

    CVs are out, interviews happening, hopefully I wont have to put up with this much longer.



  • @CaptainCaveman said:

    mimick 'code collapse' features you see on IDEs that will expand/collpase chucks of code by brackets

    Great idea!  Can I use that?  Or is that part of your employer's IP?



  • @Qwerty said:

    @CaptainCaveman said:

    mimick 'code collapse' features you see on IDEs that will expand/collpase chucks of code by brackets

    Great idea!  Can I use that?  Or is that part of your employer's IP?

    We did that back in the bad old days of 8k commodore PETs, when every additional statement stacked on a line saved you 5 bytes. And 1 letter variables were a byte shorter than the alternative, 2 letter variables. We had a script that would do that, and strip out REM statements, before publishing.



  • @CaptainCaveman said:

    such as all functions go in one file




    I feel your pain...I've recently been handed an ASP.net "MVC" application (although the only thing about it resembling MVC is that the VS MVC template was chosen when the project was created) that has 95% of its application logic in one 2000+ line js file "main.js" (a result of cowboy coding gone very bad). Even better, I've so far determined that around 90% of this javascript is either never used, completely unnecessary, or hopelessly broken. My second favorite thing about the application is the Utilities.cs "class", containing such gems as SplitCommaSeparatedString()



  • We feel your pain.@CaptainCaveman said:

    CVs are out, interviews happening, hopefully I wont have to put up with this much longer.
    Good luck.



  • @bullrider718 said:

    @CaptainCaveman said:
    such as all functions go in one file




    I feel your pain...I've recently been handed an ASP.net "MVC" application (although the only thing about it resembling MVC is that the VS MVC template was chosen when the project was created) that has 95% of its application logic in one 2000+ line js file "main.js" (a result of cowboy coding gone very bad). Even better, I've so far determined that around 90% of this javascript is either never used, completely unnecessary, or hopelessly broken. My second favorite thing about the application is the Utilities.cs "class", containing such gems as SplitCommaSeparatedString()

    This is nothing compared to the one ASP.NET web project I had to help save. Every single method (including page-specific event handlers) was in a single .cs file, and this file was then included on EVERY PAGE of the site, even those that didn't use any of its functionality. Unsurprisingly the site was dog-slow and riddled with bugs.

    But the cherry on the cake was that the original developer managed to break ASP.NET's session handling. Through some combination of static variables and pure insanity, he engineered it so that sessions leaked into each other. Given that this was an e-commerce application, the end result was that logged-in users would end up seeing other logged-in users' shopping baskets... and account details. And other potentially sensitive information. Oh, did I mention this minor issue was only discovered *after* the site went live and people had started placing orders? And that it ended up being a PR disaster?

    Thankfully the developer responsible for that abortion is long gone. Sadly, I didn't get to flog him before he left us.


  • :belt_onion:

    @bullrider718 said:

    @CaptainCaveman said:
    such as all functions go in one file




    I feel your pain...I've recently been handed an ASP.net "MVC" application (although the only thing about it resembling MVC is that the VS MVC template was chosen when the project was created) that has 95% of its application logic in one 2000+ line js file "main.js" (a result of cowboy coding gone very bad). Even better, I've so far determined that around 90% of this javascript is either never used, completely unnecessary, or hopelessly broken. My second favorite thing about the application is the Utilities.cs "class", containing such gems as SplitCommaSeparatedString()
    That's nothing. I'm currently maintaining an ASP.NET applications that tried to implement the MVC pattern on top of ASP.NET Webforms. All business logic is written either in JQuery or in the functions that synchronize the screens with the model. So what you see on screen is not necessarily in the model and vice versa.



  • @Qwerty said:

    @CaptainCaveman said:

    mimick 'code collapse' features you see on IDEs that will expand/collpase chucks of code by brackets

    Great idea!  Can I use that?  Or is that part of your employer's IP?

     

     

    lol do it, patent it , then sue this guy



  • @The_Assimilator said:

    But the cherry on the cake was that the original developer managed to break ASP.NET's session handling. Through some combination of static variables and pure insanity, he engineered it so that sessions leaked into each other. Given that this was an e-commerce application, the end result was that logged-in users would end up seeing other logged-in users' shopping baskets... and account details. And other potentially sensitive information. Oh, did I mention this minor issue was only discovered *after* the site went live and people had started placing orders? And that it ended up being a PR disaster?

     

    I saw something similar at the last place i worked, nasty session poisoning across their entire web tier affecting 9 company branded sites.  I guarantee some of you guys have been on at least one of those. The problem was in their nasty homemade SSO hack. Some VP or something noticed that even if he logged out whoever logged in after him on the same machine was still using his user profile and had access to his saved credit card. This wouldnt have happened if the QA folks weren't afraid to mark defects.  They were just rubber stamp jockeys who approved almost anything as long as it wasn't blatantly screwed up. 

    It's all still live and still broken, but at least it motivated them to spend money on an out of the box framework.  I have the feeling they will somehow mess that up too. 



  • You think you have it bad? I just found an ASP.NET control that displays a simple, 2-column form...and every single item in the control is absolutely positioned. Were this all, it would merely be a web design no-no. But even better was that the items were out of order. So it looked something like this:

    
    <asp:Label ID="Label11" runat="server">Label for control A</asp:Label>
    <asp:Label ID="Label13" runat="server">Label for control B</asp:Label>
    ...some more elements...
    <asp:Label ID="Label15" runat="server">Label for control C</asp:Label>
    ...some more elements, maybe 50 lines down...
    <Control C>
    <Control A>
    ..some elements...
    <Control B>
    
    

    (formatted a bit to actually separate the items so they don't run on and on into each other)

    My guess is that the developer simply dragged items onto the designer and moved them around until they looked right. Which explains it, but doesn't excuse it.

    Okay, so you have it much worse. I just wanted to vent.


  • 🚽 Regular

    @CaptainCaveman said:

    Our illustrious team lead has a new wonderful idea he's implementing.  Once a piece of functionality goes through QA and passes (which amazingly does happen)  he is going back through the code base and flattening out the functions and related vars that were tested so that they take up one line.  Usually extremely long lines. 

    I pried an explanation out of him, he is trying to mimick 'code collapse' features you see on IDEs that will expand/collpase chucks of code by brackets.  Good thing I have an auto-format function, but even that wont get everything lined back up again when I have to go back and modify things due to ever-shifting requirements. *headdesk* 



    There is something to be said about removing whitespace from javascript files in order to reduce the filesize, which obviously the browser must download in order to run. Just compare the "debug" version of the Ext Source with the "collapsed" version. But his actual reason is a WTF that I simply can't wrap my head around.


  • @RHuckster said:

    There is something to be said about removing whitespace from javascript files in order to reduce the filesize, which obviously the browser must download in order to run. Just compare the "debug" version of the Ext Source with the "collapsed" version. But his actual reason is a WTF that I simply can't wrap my head around.

    There's also the whole "most (read: normal) people use an automated tool like ShrinkSafe to do it" instead of clobbering the actual source files and making them unreadable forever.

    Yah, definitely insane.



  • @bjolling said:

    @bullrider718 said:





    That's nothing.
    FTFY


Log in to reply