|
More outsourced madness
Last post 02-13-2008 10:26 AM by Lysis. 34 replies.
-
02-12-2008 1:20 PM
|
|
-
Jonathan Holland


- Joined on 01-10-2008
- Posts 163
|
My company hired an outsourced "enhancement" team to add some ajax stuff to a few pages. Stuff that my team could have done, but didn't have the time/bandwidth. Its some of the worst code I've ever seen. Behold: if(document.getElementById('tdZipButton')!=null) { document.getElementById('tdZipButton').innerHTML=document.getElementById('tdZipButton').innerHTML.replace('id="zipCode_btnAjaxContinue"','id="zipCode_btnAjaxContinue" onclick="return CheckZipClick()"') document.getElementById('tdZipButton').innerHTML=document.getElementById('tdZipButton').innerHTML.replace("id='zipCode_btnAjaxContinue'","id='zipCode_btnAjaxContinue' onclick='return CheckZipClick()'") document.getElementById('tdZipButton').innerHTML=document.getElementById('tdZipButton').innerHTML.replace('ID="zipCode_btnAjaxContinue"','ID="zipCode_btnAjaxContinue" onclick="return CheckZipClick()"') document.getElementById('tdZipButton').innerHTML=document.getElementById('tdZipButton').innerHTML.replace("ID='zipCode_btnAjaxContinue'","ID='zipCode_btnAjaxContinue' onclick='return CheckZipClick()'") document.getElementById('tdZipButton').innerHTML=document.getElementById('tdZipButton').innerHTML.replace("id=zipCode_btnAjaxContinue","id='zipCode_btnAjaxContinue' onclick='return CheckZipClick()'") } Theres about 10 WTF's right there. Imagine seeing 300-400 lines like this.
|
|
-
-
Volmarias


- Joined on 07-14-2005
- Princeton, NJ
- Posts 402
|
Re: More outsourced madness
The Real WTF(tm) is that they could have simply written
if(document.getElementById('tdZipButton'))
|
|
-
-
Jonathan Holland


- Joined on 01-10-2008
- Posts 163
|
Re: More outsourced madness
How about not having to use GetElementById everytime they reference the element. Why are they using the parent Elements innerHTML property and replace method to change attributes on a child element. What horrible break in logic would make anyone think thats a good idea. Also, the child element DOES have a unique ID!
|
|
-
-
Lysis


- Joined on 09-13-2007
- Posts 236
|
Re: More outsourced madness
Jonathan Holland:My company hired an outsourced "enhancement" team to add some ajax stuff to a few pages. Stuff that my team could have done, but didn't have the time/bandwidth. Its some of the worst code I've ever seen. Behold: if(document.getElementById('tdZipButton')!=null) { document.getElementById('tdZipButton').innerHTML=document.getElementById('tdZipButton').innerHTML.replace('id="zipCode_btnAjaxContinue"','id="zipCode_btnAjaxContinue" onclick="return CheckZipClick()"') document.getElementById('tdZipButton').innerHTML=document.getElementById('tdZipButton').innerHTML.replace("id='zipCode_btnAjaxContinue'","id='zipCode_btnAjaxContinue' onclick='return CheckZipClick()'") document.getElementById('tdZipButton').innerHTML=document.getElementById('tdZipButton').innerHTML.replace('ID="zipCode_btnAjaxContinue"','ID="zipCode_btnAjaxContinue" onclick="return CheckZipClick()"') document.getElementById('tdZipButton').innerHTML=document.getElementById('tdZipButton').innerHTML.replace("ID='zipCode_btnAjaxContinue'","ID='zipCode_btnAjaxContinue' onclick='return CheckZipClick()'") document.getElementById('tdZipButton').innerHTML=document.getElementById('tdZipButton').innerHTML.replace("id=zipCode_btnAjaxContinue","id='zipCode_btnAjaxContinue' onclick='return CheckZipClick()'") } Theres about 10 WTF's right there. Imagine seeing 300-400 lines like this. What do you expect from a bunch of sand people? Have you seen them attempt simple html? I don't think they know what a close html tag is.
http://www.thebestpageintheuniverse.com
|
|
-
-
Jonathan Holland


- Joined on 01-10-2008
- Posts 163
|
Re: More outsourced madness
No need to be racist. I've worked with some excellent indian programmers. The good ones come here. The crappy ones tend to stay there. Here is my fix: var zipCodebtnAjaxContinue = document.getElementById('zipCode_btnAjaxContinue'); if (zipCodebtnAjaxContinue) { zipCodebtnAjaxContinue.onClick = CheckZipClick(); }
|
|
-
-
DOA


