[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: Why is C so popular?



Ron Johnson wrote:

On Wed, 2003-08-27 at 22:03, Deryk Barker wrote:
Thus spake Steve Lamb (grey@dmiyu.org):

On Wed, 27 Aug 2003 16:01:48 -0500
Alex Malinovich <demonbane@the-love-shack.net> wrote:
I'm also very reluctant to learn Python because I'm very adamant
in how I use whitespace. Though I will need to pick it up sooner later.
As well as Ruby and probably PHP as well. You can never know too many
languages after all. :)
   That was one of two points that really stuck in my craw about Python.  But
ya know what?  2+ years later and now I go back to Perl code or poke through C
code and I just find it nasty to paw through.  And writing either of those,
oy, don't even get me started.  It's definitely something to get used to and
the more used to doing things with block delimiters the more friction there is
to doing it any other way.  But I'd not go back and I wish other languages
would take the same path.
I agree 100%, although it was my encounter with Miranda c1986 that
first prompted the "I'll indent how I like" reaction.

But you are right, having to indent properly produces much
cleaner-looking and easier to maintain code.

And I really appreciate the latter after having spent several hours on
afternoon about 15 years ago trying to find a bug in a C program (not
written by me), and missing it because poor and inconsistent
indentation by the original author made me misread the code.
After I found the bug the next task I set myself,, before doing
anything else, was to indent his code properly. All went much better
after that.

I also think that enforced indentation is a very good thing in a
language used to teach programming - one of the things that makes
python so good for that, in fact.

But as you just demonstrated, regularized indenting is crucial to
any code bigger than, oh, say, a 25-liner.

Quick question Steve.
Was this code on a Unix system, or did you have one nearby? Did you know about the indent program at the time? (man indent)

It _seems_ to work for me to convert someone elses sytle (or lack of it) in coding C into a format that I like (K&R).

Jacob



Reply to: