What goes where?
16-Feb-88 15:58:13
Sb: #109164-What goes where?
Fm: Richard Rae/SYSOP 76703,4253
To: John Draper 76703,4322
This message turned up in search, but its forum couldn’t be identified from the original transcript, so it may not be linked into its thread.
I cannot comment on "the general run of C users" or "most C programmers" I
can only comment on my practices and the code I write. You have specific
arguments against the language. I am attempting to point out that, by
putting down preconceived notions and approaching the language with a given
attitude, THOSE PROBLEMS GO AWAY.
"'We don't want strong type checking because we want the compiler to assume
we know what we are doing." No comment to the first part, agreed to the
second part. I don't want a compiler to decide ANYTHING, though I don't
terribly mind it saying "Hey, are you SURE you wanted to do this? I'll
compile it, but I thought I should mention it…". If I make a syntax error,
I expect to be flagged. If I do something that looks strange, I want the
compiler to accept it on the assumption that I DO KNOW WHAT I AM DOING. C
and assembler fit this bill nicely. Warnings are okay; being forced through
hoops to do something I *KNOW* I want to do, but the compiler can't see the
logic behind, is not.
You complain that most C code is "haphazard in… casting, sloppy in other
ways, and generally poor by your definition". In other words, BAD CODE.
Written by BAD PROGRAMMERS, I'd wager. We all know that in any given
profession, there are a few who know what they are doing, and a large number
who only proport to. Why is this the fault of the language? I'd wager these
people also write bad code in BASIC or FORTRAN or Modula or anything else
you'd care to try… can you imagine the mess they'd make in assembly?
No, you haven't convinced me. But don't use C if you don't like it, that's
fine. I have no argument with you OR your style. 8)
Rick