- Joined on 06-26-2007
- Posts 382
|
Re: More outsourced madness
Lysis:What do you expect from a bunch of sand people? Have you seen them attempt simple html? I don't think they know what a close html tag is.
Sand people? You do realise there are more than one places outside your little part of the world, right? It's not all sand populated with people that write bad code and hate you. I know that's all you see on the news, but somehow they have neglected to tell you that there are a few billion people out there going about their business. Hell, a lot of them are far more competent developers than you or me. I've studied with indian people during my Comp Sci degree and I can guarantee you they can do far more than close a HTML document
|
|
-
-
David O. Dilznick


- Joined on 11-16-2007
- Posts 2
|
Re: More outsourced madness
Jonathan Holland:Here is my fix: var zipCodebtnAjaxContinue = document.getElementById('zipCode_btnAjaxContinue'); if (zipCodebtnAjaxContinue) { zipCodebtnAjaxContinue.onClick = CheckZipClick(); }
TRWTF
|
|
-
-
Lysis


- Joined on 09-13-2007
- Posts 236
|
Re: More outsourced madness
DOA: Lysis:What do you expect from a bunch of sand people? Have you seen them attempt simple html? I don't think they know what a close html tag is.
Sand people? You do realise there are more than one places outside your little part of the world, right? It's not all sand populated with people that write bad code and hate you. I know that's all you see on the news, but somehow they have neglected to tell you that there are a few billion people out there going about their business. Hell, a lot of them are far more competent developers than you or me. I've studied with indian people during my Comp Sci degree and I can guarantee you they can do far more than close a HTML document I'm sure there will be plenty of people who will tell me about the few Injuns they know who are really goood good coderz!!!!1!!! We all know that stereotype comes from truth. Using your scenario, you do realize that outside of those few Injuns you have interacted with that there are millions of crappy coding dirty ones out there too that fit my description of them.
http://www.thebestpageintheuniverse.com
|
|
-
-
Jonathan Holland


- Joined on 01-10-2008
- Posts 163
|
Re: More outsourced madness
Lysis:I'm sure there will be plenty of people who will tell me about the few Injuns they know who are really goood good coderz!!!!1!!! We all know that stereotype comes from truth. Using your scenario, you do realize that outside of those few Injuns you have interacted with that there are millions of crappy coding dirty ones out there too that fit my description of them.
Perhaps, but I have the ability to not be a total douchbag about it.
|
|
-
-
Ragnax


- Joined on 02-01-2007
- Posts 55
|
Re: More outsourced madness
Jonathan Holland:No need to be racist. I've worked with some excellent indian programmers. The good ones come here. The crappy ones tend to stay there. Here is my fix: var zipCodebtnAjaxContinue = document.getElementById('zipCode_btnAjaxContinue'); if (zipCodebtnAjaxContinue) { zipCodebtnAjaxContinue.onClick = CheckZipClick(); }
Might want to remove the parentheses after CheckZipClick there. If I'm not mistaken, your current solution assigns the result of the evaluation of the function CheckZipClick to the onClick event handler, rather than the function itself.
|
|
-
-
Jonathan Holland


