13,886 lines of code (206k) in one style sheet



  • This is so epic that I have to tell you all about it. The lead developer on my current project is VERY inexperienced, in fact, he has never developed a website before in his life. I was hired to try to help him get his project deployed. So far a couple of highlights

    •One style sheet for the entire website that is 13,886 lines long, 206k on disk.
    •One .aspx page with 5,556 lines of C# code in the code behind (.cs) file or 315k on disk.

    I am speechless. I have never seen or heard of anythinig like it. I have seen some fail projects and coding before but this has to be some kind of record. Is there a Guiness Book of World records for the largest style sheet ever? That *.css file is absolutely epic.     



  • @blackweb said:

    •One style sheet for the entire website that is 13,886 lines long, 206k on disk.
    All hand crafted or is it largely generated from other software?



  • @PJH said:

    All hand crafted or is it largely generated from other software?

    The code appears to be 100% hand crafted because the name of the *.css file does not match the name of anything else on the website. It appears that he just cut and pasted or retyped any style information generated in the source or designer view directly into this one style sheet. Each style appears to have been individually named. I dont think that the thought of breaking it up into separate files by page or categorizing it in any way ever ocurred to him.



  •  Clearly he is not the man for the job, and must be relieved of duty.



  • That's the biggest css file I've ever heard of, but the C# code is far from being the biggest I've seen. I've once seen a 2 megabytes .aspx file.

    The (wtf'y) justification for this monstruosity, given by its maker: "having the whole code in one single file makes using SourceSafe simpler for me".

    As to how it became so big, it was the code for a web site that didn't use any CSS, no code behind, and instead of using any ASP.NET controls besides the mandatory form, all the HTML was handled by appending strings and using Response.Write(). There was also a lot of javascript too, to handle the logic - C# was being used just to append strings.



  • It is likely that I will be relieved for pointing out the flaws in his code if I do not relieve myself first.  The computers we are using have Quad Core Xtreme processors but you can take a coffee break while the pages load in the designer.



  • [quote user="Renan "C#" Sousa"]all the HTML was handled by appending strings and using Response.Write(). There was also a lot of javascript too, to handle the logic - C# was being used just to append strings.[/quote] 

    There's a number of pages in some of our systems that is just like that. I once showed one of them to a new developer with a warning of "Do not do this".

    He asked "Where's the guy who coded it?"

    I told him "You're sitting in what used to be his chair."

    Good times.



  • @Lorne Kates said:

    He asked "Where's the guy who coded it?"

    I told him "You're sitting in what used to be his chair."

    On cold winter nights...you can still hear the screams...


  • @Lorne Kates said:

    [quote user="Renan "C#" Sousa"]all the HTML was handled by appending strings and using Response.Write(). There was also a lot of javascript too, to handle the logic - C# was being used just to append strings.

     

    There's a number of pages in some of our systems that is just like that. I once showed one of them to a new developer with a warning of "Do not do this".

    He asked "Where's the guy who coded it?"

    I told him "You're sitting in what used to be his chair."

    Good times.

    [/quote]

     I feel like the red-suited member of an ill-fated away team with a communicator in one and and a tri-corder in another screaming "BEAM ME UP NOW!".



  • @blackweb said:

    The lead developer on my current project is VERY inexperienced, in fact, he has never developed a website before in his life.
     

    Normally I'd make a case for "good guy who just didn't know there was a better way" but the documentation and tutorials on good CSS principles are so ubiquitous, I would call this a WTF if even my cat did this. Yes, my cat can't read english, but I think they have CSS tutorial in lolspeak nowadays.



  • @RHuckster said:

    Normally I'd make a case for "good guy who just didn't know there was a better way" but the documentation and tutorials on good CSS principles are so ubiquitous, I would call this a WTF if even my cat did this. Yes, my cat can't read english, but I think they have CSS tutorial in lolspeak nowadays.

    Somewhere, cooped up between the walls of a worn metaphor, a chimpanzee stoops over a typewriter. Ook, tap . . . ook, eek, tap, tap . . . Given enough time, a scientist explains, this chimpanzee will eventually bang out the works of William Shakespeare.

     He has been told there is a better way by myself and others who no longer work there (I wonder why?).   An even bigger WTF is that I have actually been told by management that I cannot change his code.   I can only suggest ways for him to change it.

     I am currently engaged in a self-prescribed theraputic exercise where I am reviewing the principles of Agile software development and how to apply them using Visual Studio 2010 and Team Foundation server 2010.  I am trying to remind myself that somewhere out there, there are in fact people who know how to make good software.



  • @blackweb said:

    @PJH said:

    All hand crafted or is it largely generated from other software?

    The code appears to be 100% hand crafted because the name of the *.css file does not match the name of anything else on the website. It appears that he just cut and pasted or retyped any style information generated in the source or designer view directly into this one style sheet. Each style appears to have been individually named. I dont think that the thought of breaking it up into separate files by page or categorizing it in any way ever ocurred to him.

    Just FYI, IE8 and 9 can spit out CSS files like that-- take an existing site, and tell it to dump the CSS, it'll (will/can?) create separate entries for every single selector without taking into-account inheritance.



  • @blakeyrat said:

    Just FYI, IE8 and 9 can spit out CSS files like that-- take an existing site, and tell it to dump the CSS, it'll (will/can?) create separate entries for every single selector without taking into-account inheritance.

     That is a good thing to know but in this case, I have confirmed that the *.css file in question was not generated but was hand written/pasted.   The reason given for putting everything into one file was "it seemed convenient at the time".


Log in to reply
 

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