[Coco] C language

Salvador Garcia salvadorgarciav at yahoo.com
Mon Dec 2 10:54:43 EST 2019


 Mark and Didier, thank you for your input. I am finding this conversation very interesting.

My experience with C goes way back to the Turbo and Borland C compilers, with a dash of Let's C circa 1991.

I was re-introduced to the language 20ish years later when I started delving into the TI MSP340 (https://www.udemy.com/course/mcu_msp430/) and the Arduino.

I appreciate everyone's help in getting back into the language. It's always been one of my favorite languages, along with assembler which I used from 1985 to 1992 to program the IBM PC and its clones.

Regards, Salvador


    On Monday, December 2, 2019, 04:13:27 AM CST, Mark McDougall <msmcdoug at iinet.net.au> wrote:  
 
 On 2/12/2019 7:03 pm, didier at aida.org wrote:

> 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...

Well that depends wholly on the operations you're doing. You can't 
remove or replace sub-strings for example without moving data...

> 
> 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

I've been programming in C for 35 years on everything from Windows UI to 
embedded soft core processors in FPGAs, at application level to kernel 
device drivers, and micro-kernels on microcontrollers, and I'd never 
describe C string handling as "superior".

But there's no point arguing, if that's your experience and that's your 
opinion, then I'm certainly not going to be able to change it. In fact 
you're indeed fortunate that you find string handling so nice in C!

As for performance; that's another argument altogether, and IMHO not 
really relevant to the discussion at hand. Obviously if the language 
does a lot more for you to make string manipulation easier, it's going 
to be less efficient than a library of basic functions that operate on 
null-terminated character arrays. No surprises there. But I'd also argue 
that on modern platforms, it really makes no difference, and string 
handling is likely the least of your worries where bloating and poor 
performance are concerned.

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

-- 
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco
  


More information about the Coco mailing list