[Coco] C language

didier at aida.org didier at aida.org
Mon Dec 2 03:03:26 EST 2019


Frankly C is far superior for strings,
it's not handled the standard way basic or other similar languages are doing
but when you have learnt to use C and well organized your data
you can have some construction without really moving data, just pointers...

in Basic and other similar languages you are often creating or 
destroying strings
which result in poor performances and hell for the garbage collector
I programmed in C for 40 years and frankly with string handling of other 
languages
I feel very limited


On 02/12/2019 08:46, Mark McDougall wrote:
> 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.
>


More information about the Coco mailing list