Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why does many sources say that there are 32 keywords in C while the ISO/IEC 9899:2017 C N2176 document has 44 keywords?

ISO/IEC 9899:2017 C N2176 document link: https://files.lhmouse.com/standards/ISO%20C%20N2176.pdf

There are plenty of sources on world wide web, which say that there are 32 keywords in C langauge, But this document (I think it’s a draft version, but there’s no much changes as compared to the previous version, right?) has 44 words that are defined to the keywords of C language.

Please explain this.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

============================================================

Edit (before visiting these, please consider the fact that these aren’t updated to newer C version):

Link to the sources which say that there are 32 keywords in C langauge:

  1. https://www.programiz.com/c-programming/list-all-keywords-c-language
  2. https://tutorials.webencyclop.com/c-language/c-keyword/
  3. https://www.educba.com/c-keywords/
  4. https://www.javatpoint.com/keywords-in-c
  5. https://beginnersbook.com/2014/01/c-keywords-reserved-words/
  6. https://www.phptpoint.com/c-keywords/
  7. https://www.guru99.com/c-tokens-keywords-identifier.html

>Solution :

  • The claims of there being "32" keywords in C refer to the original ANSI-specified version of C from 1989, aka C89.
    • Because this is the Internet, and because the real C specifications are behind ISO’s ridiculous paywall most people so-inclined probably can’t fact-check the claim.
    • And it’s not a claim worth fact-checking: the number of keywords in a language is utter trivia of no consequence.
  • The ISO/IEC 9899 specification you linked to refers to C17 (the proposed updated C specification in 2017) which postdates C89 by 28 years.
  • It should come as no surprise that a future updated reversion of a programming language introduces new keywords.

Historically, when C was introduced, people were impressed by its minimalist syntax and how the language’s design effectively reified everything by implementing functionality as library features instead of language features which is what keeps C simple and helps mitigate every language’s designer’s fears about feature creep.

In comparison, C’s early contemporaries like COBOL, opted to implement functionality into their own languages as first-class features, which is why COBOL has over 300 keywords; so I’ll admit that using the stark difference in keyword-count does serve as a proxy for language-complexity and by extension: a way to almost quantify good design. But using it as the basis for comparing languages today in 2021 is uninteresting as the most relevant programming languages today1 are already either inspired by C or derived from it somehow, and they all share C’s decision to do things in the library instead of the language, so all those languages have a low keyword count compared to COBOL, SQL, and others, so C’s keyword count just isn’t interesting anymore.

1: C-inspired or C-derived languages in use today: C++, Objective-C, Java, Groovy, Swift, C#, JavaScript, TypeScript, Go, PHP, Perl.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading