Re: [stella] OT: Programming, CS theory
Subject: Re: [stella] OT: Programming, CS theory|
From: Greg Miller <gmiller@xxxxxxxxxxxxxxxxx>
Date: Thu, 25 Oct 2001 18:50:13 -0500
Glenn Saunders wrote:
Some people mistakenly assume that fewer lines of source code somehow
result in smaller, faster programs. Such people tend to use "?" in
preference to "if" for reasons of superstition.
I hate this crap.
When I code I always go vertical.
b = 1;
b = 2;
I always use the brackets. I never used any sort of compacted syntax.
I find it much more readable the long way.
I also have a style in my CF that I don't know whether it's good or bad
practice in general CS theory, but I make a lot of use of true/false
variables which allows me to help spread out code instead of nesting
conditionals. Oftentimes when you heavily nest conditionals you'll have
to duplicate code blocks (including more conditional logic with them)
depending on the program flow. So by not duplicating the code as much
the sourcecode gets smaller and it's easier to maintain.
This is a frequent source of stylistic argument, because there simply
isn't a universal optimal way of handling it. Nested ifs, booleans, goto
statements, exceptions, multiple returns, and separate functions are all
apropriate in different cases. The graduate students teaching
introductory CS classes tend to go for booleans or nested ifs in most cases.
There is no peaceful solution to organized terrorist networks.
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/
- Re: [stella] OT: Programming, CS theory, (continued)
- Julian Squires - Thu, 25 Oct 2001 21:11:00 -0400 (EDT)
- Erik Mooney - Fri, 26 Oct 2001 01:26:49 -0400 (EDT)
- Glenn Saunders - Thu, 25 Oct 2001 19:32:35 -0400 (EDT)
- Greg Miller - Thu, 25 Oct 2001 19:56:21 -0400 (EDT) <=
- B. Watson - Thu, 25 Oct 2001 20:21:04 -0400 (EDT)
- B. Watson - Thu, 25 Oct 2001 20:15:20 -0400 (EDT)
- Chris Wilkson - Thu, 25 Oct 2001 23:14:24 -0400 (EDT)
- KhrysSun - Fri, 26 Oct 2001 06:18:03 -0400 (EDT)