Page 27 - C-Language
P. 27

popular compilers.


        Some compilers (notably GCC) have offered, or continue to offer, compiler extensions that
        implement additional features that the compiler producers deem necessary, helpful or believe may
        become part of a future C version, but that are not currently part of any C standard. As these
        extensions are compiler specific they can be considered to not be cross-compatible and compiler
        developers may remove or alter them in later compiler versions. The use of such extensions can
        generally be controlled by compiler flags.

        Additionally, many developers have compilers that support only specific versions of C imposed by
        the environment or platform they are targeting.


        If selecting a compiler, it is recommended to choose a compiler that has the best support for the
        latest version of C allowed for the target environment.


        Code style (off-topic here):



        Because white space is insignificant in C (that is, it does not affect the operation of the code),
        programmers often use white space to make the code easier to read and comprehend, this is
        called the code style. It is a set of rules and guidelines used when writing the source code. It
        covers concerns such as how lines should be indented, whether spaces or tabs should be used,
        how braces should be placed, how spaces should be used around operators and brackets, how
        variables should be named and so forth.

        Code style is not covered by the standard and is primarily opinion based (different people find
        different styles easier to read), as such, it is generally considered off-topic on SO. The overriding
        advice on style in one's own code is that consistency is paramount - pick, or make, a style and
        stick to it. Suffice it to explain that there are various named styles in common usage that are often
        chosen by programmers rather than creating their own style.


        Some common indent styles are: K & R style, Allman style, GNU style and so on. Some of these
        styles have different variants. Allman, for example, is used as either regular Allman or the popular
        variant, Allman-8. Information on some of the popular styles may be found on Wikipedia. Such
        style names are taken from the standards the authors or organizations often publish for use by the
        many people contributing to their code, so that everyone can easily read the code when they know
        the style, such as the GNU formatting guide that makes up part of the GNU coding standards
        document.


        Some common naming conventions are: UpperCamelCase, lowerCamelCase,
        lower_case_with_underscore, ALL_CAPS, etc. These styles are combined in various ways for use
        with different objects and types (e.g., macros often use ALL_CAPS style)


        K & R style is generally recommended for use within SO documentation, whereas the more
        esoteric styles, such as Pico, are discouraged.


        Libraries and APIs not covered by the C Standard (and

        therefore being off-topic here):



        https://riptutorial.com/                                                                                3
   22   23   24   25   26   27   28   29   30   31   32