Subj : Re: Is well written code a rare species ? To : comp.programming From : CBFalconer Date : Fri Aug 12 2005 11:21 pm Bob Day wrote: > "Anonymous George" wrote in message >> >> 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 ? Yes. and Yes. >> >> 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. > > Get a job developing code rather that maintaining it. Make it > clear up front, during your interviews, that you are a developer > not a maintainer, and, in fact, that you suck at maintaining code. > That's what I did before I worked on my own, and I'm sure it > took me a lot longer to get jobs that way. On the other hand, > I was always successful in getting work I enjoyed. At the same time you can often do a bang-up job in the maintenance area, by fixing one thing at a time. Once you find out what something is for, abstract it, make a separate function to implement it, with suitable parameters. You will then probably find other areas that can simply call that function. As you go on you will rework the thing into something much more understandable and maintainable. If you have to reformat the source do that with something like indent, and check that the binaries are unaffected. Keep the old for following previous revisions. The new can then always be transformed to a standard format with the same software. I particularly remember one system I cut to one quarter the source, with greatly enhanced performance and abilities. It took a couple of months, and was done one step at a time. Make sure you have a good set of tests to catch your silly goofs. -- Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net) Available for consulting/temporary embedded and systems. USE worldnet address! .