C++Now 2025 - Jeff Garland: "C++ Generic Programming Considered Harmful?" youtu.be/jXQ6WtYmfZw In his seminal 1968 paper "Go To Statement Considered Harmful," Edsger Dijkstra argued that unstructured control flow leads to tangled, hard-to-maintain code. The critique reshaped programming, ushering in an era of structured design that has influenced software development for over 50 years. Similarly, generic programming is a cornerstone of modern C++, enabling powerful abstractions and highly reusable code. However, it comes at a cost: increased compilation times, cryptic error messages, and cognitive overhead that challenges even expert developers. Has generic programming delivered on its promises, or is it actively undermining progress? To frame this question, we’ll take an epic journey spanning 15 billion miles, down to 5 nanometers, and across four decades of software development and computing machine evolution. Along the way, we’ll explore how the abstractions we use to write programs have evolved -- highlighting some of the successes and the failures. Ultimately we'll come back back to where generic programming fits into the picture and it's contributions. This session will challenge your perspectives of software development and leave you with a lot to reflect on. --- Jeff Garland has worked on many large-scale, distributed software projects over the past 40 years. The systems span many different domains including telephone switching, industrial process control, satellite ground control, ip-based communications, and financial systems. He has written C++ networked code for several large systems including the development high performance network servers and data distribution frameworks. Mr. Garland’s interest in Boost started in 2000 as a user. Since then he has developed Boost.date_time, become a moderator, served as a review manager for several libraries (including asio and serialization), administered the Boost wiki, and served as a mentor for Google Summer of Code. Mr. Garland holds a Master’s degree in Computer Science from Arizona State University and a Bachelor of Science in Systems Engineering from the University of Arizona. He is co-author of Large Scale Software Architecture: A Practical Guide Using UML. He is currently Principal Consultant for his own company: CrystalClear Software, Inc.
Jeff Garland on C++ Generic Programming: Harmful or Helpful?
More Relevant Posts
-
In the world of programming, C and C++ continue to be two of the most influential languages that shaped modern software development. Recently, I revisited the fundamental differences between them, and this comparison serves as a powerful reminder of how each language contributes uniquely to building technology. The image below highlights some of the key distinctions between C and C++, and here’s my takeaway: C A powerful procedural programming language Focuses on functions, flow control, and structured programming Lacks object-oriented concepts such as inheritance and polymorphism Does not support operator overloading or virtual functions Often follows a bottom-up approach Still widely used for system programming, embedded systems, and performance-critical tasks C++ An extension of C that brings the full power of object-oriented programming Supports classes, inheritance, polymorphism, and abstraction Enables operator overloading and virtual functions, making code more flexible and extensible Typically follows a top-down design approach for solving complex problems Used extensively in real-time systems, game engines, simulations, and applications requiring high performance and modular design Why This Comparison Matters Whether you're learning programming, preparing for interviews, or refining your development philosophy, understanding the mindset behind procedural vs. object-oriented paradigms is essential. C builds your foundation; C++ teaches you how to scale it into larger, more maintainable systems. Both languages have stood the test of time - and mastering their differences can give you a significant advantage in writing efficient, structured, and scalable code. #CProgramming #CPP #SoftwareDevelopment #ProgrammingConcepts #ObjectOrientedProgramming #Developers #TechLearning #CodingJourney #EngineeringMindset
To view or add a comment, sign in
-
-
This is a great article on just how tricky casting bytes can be. It's the first article that I've read that covers all the gotchas such as aliasing, alignment, object lifetimes, and what to do about it!
How do you reinterpret the bytes of an object of one type as another type in C++? If your answer is a type-cast or a union, you're probably invoking undefined behavior! Type punning is an essential concept for writing low-level C++, especially for embedded or networking programming, but unfortunately is full of footguns that can cause you to write non-portable code. I wrote a deep-dive blog on this topic detailing: * Why C-style casts and unions are UB in C++ * Object lifetimes, alignment requirements, and strict aliasing rules * Modern, correct approaches: std::memcpy, `std::bit_cast` (C++20), and `std::start_lifetime_as` (C++23). Check out the full post here and please give me any feedback: https://lnkd.in/e-wqs4ay #Cpp #SystemsProgramming #EmbeddedSystems #SoftwareEngineering
To view or add a comment, sign in
-
How do you reinterpret the bytes of an object of one type as another type in C++? If your answer is a type-cast or a union, you're probably invoking undefined behavior! Type punning is an essential concept for writing low-level C++, especially for embedded or networking programming, but unfortunately is full of footguns that can cause you to write non-portable code. I wrote a deep-dive blog on this topic detailing: * Why C-style casts and unions are UB in C++ * Object lifetimes, alignment requirements, and strict aliasing rules * Modern, correct approaches: std::memcpy, `std::bit_cast` (C++20), and `std::start_lifetime_as` (C++23). Check out the full post here and please give me any feedback: https://lnkd.in/e-wqs4ay #Cpp #SystemsProgramming #EmbeddedSystems #SoftwareEngineering
To view or add a comment, sign in
-
Type punning in C++ leads to undefined behavior and still remains in our code based for several reasons: * it's a low-level code and thus can be ugly, * it works. Joseph Zalusky shows better approaches in modern C++ for the same job
How do you reinterpret the bytes of an object of one type as another type in C++? If your answer is a type-cast or a union, you're probably invoking undefined behavior! Type punning is an essential concept for writing low-level C++, especially for embedded or networking programming, but unfortunately is full of footguns that can cause you to write non-portable code. I wrote a deep-dive blog on this topic detailing: * Why C-style casts and unions are UB in C++ * Object lifetimes, alignment requirements, and strict aliasing rules * Modern, correct approaches: std::memcpy, `std::bit_cast` (C++20), and `std::start_lifetime_as` (C++23). Check out the full post here and please give me any feedback: https://lnkd.in/e-wqs4ay #Cpp #SystemsProgramming #EmbeddedSystems #SoftwareEngineering
To view or add a comment, sign in
-
While reading “Modern C++ Programming with Test-Driven Development” by Jeff Langr, I came across a simple yet powerful concept that is often overlooked — Hamcrest-style assertions. In my work, I primarily use the GoogleTest (GTest) framework, so the examples below are based on it. GTest documentation itself advises avoiding “classic form” assertions such as `EXPECT_EQ(actual_value, expected_value)`. These can sometimes produce misleading or incomplete diagnostics, and in some cases even pass unintentionally due to implicit conversions — for example, when comparing different types such as `bool` and `string`. By contrast, Hamcrest assertions (using `EXPECT_THAT(actual_value, matcher)`) make comparisons explicit and provide far more informative failure messages. Instead of only showing that two values differ, they describe why they differ and how the comparison was evaluated. Another major advantage is the rich set of built-in matchers available — such as `Eq`, `Ge`, `StartsWith`, `Contains`, `AllOf`, and many others. They allow you to write expressive, readable tests that clearly communicate intent, without extra helper functions or complex conditions. In real-world projects, this expressiveness and clarity significantly reduce debugging time and improve collaboration. When multiple developers review failed tests, clear and descriptive messages help the team quickly understand what went wrong without digging into the code. Even though it might seem like a small change, using Hamcrest matchers can make your tests not only more readable, but also more reliable and maintainable — a key goal of any robust test suite. You can see the difference between classic and Hamcrest assertions in the picture below.
To view or add a comment, sign in
-
-
C++Now 2025 - Richard Powell: "Techniques for Declarative Programming in C++" youtu.be/zyz0IUc5po4 Declarative programming is the technique of saying “what you want” instead of “how to do”. This talk walks through the lessons and learnings I encountered when developing wxUI, a C++ Declarative UI library built on top of wxWidgets. This talk is not about creating GUIs in C++, but instead breaks down techniques for how to use C++ techniques to give structure and clarity to your code. We will explore using many advanced techniques like CRTP, expression templates, and [insert the C++ buzzword of the week here] to create flexible libraries to convert imperative programming to declarative programming. --- Richard Powell began using C++ 20 years ago to develop a psychoacoustic audio encoder/decoder, and has since continued exploring how to create software that unlocks the potential of hardware to deliver incredible audio experiences. He enjoys both teaching and learning about C++ and programming, and has presented several talks at CppCon as well as at local Bay Area C++ user groups. Beyond computers, Richard plays both the trombone and piano (though not usually at the same time) and performs jazz and classical music at local events.
Techniques for Declarative Programming in C++ - Richard Powell - C++Now 2025
https://www.youtube.com/
To view or add a comment, sign in
-
Don’t refactor a codebase just to support the next best programming language, there is negative ROI in most cases. Refactor your code to be more easily extendable, or to make it easier to work with in general. You can measure that, and it’s useful.
To view or add a comment, sign in
-
💡 C vs C++ — Understanding the Core Difference As developers, we often start our journey with C, the foundation of modern programming — a procedural language focused on functions and structured logic. Then we move to C++, an evolution that introduces Object-Oriented Programming (OOP) — bringing classes, objects, and reusability into play. Both languages are powerful in their own way: ✅ C – Fast, low-level, close to hardware ✅ C++ – Flexible, modular, and object-oriented Understanding their differences helps us appreciate how programming has evolved — from procedural thinking to object-oriented design. 🚀 #C #CPlusPlus #Programming #Developers #Coding #Learning #SoftwareDevelopment #OOP #TechEducation
To view or add a comment, sign in
-
-
Discover what C programming is and why this foundational language is still vital today. Our beginner's guide covers its history, features, and uses. https://lnkd.in/ecZ9xMRA
To view or add a comment, sign in
-
OOP in C# 🧩 Object-Oriented Programming (OOP) in C# — Deep Dive After mastering C# basics, I continued with “OOP as it should be in C#”, learning how to write clean, reusable, and scalable code. 🔹 What I Learned: Classes & Objects: memory management and object creation Encapsulation & Abstraction: writing secure, maintainable code Inheritance & Polymorphism: constructors, overriding, multi-level inheritance Interfaces & Abstract Classes: designing flexible systems Composition, Partial & Sealed Classes: modular and organized code Advanced C# features: Enums, nested classes, class libraries 🔹 Mini Projects: Calculator Project to practice constructors, static members, and OOP principles Practical examples applying real-life constructors and static members 🔹 Key Takeaways: Learned to think object-oriented first Strengthened my ability to build large-scale C# applications OOP principles make code cleaner, scalable, and maintainable Feeling more confident in writing professional-quality C# code and ready to tackle bigger projects! 💪 #CSharp #OOP #DotNet #SoftwareEngineering #CleanCode #Programming #ObjectOrientedProgramming #ContinuousLearning
To view or add a comment, sign in
More from this author
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development