2 ms·
What other paradigms are popular with C++? Never came across anything else other than object programming.
by throwaway5486nv 5y ago
What other paradigms are popular with C++? Never came across anything else other than object programming.
- Jtsummers 5y agoGeneric, functional (with the introduction of lambdas and closures, in particular), procedural. Some of the features may use the class system under the hood, but with a very shallow hierarchy it's more akin to a trait/interface system if you drop the deep class hierarchy style that was more prevalent in the 90s.
- throwaway5486nv 5y agoAre there any popular open source projects that has adopted non object oriented programming style?
- Jtsummers 5y agoI'd just look at the C++ Standard Library which relies far more on the procedural, generic, and functional styles than OO. Using it, you often (IME) end up writing code more along the trait/interface style than the OO-hierarchy style that was popular in the 90s. But I have no idea about open source C++ projects, I don't follow them and mostly don't care. I've really only used C++ at work where 99% of the code seems to be procedural, not OO. The closest is that they have "classes" which are barely more than plain data objects ("smart" structs), if they have methods it's to enforce data invariants and almost nothing else.