News for hackers. Stuff that matters.
Re:Switching to C over 'Modern' Programming Languages by xigoi on Thursday April 13, 2023 @03:59PM (#35561306)
Okay, so you write your own string library. Now you'd like to do the same thing for resizable arrays, so you write a resizable array li… oops, you can't, because C doesn't have parametric types.
Re:Switching to C over 'Modern' Programming Languages by flohofwoe on Friday April 14, 2023 @03:13AM (#35566454)
Preprocessor macros are an entirely valid tool in the C language toolbox, even if demonized by C++ coders.
Re:Switching to C over 'Modern' Programming Languages by pjmlp on Friday April 14, 2023 @04:54AM (#35567129)
Even Macro Assemblers from the MS-DOS and Amiga days are better than C pre-processor macros.
Re:Switching to C over 'Modern' Programming Languages by melagonster on Friday April 14, 2023 @02:06PM (#35572679)
it is black magic, absolutely respect C developers.
Re:Switching to C over 'Modern' Programming Languages by flohofwoe on Saturday April 15, 2023 @05:58AM (#35579127)
But the preprocessor is just simple text replacement, nothing magic about it.
Re:Switching to C over 'Modern' Programming Languages by tpoacher on Friday April 14, 2023 @04:42PM (#35574466)
He didn't say "write your own library". He said "use" one (your own if you prefer). Or are you going to suggest there are no good string handling libraries for C?
Re:Switching to C over 'Modern' Programming Languages by xigoi on Friday April 14, 2023 @06:44PM (#35575822)
It doesn't matter. My point is that it's not possible, not for you and not for anyone else, to implement a type-safe generic resizable array library in C.