Re: Standards/reasonable programming practices
Posted in 1997
I post this in the hope of some responce from others who either think they have found even better ways, have done the same thing and have additional ideas or possibly think I am totaly out of my mind. STOPSPAM <danwright@bigfoot.com> wrote: :Nils Myklebust wrote: :> :> rferdy@kuwait.net (Rudy Fernandes) wrote: :> :> :In article <338f1a67.41855084@gate.idg.no>, :> : Nils.Myklebust@idg.no (Nils Myklebust) wrote: :> : :> :<lots of sensible stuff snipped> :> : :> :>My methods might be radical :> : :> :Radical? More like the only way to big systems. Extremely useful! :> :> The radical parts where meant only to be that I do not test and :> develop directly on a database with live mission critical data. :> The other parts are probably reasonably elementary. :I think you mean the radical part is that you did test on a db with live :data (or did I misread the previous post). I didn't clarify testing very well. I do some testing during the gradual development of the program. In this phase I comment away statements that updates the data (update, insert, delete). Basically this "testing" is to see that the program does work at the major levels. No checking of the if's, case's and so on. This is definetly not the kind of tests one often hear and read about beeing done by separate test departments, or in smaller shops by the developers, to actually look for defects in as many parts of the code as possible. When the final part of the code is written I remove the above mentioned comments, compile again and release the program to the end users who start using it. This whole process is done on one machine with one database that contains the real data and is very mission critical to a major company. The programs are normally distributed to other customers shortly afterwards. Over the more than 10 years and many 100.000 lines of code I have been doing this I have had no significant problems at all with disrupted data or production schedules. There are very few defects in the code, and those that are there aren't critical with the exeption of a tiny number that have lead to the need of fixing a small amount of data. Even if I had been testing on a test database it is very likely these defects could have passed undetected until real life production. I must stress again that the above procedure isn't for everybody in every situation by far. The point is however to make clear to the world that it is possible to write very near defect free code, at least when using Informix 4GL for advanced bussiness type applications. I think it's possible in many other languages as well. :I am often tempted to do the same and am safe 90% of the time....It's :that other 10% that will kill you. I'd recommend not even trusting :yourself, without at least a cursory test on a test system. Your numbers are very far off. Make those 99.99 and 0.01 and you might have something to aim for instead of killing you. If cursory tests are of any help at all you have a significant design and coding problem. In some cases (not in yours) I find that this test running of programs gives developers some kind of warm feeling. Their program finaly works. That I spesifically want to avoid. Developers should feel triumf when their applications time after time can be put into production without prior testing with no significant defects found. Those who can realy appreciate nothing less are the ones I am after. For many types of applications I recomend forcing programmers to do as I and program and run against a live database. It's the psycological effect that's so important. In the beginning it might seem scary to some. They either quit or find they have to be very carefull. Beeing carefull means writing correct code. It's easy to tell someone they must write correct code, it's much harder to make them do it. This puts heavy preasure on them. That's something most people need. The nice thing about this is when you have been this carefull for some time you learn the methods necessary to write correct programs. You learn by the necessity of life which was allways the best way. They are the methods of high level design, strict logic, and keeping large system, program and database designs in your head at one time as well as splitting and partitioning these intelligently. You have to apply them continously. After a while you find your productivity going through the roof. There is nothing as devastating as fixing defects in something you have allready written. There is nothing as fast as writing correct code the first time arround. You might want to come back to your code to add functionallity or do tuning. You should hardly ever have to come back to it to fix defects. Nils.Myklebust@idg.no NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway My opinions are those of my company The Informix FAQ is at http://www.iiug.org