Re:Teaching D from Scratch: Is it a viable first language?
by WalterBright on Wednesday December 29, 2021 @10:51PM
(#29733372)
Another issue with C being an allegedly good beginner language is strings. C is simply terrible at handling strings. Let's say I want to concatenate two strings:
And never mind the issue of when to free() r. Contrast with D:
P.S. Yes, I know about the potential overflow problem with `plen + qlen + 1`.
[ Parent
| on HN ]
Re:Teaching D from Scratch: Is it a viable first language?
by ziml77 on Thursday December 30, 2021 @01:20PM
(#29739540)
I get that C tries to be incredibly barebones, but operations on strings are so common that it's crazy how bad the string handling in C is. It seems like it was designed under the assumption that all of your strings are stored in fixed-size buffers.
I might not pick D as a beginner language simply because it unfortunately isn't very popular, but I certainly wouldn't pick C as a beginner language.