Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker!apple!mips!twg.com!david From: david@twg.com (David S. Herron) Newsgroups: comp.sys.amiga Subject: Re: Long #defines (Re: Lattice/SAS C 5.10 HERE!) Message-ID: <7871@gollum.twg.com> Date: 30 Aug 90 23:45:43 GMT References: <14874@shlump.nac.dec.com> <1990Aug24.060138.2233@ariel.unm.edu> <1990Aug24.174645.15969@cs.umn.edu> <1990Aug27.081810.14126@zorch.SF-Bay.ORG> <6027@drutx.ATT.COM> Reply-To: david@twg.com (David S. Herron) Organization: The Wollongong Group, Palo Alto, CA Lines: 37 In article <6027@drutx.ATT.COM> mab@druwy.ATT.COM (Alan Bland) writes: >This is not meant to fault your programming skills, but you've been lucky >not to have trashed RAD: by a mistake in your own program. That is so very very much beside the point it's not funny. Sure it's a valid point but it simply ain't that hard to check your input or to make dynamically growing buffers. Any program should be able to accept garbage and not barf to the point it crashes the machine. With any procedure you can describe what it is you're willing to accept and have it check that the input actually is what you're willing to accept before running off and doing something crazy. A long time ago I got into the habit of checking inputs with the result that I tend to know very quickly when I've got a bug with information handling & control. Usually this checking is only a couple of pointer or integer comparisons. Nothing fancy.. Want some more justifaction? There's a wonderful book written by Khernigan (Kernighan?) and Plauger titled: Elements of Programming Style. It's written in the style/form of _Elements_of_Writing_Style_ (Strunk and White) but focused on writing software. Each chapter is headed up with horror stories from all elements of computing that boil in some way or another down to bad programming style, be it lack of parameter checking or whatever. Despite the fact that it was written in the 70's the book is still very very valid today. -- <- David Herron, an MMDF & WIN/MHS guy, <- Formerly: David Herron -- NonResident E-Mail Hack <- <- Sign me up for one "I survived Jaka's Story" T-shirt!