- Joined on 01-10-2008
- Posts 163
|
Re: More outsourced madness
Yeah, actually I typed that into this editor here. The actual code fix I used replaced CheckZipClick with an anonymous function closure. ie: zipCodebtnAjaxContinue.onclick = function () {
// Do the zipcode stuff. } ;
|
|
-
-
SuperousOxide


- Joined on 01-30-2007
- Posts 183
|
Re: More outsourced madness
Lysis:I'm sure there will be plenty of people who will tell me about the few Injuns they know who are really goood good coderz!!!!1!!! We all know that stereotype comes from truth. Using your scenario, you do realize that outside of those few Injuns you have interacted with that there are millions of crappy coding dirty ones out there too that fit my description of them.
And while you and the people you know might be "really goood good coderz", for every one of those there are a ton of crappy coding dirty Americans and Europeans as well. You might as well respond to every other thread on this board with. "What do you expect from a bunch of crackers?"
Grow up
|
|
-
-
MasterPlanSoftware


- Joined on 11-10-2006
- Posts 108
|
Re: More outsourced madness
SuperousOxide:You might as well respond to every other thread on this board with. "What do you expect from a bunch of crackers?"
That is pretty likely to happen now. Thanks for giving him the suggestion.
|
|
-
-
Lysis


- Joined on 09-13-2007
- Posts 236
|
Re: More outsourced madness
MasterPlanSoftware: SuperousOxide:You might as well respond to every other thread on this board with. "What do you expect from a bunch of crackers?"
That is pretty likely to happen now. Thanks for giving him the suggestion.
SuperiousOxidous has a great idea!
http://www.thebestpageintheuniverse.com
|
|
-
-
Lysis


- Joined on 09-13-2007
- Posts 236
|
Re: More outsourced madness
SuperousOxide:for every one of those there are a ton of crappy coding dirty Americans and Europeans as well. I like to refer to those people you describe as "black people."
http://www.thebestpageintheuniverse.com
|
|
-
-
belgariontheking


- Joined on 08-20-2007
- Cincinnati, OH, USA
- Posts 1,365
|
Re: More outsourced madness
Lysis: MasterPlanSoftware: SuperousOxide:You might as well respond to every other thread on this board with. "What do you expect from a bunch of crackers?"
That is pretty likely to happen now. Thanks for giving him the suggestion.
SuperiousOxidous has a great idea! And the point of your existence is what, exactly?
I guess I'm back.
Please continue to spam the addresses below.
PLEASE SPAM: jtobin@ohioinstituteofhealthcareers.edu jtobin@ohiobusinesscollege.edu
|
|
-
-
Lysis


- Joined on 09-13-2007
- Posts 236
|
Re: More outsourced madness
belgariontheking: Lysis: MasterPlanSoftware: SuperousOxide:You might as well respond to every other thread on this board with. "What do you expect from a bunch of crackers?"
That is pretty likely to happen now. Thanks for giving him the suggestion.
SuperiousOxidous has a great idea! And the point of your existence is what, exactly? The same reason you post here?
http://www.thebestpageintheuniverse.com
|
|
-
-
-
MarcB


- Joined on 10-24-2006
- Posts 511
|
Re: More outsourced madness
Jonathan Holland:replace method to change attributes on a child element. IE's particularly borked and refuses to let you change or set attributes on elements, usually at random. Doing x.setAttribute('attribute', 'value') works for some, but fails for others, while doing "x[attribute] = 'value'" works/doesn't work for yet another set. Sometimes it's just easier to rebuild the tag using innerHTML, even if it isn't "best practices".
-- Never play leapfrog with a unicorn
|
|
-
-
Jonathan Holland


- Joined on 01-10-2008
- Posts 163
|
Re: More outsourced madness
setAttribute('click',somefunction); or element.onclick = somefunction; Works just fine in IE. There is no excuse for this.
|
|
-
-
ObiWayneKenobi


- Joined on 03-23-2007
- Posts 142
|
Re: More outsourced madness
Lysis:What do you expect from a bunch of sand people? Have you seen them attempt simple html? I don't think they know what a close html tag is. <IgnoreBlatantRasicm> Sand people? I didn't know people outsourced to Tusken Raiders nowadays! </IgnoreBlatantRacism>
The Daily WTF Forums. You will never find a more wretched hive of scum and villainy.
|
|
-
-
Jonathan Holland


- Joined on 01-10-2008
- Posts 163
|
Re: More outsourced madness
You are living up to your name wise Jedi. Personally, when I think of India, I think of humidity, monsoon rains, and jungles...I don't think of deserts. Lysis, perhaps both a Political Correctness class and a Geography class should be required?
|
|
-
-
Cap'n Steve


- Joined on 09-07-2006
- Posts 456
|
Re: More outsourced madness
ObiWayneKenobi:Sand people? I didn't know people outsourced to Tusken Raiders nowadays!
But just picture an Indian standing up in his cubicle, holding his keyboard above his head and doing that grunt.
|
|
-
-
joe17301


- Joined on 02-01-2008
- South Korea
- Posts 13
|
Re: More outsourced madness
Jonathan Holland:You are living up to your name wise Jedi. Personally, when I think of India, I think of humidity, monsoon rains, and jungles...I don't think of deserts. Lysis, perhaps both a Political Correctness class and a Geography class should be required?
I think a severe thrashing with the clue stick would be more to the point. That, or being mauled by a bear. Him/her/it and all his/her/its "grate coader" friends.
"Since this post has no replies no children will be deleted"
|
|
-
|
|