Liste des Groupes | Revenir à cl c |
On 25/02/2025 17:52, Ar Rakin wrote:On 2/25/25 10:28 PM, David Brown wrote:>>I agree! The C projects that I have built use latest C features. I
And for your own code, don't be afraid to find a better way of
writing your code. You don't have to be restricted to a C standard
that was replaced a generation ago. You don't have to limit
yourself to code that was designed to work well with computers,
software and screens from four decades ago.
usually always use the `-std=gnu17` or `-std=gnu23` compiler
flag. (Yes, I do use the GNU C extensions often.)
In that case, use // comments instead of /* */ comments when it makes
sense. Use line layout that makes sense and suits /your/ usage -
don't use a layout for function definitions based on what some ancient
editor liked unless you also like that ancient editor, or you like
that layout. Pick a tab size that suits /your/ preferences for
coding, using tab characters or spaces for whatever works best with
/your/ choice of tools.
It's fine to have different preferences - and some layouts are better
than others for certain types of code, or when working with particular
tools. The type of code you are working on can affect how well a
particular style suits the code.
>
So don't try to look for some kind of perfect "universal" style. All
you can be sure of is that whatever style you use, the next person
that looks at your code will think it's uglier or more error-prone
than their preferred style. That applies even if the "next person" is
yourself in a few years time.
Les messages affichés proviennent d'usenet.