Subj : Re: Is well written code a rare species ? To : comp.programming From : Charles Richmond Date : Fri Aug 12 2005 04:49 pm John wrote: > > "Anonymous George" wrote in message > news:pan.2005.08.12.17.56.50.318008@somewhere.nu... > > Good day everyone, > > > > This is my second job now. By now, in my 10 year career, > > I have had to maintain some programs that were written > > by others. Most of those programs were badly written. > > Global variables all over the place, way too long functions > > with hardly any useful comments, badly chosen function names, > > you name it. > > > > Is bad programming common practice ? > > Is well written code a rare species ? > > > > I ask this, because I want to know if I should change > > myself or if I should just go to another employer. > > My current job is driving me crazy, because it takes so much > > effort to do even the simplest modification to the application. > > > > And how can I learn during a job interview whether the company's > > product has high quality source code ? I know every company will > > say that about themselves. > > Hi George, > > IMHO; ugly code is everywhere. > > I believe there is a many reasons for this : > > 1. Consultants who never maintain thier own code. I know there are probably > some good consultants out there, but I'm willing to bet they agree with this > statement. > > 2. Programmers who don't understand the code they are maintaining. > > 3. Deadlines undermining the programmers better judgement. > > 4. Project evolution turning a good design into a bad one. Either over the > course of many years, or months if the requirements/specs weren't done > correctly. > > 5. Weak programming culture. > > 6. The fastest coders are rewarded, even when they cause most of the > maintainence work ... because nobody watches who created the bug. > IMO you have omitted one reason: really *bad* programmers. I took over some code from a guy who was fired, and it was the worst I have ever seen. Sections of code that should have been made functions...were just copied over into the program when needed. In C, the word TRUE is typically defined as 1 and FALSE defined as 0. This guy made FALSE an integer variable, and changed the value a few times in the code. Worst of all, the code was all over the place, with *no* consistent indentation even attempted. I had to toss out his code and write the application over. In so doing, I found that when the original programmer did *not* understand how to handle certain inputs, he would just ignore those inputs. So be sure and add "bad programmers" to your list of problems. -- +----------------------------------------------------------------+ | Charles and Francis Richmond It is moral cowardice to leave | | undone what one perceives right | | richmond at plano dot net to do. -- Confucius | +----------------------------------------------------------------+ .