[Coco] C language

Mark McDougall msmcdoug at iinet.net.au
Mon Dec 2 02:46:14 EST 2019


On 1/12/2019 2:20 pm, Joel Rees wrote:

> Actually, C is very good for working with strings, as long as you
> understand the underlying representation, know which libraries to use, and
> understand how the libraries work.

IOW, if you already have experience... regardless I would never describe 
C as being "good" for working with strings. It can be described as 
capable at best.

> And that is essentially the situation with any other language.

Not true at all. Other languages have support for strings, rather than 
character arrays, with richer operators/functions for splitting, merging 
and concatenating. All without worrying about terminating characters and 
array sizes.

> Well, given that understanding all that is necessary, pointers, pointer
> arithmetic, char types and the difference between char and character, and
> arrays are very much part of C.

My point was, it's a higher barrier to entry in C for someone wanting to 
do string manipulation in C than in some other languages. Perhaps not 
suitable for the 2nd tutorial after "Hello World".

> And, while the standard libraries are separable, the standard is not
> separable from the standard library, in any version of the standard, or in
> any pre-standard compiler.

You need to know where to find them, how to include them, caveats using 
them; again string manipulation is not simply part of the language, a 
possible stumbling block for the newcomer.

> Also, in a lot of cases, implementations on microprocessors like the
>> Arduino often comprise macros and functions which, aside from being
>> unique to the platform, can actually make what you're writing less
>> C-like in some respects!
> 
> Also true of any language.

Again, my point was that perhaps Salvador's lack of familiarity is due 
to the nature of the programming he is doing - invoking macros rather 
than the native C that he did in the past.

-- 
Mark McDougall
<http://retroports.blogspot.com.au>


More information about the Coco mailing list