- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
I had a friend who used to work for a very, very large medical equipment company (if you've been in a hospital in the last twenty years, anywhere in the world, the odds are even that you were relying on something this company made so you wouldn't die.)
Right before he left, they started getting really, really into "process," and ISO-certification-on-steroids, etc. His manager said, with absolute sincerity:
"If you have a good enough process, you don't have to have good workers, because as long as they follow the process you'll get good results."
Keep in mind that my friend worked in the engineering design department, not, for instance, the assembly line or the building-maintenance office. (Not that good workers aren't important at all levels.)
And people wonder why I would rather suffer than go to the hospital.
M
Admin
Around 2001, I worked with an overseas development team that had utterly convinced themselves that there was something fundamentally wrong with the PowerPC architecture because it could not support a simple linked list traversal without crashing, so they were writing elaborate workarounds to avoid using a simple linked list of structures in C.
The real answer was that they were using some kind of compiler flag on their Windows builds that automatically zeroed all allocated memory, and came to rely on this without even knowing that it was not standard behavior.
Don't get me started on the guy who configured the CodeWarrior linker to suppress all multiple definition warnings, and then wondered why he got strange results.
Yep, they were a bargain, and that's why I got paid to rewrite every line.
Admin
Just like the major antivirus company I used to work for, I pointed things like this out to a VP, and his response was that the off-shore (not contracted, they were employees..) had added over 500k lines of code. I tried to say that LOC/SLOC is no way to measure quality or progress, but that fell on deaf ears.
Admin
Regarding the "mil spec" memory wiping:
You know, the funny thing about that is if you don't use those values again later the compiler is perfectly free to optimize them away.
A test with gcc 4.1.3 and -O2 shows the entire loop is gone.
Older GCC (3.4.6) with -O2 just removes the second assignment, but keeps the outer loop. The inner loop is gone.
Admin
I think maybe he thought that was multi-threading or parallel processing? You know, doing the same thing twice.
Admin
I think with a few exceptions the comments on this thread are pretty level-headed, expressing disdain at the horrible logic of offshoring the work to the lowest bidder, especially on the flawed premise that the amount of time it will take to make it work has no value (and that the problems might be made better on successive rewrite iterations).
But yeah it's all too easy to associate the offshoring with a race of people and wind up being racist against them. Especially if you don't know any Indian people (or live somewhere that isn't known for its diversity) and it seems like an especially foreign concept to you.
Admin
Admin
I see this company is a believer in the "infinite monkeys" theory, so when applied to programming, if inifinite monkeys were given infinite time to write a program, could they eventually come up with code that could pass a unit test? Well if the time is infinite, perhaps the next MS Windows isn't too much to ask for :-)
Admin
often these memory-erasing routines were coded in assembler or machine code to avoid any compiler interface. Yeah, there were/are legitimate reasons for doing it because sometimes residual patterns in the computer can be detected from a good distance away. It's like using a router with the default password. Everything you do is public.
Google "TEMPEST" from eskimo.com if you want to get really paranoid. The mil spec guys are paid to be paranoid and they're damn good at it.
Admin
Admin
I think you just gave an umpteenth proof that operator overloading is evil :)
Admin
So wht's the purpose of this article?
wtf of CODE snippet or wtf of outsourcing.
In my 9+ yrs of corporate client's systems development, i have seen this kind of bullshit code written by so called "native" here.. so don't show your frustration by finding out these kind of code.
If your purpose is to show only "CODE" .. then u better change your way of writing article.
In end, all i can say.. "shallow" article on deep code.
Admin
Oh yes, very deep.
Admin
Admin
It's a shame you can't outsource middle management at a discount.
Admin
int j = int.Parse(i.ToString()); // provides deep copy of j
Actually, there would be a temporary string variable with the formatted copy of the value of i (that is, the to be value of j), and that string would be placed deep in the stack. You couldn't do it better.
Ok, what's my prize?
Admin
If you declare 'memory' as volatile, gcc 4.1.2 with -O2 keeps the outer loop (as expected) and unrolls the inner loop.
Admin
LOL.. Outsource middle management and bring back programming here. That would be interesting to read blogs, comparing notes before and after.
But
Admin
that's not right!! it's not like u go online dating at, say _ MILLIONAIRELOVES.COM _ with the thought of if this girl doesn't work out, i can always find the next one! that's very possible and not that costly!!
Admin
"If you have a good enough process, you don't have to have good workers, because as long as they follow the process you'll get good results."
This could be called the Redundant Array of Inexpensive Programmers theory of project management.
Admin
Racists, all of you.
Admin
It may be valid Java. We don't know what type i is. If i is an Integer wrapper object, then this will work (sadly).
Admin
Basically, they're haraam-zaade maan ke lodey.
Admin
I saw something similar once from an offshore developer. This was in a Java 1.4 (pre-Java 5) environment.
Admin
That's not voodoo. That's Deep Magic!
Admin
The answer to your question, of course, is yes. The code is an obvious WTF, but the whole concept of of outsourcing to India/China/Russia/Elbonia runs contrary to a very basic principle of economics which is "you get what you pay for".
The ability to create clean functional code knows no borders, but comes at a fairly uniform cost. Good programmers in India, for example, are now being paid wages much closer to their American counterparts. This is a natural result of the global demand for good programmers.
Poor code, however, the type we are having fun with here, does come at a much lower cost from outsourced suppliers than from American labor who continue to demand a higher wage than their incompetent counterparts in other countries.
The greater WTF here, is that companies are willing to tolerate the poor quality code, simply because it is attached to a lower price tag, with no regard for the greater overall costs that are imposed by this choice.
As companies continue to become more familiar with the total cost of outsourcing I expect to see a commensurate increase in good 'ol American WTF's.
--Lego
Admin
I think the point of the article is a company cannot simply outsource to the lowest bidder and expect quality. You know the lowest bidder will cut corners to make his profit. I'm sure that cutting corners includes hiring less than experienced people and expecting them to produce.
I've seen plenty of garbage like this in my career. Most of it was introduced by new grads/interns who were tasked with developing something beyond their abilities and experience by a company that wanted to save a couple bucks. The problem here is the belief by management that all programmers are created equal (ignoring experience) and that employee self-development/mentoring is not important.
Admin
Well, an interesting use of a computer was to generate music without a soundcard or any digital to analog converters. In the Altair days, there was a program that would play "Daisy" if you ran it on the Altair and held a radio close by.
So it isn't exactly paranoia, since people were using it for "useful" tasks. Though these days, the sheer number of computers makes it difficult (but not impossible, mind you) to actually single out the signal from one particular computer.
Heck, a lot of cryptographic implementations can be broken by observing things like CPU power utilization (and being able to extract bits from the key this way). But this requires physical access...
Admin
True, but i think the int.Parse(..) would also fail.
And thanks for all the c# replies.
Admin
no, i'd feel much safer with:
Int32 j = System.Convert.ToInt32((String)Int32.Parse(i.ToString(CultureInfo.InvariantCulture), CultureInfo.InvariantCulture).ToString(CultureInfo.InvariantCulture), CultureInfo.InvariantCulture);
Admin
I thought for sure this was the company I used to work for (complete with teams of developers in faraway lands), but then I realized it was deep copying ints. That's not nearly enterprisey enough, we deep copied XML, see:
Document doc2 = Document.parse(doc1.getString());
The need to copy ints never really arose, thanks to the universality of XML- we could use documents throughout the system!
Admin
He ought to be sending it to a deep copy SOAP service, not doing this in-process data conversion... that's the real WTF.
Admin
Believe it or not, that was the way pushed by Microsoft when they came out with their amazing :rolleyes: "For XML" functionality in SQL Server. Dumbest implementation of XML in a database ever.
Admin
You're not thinking big enough: cast it to a string, wrap it up in a SOAP request, post it to a web service, which writes it to a database, then read back using another web service (via another SQL query), parse the returned XML, extract the required field, and run int.Parse() on that.
Admin
This person speaks the truth.
Admin
Actually I was thinking of having a t-shirt made "Participant in Cargo Cult Programming" with the picture of a guy with an old Apple II strapped to his head.
Admin
More like a volatile copy of i on the processor stack.
Admin
Yeah that's a good name for it. Blew the database from 1.5gb to 30+gb in one shot. Plus it adds another 2-3gb per month just in empty rows, i.e. no data just XML docs containing nothing but column/field names.
Then there's XQuery.
Admin
Use the IntParse in Utils.cs instead. It leverages public static double Add(double[] valueArray) to build the integer one digit at a time with minimal rounding error.
Admin
Add on to that the fact that companies think that they can get away with paying less for outsourced labor simply due to differing costs of living. Indian and Russian labor laws and market policies are severely restricting on business so the best jobs are invariably overseas for them. The best and brightest invariably migrate to wealthier countries with higher paying jobs available and only the worst stay behind. I believe that the phenomenon is called 'brain-drain,' and it explains that while India has one of the lowest GDP's per capita in the world, the Indian American population is one of the most successful and affluent demographics in the United States, surpassing native Whites by a wide margin.
In short, I don't see how this is racist at all.
Admin
The previous was in response to this.
Admin
At my last employer, I "inherited" several forms full of gems like this from the programmer that had just left. My justification for redoing them all came early on when I found the following line of code: s = "Report Title".ToString.Trim
Admin
huh... is this sarcasm or have I just forgotten all of the first year in CS??
Admin
Admin
Admin
This is the shallowest analysis ever. One has to go slightly deeper than that. One cannot simply attribute India's low per capita GDP to brain-drain. I'll leave you with a few reasons. (1) high rate of population growth (2) socialist policies founded in the past (3) diversion of India's resources, raw materials, etc to England in the 200 years of British rule causing India's GDP share in the world to lower from 25% when they arrived to less than 1% when they left; to enrichment to England and improvishment of India.
With such attitudes and ignorance prevailing, is it any wonder that the author of this blog can make generally disparaging statements about an entire nation and get away with it?
Admin
No buttwad, India is in the Northern hemisphere on the other side of North America - the Southern Hemisphere contains Africa, a very small part of South East Asia, Australia, New Zealand and South America (I've excluded Antarctica, but hey, maybe that's where you were suggesting this code was written).
If you're going to make an insult get it right... either you are insinuating that this code was written by India/China/Vietnam/??? or it was written in one of the above mentioned areas - and apart from Malaysia or a dodgy con job in Nigeria, not too much gets outsourced to this direction.
Admin
Nope, integers have a maximum value, so to be on the safe side we can't write any numbers greater than 9.
The above must be:
int i = int.Parse((int.Parse(2.ToString()) * int.Parse(5.ToString())).ToString() + 2.ToString()) // i is deep copy of 12.
Admin
One word: volatile
Admin
It just seems mind boggling that kids spend thousands on degrees to become programmers only to graduate and have to turn around and actually learn to program. WTF? </rant>