News for hackers. Stuff that matters.
Re:My personal C coding style as of late 2023 by Sharlin on Monday October 09, 2023 @09:53AM (#37820459)
I do think that the default convention of SHOUT_CASE for constants in Rust is too in-your-face given that there's nothing about Rust constants that would particularly require them to stand out. I might have gone with CamelCase given that some things in Rust already straddle the "types are CamelCase, terms are snake_case" delineation (enum variants, even data-less ones, are CamelCase, as well as the implicitly defined constant `Foo` for any unit struct `Foo`).
Re:My personal C coding style as of late 2023 by afdbcreid on Monday October 09, 2023 @01:20PM (#37822769)
There is some gotcha: they're copied on use, which means you could end up with more than one copy in your binary (unlikely with an optimizing compiler), or, worse, that if you have interior mutability in them it just won't work.
Re:My personal C coding style as of late 2023 by suskeyhose on Monday October 09, 2023 @09:55PM (#37827750)
SHOUT_CASE is truly the inferior way to refer to SCREAMING_SNAKE_CASE