CopyAndPasteProgramming at Web Speed. The promised age of DistributedSystem''''s is upon us, and there is much rejoicing. It works like this: * I have a '''PROBLEM'''. ** ''(In other words, I have some WORK that someone wants me to do in my programming JOB. ;-)'' *** but if someone has already solved the problem, why reinvent the wheel? * Google some of the key words that seem to be related to it. ** And/or use GoogleCodeSearch to find working source code from a non-closed-source project. * Copy this code, and paste it into the production source code somewhere. * Tweak it a bit, until it seems to work OK. ...at least most of the time. ** ''(Or to get a bit more precise and technical, "Tweak it until no one can clearly and easily demonstrate that it does NOT work.")'' * '''''SHIP IT!!!''''' * Take lots of credit for being so clever. * '''Run away from the problem(s).''' ** ''...because we all really have much better things to do than waste our time at work doing dull, tedious and boring WORK, don't we?!? ;->'' Anyone else HaveThisPattern? ''"PROBLEM"? I thought it was a career!'' --PhlIp Also known as PostModernProgramming. ---- Re: "if someone has already solved the problem, why reinvent the wheel?" ''If someone else '''on this project''' has already solved this problem '''in this code base''', then we should reuse the code.'' ''Also, while a good example can be very helpful to the learning experience, tweaking code you don't understand until it's so confused that you can no longer see where it might fail isn't a very good approach for producing reliable solutions.'' ---- ''A variant of CopyAndPasteProgramming'' - ---- This backfired on me once. I had a web-based app with a typical CRUD form. It had a spot to enter a date range. I had server-side validation for these dates and it was simple because the app language provided a date validation routine out-of-the-box. However, the customer wanted client-side validation also. I couldn't find a reliable built-in JavaScript function, so instead combed the web for one, and found such a critter. It seemed to work upon testing, and it looked okay upon code inspection, so I put it in. Low-and-behold about 4 months later it stopped working. It turns out the default value evaluator assumed any value entered was '''octal''' if it had a leading zero. Thus, "8/1/2007" would pass, but not "08/01/2007". Since octal allows the digits 0 through 7, it passed fine earlier in the year. (I think newer versions of JS have a date validation function, but at the time it was too new to assume every browser had the newer JS.) ---- CategorySoftwareDevelopment