Re: Re: Re: Optional args in C code.

Joe Knapka <[email protected]> 03 May 2004 18:03:39 -0600
Newsgroups gmane.comp.lang.prothon.devel
Message-ID <[email protected]>
"Michael Geary" <[email protected]> writes:

> > What C compiler lets you declare vars in the middle of
> > code? I've never seen such a thing.  While that's a really
> > cool feature, we are restricting the code to ansii C and
> > our compilers choke on that.  I'm almost done fixing
> > your submission, but in the future please restrict your
> > code to ansii C also.  Maybe there's an option in your
> > compiler for that?
> 
> Mark, this reminds me that I've been meaning to ask: Why did you choose C
> instead of C++? I know I would have been sorely tempted to use C++ for its
> convenience and the way it can help you write reliable code more easily
> (destructors, etc.).

C is far more portable. If you want to aim a project at, essentially,
any number of platforms > 1, C++ is a painful choice, in my
experience.  Getting two different compilers on two different
platforms that implement the same subset of the standard in the same
way, with the same bugs, is pretty darn near impossible. And god help
you if you want to use templates.

OTOH, if you want to write ANSI (or ISO) C code with // comments,
then compiling it with C++ compilers might just be the right
choice. Almost all C++ compilers get the C subset pretty much right.

-- Joe

-- 
Resist the feed.
--
If you really want to get my attention, send mail to
jknapka .at. kneuro .dot. net.