|
|
Warp wrote:
> So let me get this straight: You are comparing C in a 10+ years old MS-DOS
> system to higher-level programming languages (such as Java and Haskell) in
> modern systems with modern OSes and modern compilers, and based on this you
> have decided that C sucks?
As far as I'm aware, C hasn't changed in 20 years, never mind 10.
>>> You mean reaching the end of the file is such a fatal error, that the
>>> program must be terminated with an exception?
>
>> Well, it beats producing random garbage, surely?
>
> Since when has the EOF value been "random garbage"? In standard C the EOF
> value is -1 (integer, not char), and a file read past the end of file will
> always return -1. How is that "random garbage"?
Really? I had assumed that after you read past the end of the file, it's
behaviour is simply undefined. I wasn't expecting the C standard to
actually bother to define the result of an operation you're not supposed
to perform.
> Besides, reaching the end of file (and getting that -1) is *not* an error.
No, reaching EOF is not an error - failing to check for EOF is an error.
>> I've never seen a C debugger.
>
> Thus you base all your prejudices on non-knowledge.
Yes - because having a debugger would make function names easier to
remember and pointer syntax less baffling and printf() would work
right... oh, wait...
>> Nor would I know where to find one.
>
> Any decent compiler will have one.
I would imagine so, yes.
>> There are two possibilities which are apparently equally valid. It's
>> very difficult to remember which one of them was arbitrarily selected by
>> the language designers.
>
> Luckily haskell doesn't have any arbitrarily selected features in it
> which you need to memorize (such as for example some function names).
Well at least you can easily look up Haskell function names.
Maybe that's part of the problem - I don't have any C programming
resources where I can actually look things up. So if something doesn't
work, there's the Borland C++ help file, or there's experimentation.
Neither of these things help terribly much.
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|