Re: C coding

Scott Klement <[email protected]>
Newsgroups gmane.comp.lang.as400.c
Message-ID <[email protected]>
Hmmm...   I think up until, maybe 10 years ago, I would've agreed with 
this.  C++ was not standardized at first, and the core classes available 
were very different on different platforms for a long time, making it 
hard to write portable code.

But, in 1998 they standardized C++, and by 2003 or 2004 (something like 
that) the standardized version was pretty much everywhere.  So from that 
point on, C++ became a pretty good language for platform independence. 
Not as good as Java perhaps, but equal to C.

As for "elegant, simple"... well, I've been coding in C forever, so I'm 
quite used to it, but for new programmers in particular, the string 
handling in C is quite awkward and is very error-prone.  My experience 
has been that a C programmer with less than 5 years of experience will 
almost certainly do something wrong with string/memory handling and 
overwrite some area of memory that they shouldn't, and this will often 
go unnoticed for a long time and will make it into  production code. 
C++ however is much more elegant with regards to strings, and makes it 
much easier to get things right.  So I can see where Jon is coming from, 
here.

I personally still prefer to code in C, but I think it's mostly because 
that's what I'm used to.

I would never recommend Java over C++.   Java's environment with it's 
JVMs and application servers makes it so much more awkward, IMHO.  I 
definitely prefer C or C++ to Java any day of the week.  (This is just 
my opinion, though.)


On 2/13/2014 4:05 AM, John E wrote:
> Compared to C++, C is quite elegant, simple, and not overly complex as C++.
> And if you're building a big system (not some one-off utility or tool), and
> therefore have a need for OOP, choose Java or something else.
>
> And C is also very platform independent, meaning you can compile your C
> source without issues (if  the code is a bit disciplined) on any known
> platform known to man. Not so for C++.
>
-- 
This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list
To post a message email: C400-L-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.