SE Radio 650: Robert Seacord on What's New in the C Programming Language
Jan 17, 2025
auto_awesome
Robert Seacord, Standardization Lead at Woven by Toyota and an expert on C programming, dives into the latest advancements in the C language. He outlines the significance of the upcoming C23 standard, sharing eight key features that enhance safety and portability. The conversation also touches on C's pivotal role in automotive systems and compares its safety measures to Rust. Seacord emphasizes the importance of robust coding standards and tools, while highlighting why understanding C remains crucial for developers in 2025.
The upcoming C23 standard introduces modern features like type inference and improved type safety, enhancing usability and security in programming.
C remains vital in safety-critical systems like automotive applications due to its performance, precision, and ability to closely control hardware.
Deep dives
History and Importance of the C Standard
The C programming language was created in the early 1970s at Bell Labs as a system implementation language for Unix. The standardization of C began in the late 1970s when ANSI initiated efforts to formalize the language due to the divergence in different implementations. The first standard, known as C89, laid the foundation for a consistent programming language that allowed developers to write portable code across various compiler implementations. This standard acts as both a manual for implementers and a contract between compiler developers and users, ensuring a uniform coding experience.
The Emergence of Secure Coding Standards
The development of the CERT C coding standard originated from a need for secure coding guidelines in the C programming community. Starting in 2006, a collaboration among security experts and compiler vendors took place to create a comprehensive standard aimed at enhancing software security in C applications. The standard focuses on preventing vulnerabilities inherent in the language, emphasizing the importance of validating untrusted user inputs to avert potential exploits. The CERT C coding standard is now critical for developers striving to write secure applications, showcasing a proactive approach to security in programming practices.
Recent Developments in C: C23 Standard
The C23 standard, expected to be finalized by the end of 2023, introduces several modern features to enhance programming practices. It includes attributes that give the compiler hints for optimization, improvements in type safety with more explicit enumeration types, and enhanced support for constant expressions which improve portability. Additionally, it allows for type inference using the 'auto' keyword, elevating the ease of declaring variables while maintaining type safety. These advancements aim to modernize the language while ensuring that it meets the needs of contemporary software development, including improving the language's usability and security.
C's Relevance and Appropriate Usage Today
Despite its age, C remains a prevalent language, particularly in safety-critical systems like automotive and medical applications where performance and precise control are paramount. The language's simplicity and efficiency provide developers with the tools needed to perform at a low-level closely to the hardware, making it an advantageous choice in these contexts. However, the decision to start new projects in C should be based on whether it is the most suitable language for the specific task, as other modern programming languages may offer quicker development cycles. Ultimately, C continues to hold its ground in domains where its established ecosystem and portability ensure reliability and functionality in various applications.
Robert Seacord, the Standardization Lead at Woven by Toyota, the convenor of the C standards committee, and author of The CERT® CCoding Standard, Effective C, and Secure Coding in C and C++, speaks with SE Radio host Gavin Henry about What's New in the C Programming Language.
They start with a review of the history of C and why it has a standard, and then they discuss what C23 brings and how programmers can take advantage of it. They consider the sectors in which C is most used and whether you should use C to start a brand new project in 2025. Seacord discusses 8 new things that C23 brings, use case examples, must haves, floating point numbers, how automotive systems use C, why C is used there, Rust vs C, compile time checks vs static analysis, all the various safety standards they can use, why you should use the right tool for the job and never trust user input no matter the language.