Re:Git's list of banned C functions
by DaiPlusPlus on Thursday March 04, 2021 @07:00PM
(#26350327)
> I think for new code in environments that support newer standards C89 shouldn't be used
Why stop there? Don't use C. Use Rust!
Re:Git's list of banned C functions
by SAI_Peregrinus on Thursday March 04, 2021 @08:11PM
(#26351077)
Rust doesn't (yet) support all the targets C does. Mostly weird embedded stuff that needs it, and gccrs might solve that problem, but it's not always possible.
When it is possible, I certainly agree that Rust is nicer.
When updating existing code C89 (maybe K&R) might be what's used so minor code changes won't undo that.
I tend to write most of my code in something higher-level than C and only resort to C or assembly in performance-critical sections as found with a profiler. Plenty of general-purpose languages have memory-safe strings built into the language, and honestly I keep hoping the Cisco/Intel safestrings library or something like SDS gets the standard library blessing one day.