Path: utzoo!attcan!uunet!motcid!kreidler From: kreidler@motcid.UUCP (Joe Kreidler) Newsgroups: comp.lang.c Subject: Re: a style question Message-ID: <4762@navy8.UUCP> Date: 3 Oct 90 14:10:24 GMT References: <7341@darkstar.ucsc.edu> <1990Sep30.050655.13212@zoo.toronto.edu> <1990Sep30.172917.2951@Neon.Stanford.EDU> <90Oct1.102559edt.18827@me.utoronto.ca> Reply-To: motcid!kreidler@uunet.uu.net Organization: Motorola Inc., Cellular Infrastructure Div., Arlington Heights, IL Lines: 32 zougas@me.utoronto.ca ("Athanasios(Tom) Zougas") writes: >You know what they say: "Computers are very good at doing things >over and over and over again":-) >Shaving microseconds does not make better code. Better algorithms do. Tom brings up a very important point that people are missing. Stop and think for a second, "Why do I code in C instead of assembler?" I hope your answer is because C code is more portable, easier to develop, and easier to maintain. I do not know of anyone who uses C because it produces code that runs faster than assembler. As software systems keep getting larger and more complex, it is important to develop code that is easy to understand and can be ported to new applications. This comes at the cost of less efficeint code (when compared to assembler). If several microseconds are more important than portabability and maintainabliity, than use assembler. Otherwise, don't make such a fuss about which type of comparision generates faster code. Besides, a comparison that runs faster on one machine may be slower on a different machine. I am not saying that efficiency is not important for a C program. C programs should be written to run as fast as they can but this is accomplished through the design of efficient algorithms and data structures, not the choice of operators. ------------------------------------------------------------ Joe Kreidler 1501 W Shure Drive Motorola Cellular Arlington Heights, IL 60004 ...!uunet!motcid!kreidler 708-632-4664 ------------------------------------------------------------