WTF transforms into hate and pain..



  • I have just received a new assignment. It's a little long so bear with me.

    A little background:
    The largest and most reputable manufacturer of SOME product in the world, is globalizing their site and so is launching the "other countries" option. By "other countries they mean, anything that is not U.S.A".
    Their products are used by millions of people, because they are reliable and proved to be the best. Hell, I own one of their products and can say it's just amazingly good.
    Of course the "other countries" website is run by the "overseas" divition which is basically another company with the import rights of their product in Europe. This are the ones to blame.

    My mission:
    Help some overwhelmend little company to speed up the translation of the sites which is already overdue it's deadline.

    Here is what I found:
    For "SEO sakes", each language is a separate physical subdomain with the following content inside.

    - 125 folders directly in the www/ directory.
    No images folders, or includes, or languages, or anything like that. They have folders with names like am, cir, cok, dt, etc... I have not dared to check what is inside most of them.

    - Product images and even generic images.. are repeated on every language. I'm talking about hundreds of products with about a dozen different images each.

    - Almost 200 php files also directly on web root.

    - There is only one include on each and all of them. And that is to a database connection. Nothing more.

    - Your typical javascript dropdown menu with lot of options and suboptions (including products which are stored in the database) is hardcoded in every single file, 320 lines of tr td and javascript. Yes the javascript is also repeated on each file.
    When a product has to be removed from the menu.. well go ahead search and replace 200 files for each of the 4 languages..

    - They have one CSS file included in each page, but most of the pages have their own overiding and often repeated css rules embedded in them.
    (Marketing guy: "OK let´s change the color and size of the font, have fun")

    - DOCTYPES and proper html heading are missing in lots of the files.. There goes the SEO ambitions.

    - The Mysql queries are redundant repeated many many times, searching the same tables and fields every time.
    I haven't even looked at the database yet and the tables and row names on the queries are already starting to look like the gates of hell.

    - The result pages after a search are the same cloned file with a different name depending on what you searched for. So if you search for Apples.. then you go to APPLES-results.php.. which is exactly the same page as SOMEPHALICFRUIT-result.php, which all have the whole code in them. It's not a wrapper with a search-result.php included

    - There are hundreds of IF ELSE all around doing the same the same thing over and over..
    There is even some ASP commented inside the php files..

    Now remember.. this is x4.. one for each language.  

    I really want to cry..
    I got a migraine attack after going over this... and sadly it's not a thing I say to be funny... I really want to cry. My head hurts.. Dihydroergotamine is not working.. I've thought of trepanating (is that a word?) myself.

    I'm by no means free from WTF´s.. I have done plenty... because I'm not a real programmer. I was more of a html-css-flash guy who had to do some php-actionscript-mysql, fetch this put in there, in order to survive. But I mean, I will never let a WTF get this big.  If I feel I'm over my head I go get some help.
    You don't have to be a programmer to know that there is something really wrong with this approach.

    Oh God.. help me.



  • It's at times like these I start fantasizing that the Report Abuse button
     will get you psychiatric help...



  • @fatdog said:

    I've thought of trepanating (is that a word?) myself.

    Yes.



  • 10 Stages during employment at a WTF company. 

    1) You discover this immense disaster of a website

    2) You think maybe there's a reason behind all this, better check the code again to see if you didn't miss the real beauty inside the code.

    3) You realise the website is a complete WTF'ery and get depressed at the mere thought of having to edit/maintain it, or even come close to it.

    4) You try to find people that also think that the whole system is a WTF, you find noone, in fact, they all think it's implemented properly. You are simply a nit-picker.

    5) You start divising a plan on nullifying the WTF'ery - refactoring the whole thing until you at least have some hope of salvation and pride in your job, even if it has to be done in your spare time.

    6) After starting to refactor a few basic things, you realise that everything is intertwined up to a stage that there's no way you can remove the WTF'ery.

    7) You're getting deperate and start writing spaghetti too, only it breaks your heart to do so.

    9) You're getting immensely disgruntled

    10) You quit

     

    I suggest you simply fast-forward to stage 10 :) 



  • Stage 8 can be filled in freely (with a weapon of choice).



  • Oh, trust me.. if I had to maintain this stuff on daily bases I would skip to step #10 in a split second. Maybe stopping in number 8 with a machete.. or the power drill I used to trepanate myself.

    The company I work for, is just doing a "by the hour favor" for another company that can't handle the whole thing by themselves.

     

    @GuntherVB said:

    10 Stages during employment at a WTF company. 

    1) You discover this immense disaster of a website

    2) You think maybe there's a reason behind all this, better check the code again to see if you didn't miss the real beauty inside the code.

    3) You realise the website is a complete WTF'ery and get depressed at the mere thought of having to edit/maintain it, or even come close to it.

    4) You try to find people that also think that the whole system is a WTF, you find noone, in fact, they all think it's implemented properly. You are simply a nit-picker.

    5) You start divising a plan on nullifying the WTF'ery - refactoring the whole thing until you at least have some hope of salvation and pride in your job, even if it has to be done in your spare time.

    6) After starting to refactor a few basic things, you realise that everything is intertwined up to a stage that there's no way you can remove the WTF'ery.

    7) You're getting deperate and start writing spaghetti too, only it breaks your heart to do so.

    9) You're getting immensely disgruntled

    10) You quit

     

    I suggest you simply fast-forward to stage 10 :) 



  • Maybe you could start a company in trepanation. Release the evil!

     
    No trepanation, No salvation! 



  • @GuntherVB said:

    10 Stages during employment at a WTF company. 

    1) You discover this immense disaster of a website

    2) You think maybe there's a reason behind all this, better check the code again to see if you didn't miss the real beauty inside the code.

    3) You realise the website is a complete WTF'ery and get depressed at the mere thought of having to edit/maintain it, or even come close to it.

    4) You try to find people that also think that the whole system is a WTF, you find noone, in fact, they all think it's implemented properly. You are simply a nit-picker.

    5) You start divising a plan on nullifying the WTF'ery - refactoring the whole thing until you at least have some hope of salvation and pride in your job, even if it has to be done in your spare time.

    6) After starting to refactor a few basic things, you realise that everything is intertwined up to a stage that there's no way you can remove the WTF'ery.

    7) You're getting deperate and start writing spaghetti too, only it breaks your heart to do so.

    9) You're getting immensely disgruntled

    10) You quit

     

    I suggest you simply fast-forward to stage 10 :) 

     You may laugh at me, but a month ago I started a new project - a long-term contract for a HUGE insurance company. At first I was terribly excited - at last something more meaningful than building MSIs for someone else's application. I spent the first week waiting for all the software I would eventually need, the second week - analyzing the current state of the system. It was during that second week that I went through stages 1 to 5. Currently I'm at #9. Extrapolating - it wouldn't take much longer to reach #10.



  • >I've thought of trepanating (is that a word?)

    It's actually 'trepanning', though 'trepanating' sounds better to me :P



  • I'm going through the same stages here, for the third time this year.  I've been given some "working" software, thousands of lines of very shaky code that only works by the grace of all the Gods and Goddesses working together, and even then only some of the time.  Latest discovery-- the data files are 2,000 times larger than needed.

     Sigh.

     

     

     



  • @fatdog said:

    I've thought of trepanating (is that a word?) myself.

    Ah, yes...there's nothing like self-imposed uncomfortability.



  • @GuntherVB said:

    Maybe you could start a company in trepanation. Release the evil!

     
    No trepanation, No salvation! 

    I know just the ticket.

    Unrelated, but I think it fits in here



  • What exactly is WTF software??

    Since there so much WTFy software out there...

    How do you seperate WTF from non-WTF when all that is left is WTF???

    Maybe WTF is becoming an standard? A W3 standard? Or an ECMA standard?

     

    Right now I am working on a website, that was built with tools that are renowned for their 3-Tier Architecture software dev approach.

    But there is Presentation Logic all over the supposed Business Logic layer... And that actually makes sense because the only thing you can pass between the Presentation Layer and the Business Logic layer are strings!

    To me it seems like an Logic WTF.

     



  • What! Localizing a site by copying all the files and translating them one by one is standard procedure! Just make sure you don't forget to translate the names of files, variables and functions too!

    But in all seriousness, my condolences. I do web applications myself and have felt the abysmal pain of spaghetti PHP. :(
     



  • Here is a nice, simple, easy and maintainable way to make dynamic metatags for SEO.  

    switch($_GET['PROD_ID']){
        case "0001":
            $titlepage = "Title page";
            $descriptionpage = "Some description.";
            $keywordspage = "keywords, keywords, keywords";
            break;
        case "0002":
            $titlepage = "Title page";
            $descriptionpage = "Some description.";
            $keywordspage = "keywords, keywords, keywords"
            break;    
            
    etc...  (about 300 lines more of this).

    There are currently Forty something products in one category only.
    This code is hardcoded with some variations (language, product category, site section, etc) into each and every page of the site. I REPEAT into each and every page of the site. Which are above 200 x 5 languages (I forgot to count English in the first post).

    I will hate to be the guy that has to update the site when it's time to add a new product, or change, translate keywords..
    Oh wait a minute.. that's me...

    May the whole weight of the spiked hammer of divine justice fall upon the heads of those guilty of this unholly evil sin...
    May the evolution work it's way and prevent any descendants from this people..
    God have mercy on their souls.. but do not be gentle with their bodies..



  • Jesus... christ...

    Even *I* don't produce such code.

    Maybe we should invoke an Programmers Drivers License ??



  • @Ice^^Heat said:

    Jesus... christ...

    Even *I* don't produce such code.

    Maybe we should invoke an Programmers Drivers License ??

     There's been talk now and then that it might be good to force developers to be licensed. Architects, realtors, doctors, nurses, teachers, they all do it.

     That, however, doesn't necessarily ensure that something like this wouldn't happen.



  • @webzter said:

    @Ice^^Heat said:

    Jesus... christ...

    Even *I* don't produce such code.

    Maybe we should invoke an Programmers Drivers License ??

     There's been talk now and then that it might be good to force developers to be licensed. Architects, realtors, doctors, nurses, teachers, they all do it.

     That, however, doesn't necessarily ensure that something like this wouldn't happen.

    It won't, because people don't see software development like that - after all, it's just some boxes on a screen - how hard can it be?

    Nobody would get Little Jimmy from down the street to design their new office building, sell their house, or perform a triple heart bypass operation, or even work as a teacher. However, for a significant number of people, he's a perfect candidate for putting together their company's website. 



  • What about Degrees? And Certification by Microsoft, Sun etc.



  • @Ice^^Heat said:

    What about Degrees?

    AHAHAHA.

    @Ice^^Heat said:

    Certification by Microsoft, Sun etc.

    That may be something, but as it currently is, getting certified costs a decent penny, and usually you take it when you're already in the business for a while. There are no real Beginner's certificates.

    In addition, MS and Sun certs would obviously only be for MS and Sun technology. There is no such authority for PHP. (but if there's going to be one for a language like, say, Ruby or Perl or Python, and it takes off, then perhaps PHP may one day be forgotten).



  • What about common sense? Does that thing exists? Or is it just a myth?



  • To me it looks a bit like generated content. Maybe there are some master templates and a script that create all those copies at once?



  • @ammoQ said:

    To me it looks a bit like generated content. Maybe there are some master templates and a script that create all those copies at once?

    Yea well I thought about that.. the top menu WAS most likely template generated, and maybe the stylesheets (which are a whole WTF on their own), but trust me, most of the php code is not. You can see so many inconsistence in them that it's almost artistic.. like a multiartist collage.

    Otherwise I wouldn't be changing table names in database queries, translating static text, changing the meta tags, etc..  one by one on each language page.

    And if it used a master template and a script... where is it now to generate all the updated copies?

    And why different or missing DOCTYPES on the headers? It doesn't seem very template like. 

    I think that the original site in english, was most likely migrated from a classic ASP-Access to php-Mysql.. and then patched and repatched, and so it grew without any control system or documentation, probably with many "coders" jumping in and out the boat over time.

    Then when it was time to Globalize, they just copied the English site into four other languages multiplying all the troubles with the original site, instead of doing some redesing work to save later troubles.



  • @fatdog said:

    What about common sense? Does that thing exists? Or is it just a myth?

    Common sense is what tells you that the world is flat. It is almost never useful in software engineering. Far too many things work in unexpected ways - and I'm not talking about bad software, I'm talking about the underlying math, so this will never change. 



  • @fatdog said:

    @ammoQ said:

    To me it looks a bit like generated content.
    Maybe there are some master templates and a script that create all
    those copies at once?

    Yea well I thought about that..
    the top menu WAS most likely template generated, and maybe the
    stylesheets (which are a whole WTF on their own), but trust me, most of
    the php code is not. You can see so many inconsistence in them that
    it's almost artistic.. like a multiartist collage.

    ...

    I
    think that the original site in english, was most likely migrated from
    a classic ASP-Access to php-Mysql.. and then patched and repatched, and
    so it grew without any control system or documentation, probably with
    many "coders" jumping in and out the boat over time.

     

    These two things usually go together. The original designers use a sane template system and autogenerate everything. A few rounds of cost-cutting later, it's being worked on by some moron with a liberal arts degree, who has never heard of templates but does see a large number of files on the server and just starts editing them by hand. Not exactly a WTF, it's just the result of giving a complicated job to a person with no conception of how to get it done.



  • Wow. I'm impressed.

    There's only one way of "helping" out the situation, and I really hope that you can argue your case and convince the management to do the right thing. The project is already way behind schedule, on the entirely wrong track, and overrunning the costs. Throwing more money and more manpower at the project isn't going to make it work, it will just mean more cost overruns and even more behind the schedule.

    The only correct option is to scrap the project. People are naturally opposed to this, because it's seen as failure, but it's really damange control and the right thing to do because the alternative would be the true failure.

     Start over with a reasonable design and develop a new site or internationalize all strings in the current page and then translate the language/ string table. If you don't abort now, you'll end up like the US NAvy with their automated financial system which was finally cancelled after 4 years and $230 million spent (initial estimate ~$6 million). The projections at that time were an additional 5 years of development time and cost of $500 million,

     You can pick up any book on software enginnering to argue your case if you fall on deaf ears.
     



  • @Nandurius said:

    Wow. I'm impressed.

    There's only one way of "helping" out the situation, and I really hope that you can argue your case and convince the management to do the right thing. The project is already way behind schedule, on the entirely wrong track, and overrunning the costs. Throwing more money and more manpower at the project isn't going to make it work, it will just mean more cost overruns and even more behind the schedule.

    The only correct option is to scrap the project. People are naturally opposed to this, because it's seen as failure, but it's really damange control and the right thing to do because the alternative would be the true failure.

     Start over with a reasonable design and develop a new site or internationalize all strings in the current page and then translate the language/ string table. If you don't abort now, you'll end up like the US NAvy with their automated financial system which was finally cancelled after 4 years and $230 million spent (initial estimate ~$6 million). The projections at that time were an additional 5 years of development time and cost of $500 million,

     You can pick up any book on software enginnering to argue your case if you fall on deaf ears.
     

    I did told my boss about the whole thing. And he insisted on your point exactly, (and he is "just" a graphic designer, but he was burned many times and now knows better). 

    But the thing is that we were hired as an extra hand, by the shop that was hired by the SEO* company that was hired by the representatives of the international rights to the brand. (Confused?) So we have no voice on this.

    The guys that hired us, budget for the project was supposed to be 300 man/hrs.. They have already done more than 800 and can't see the end of the tunnel, so that's why we were called.

    They do that a lot (call us when they can't handle the heat), so they are actuall y pretty good customers. The funny thing is that they are suppossed to be an "advanced web and multimedia solutions shop". And we are just a mom and pop old school paper design & print shop that grew a html-php-flash programmer (that's me) to do simple sites (catalogs, newsletters, etc) for some of the same companies that hire us to print their stuff.

    This is the biggest screw up we have gotten from them. I don't know whose fault it is.. but I'm guessing this seems to be a chain reaction of screw ups. One person alone cannot do this.

    *This SEO company are the kind that charges you 3000 Euros to run a w3.org validator, then give you a document with exactly the same things you can find in any SEO article (which a lot of times are very cuestionable), and maybe add google analytics to a website. You want keywords suggestions? That be an extra couple of grands there.

    Sorry for the rant, now it's out of my chest.

     

     



  • @Rycochet said:

    It's at times like these I start fantasizing that the Report Abuse button
     will get you psychiatric help...

    That would finish you...



  • @webzter said:

    @Ice^^Heat said:

    Jesus... christ...

    Even *I* don't produce such code.

    Maybe we should invoke an Programmers Drivers License ??

     There's been talk now and then that it might be good to force developers to be licensed. Architects, realtors, doctors, nurses, teachers, they all do it.

     That, however, doesn't necessarily ensure that something like this wouldn't happen.

    True...how could you ensure when the system is established that it isn't run by the very people you are trying to prevent getting a license (or creep into the system later for that matter)?


Log in to reply