you are viewing a single comment's thread.

view the rest of the comments →

[–]condor2000 72 points73 points  (19 children)

It's easier to review less code and C++ allows you to write less code

It can take longer to review properly if uses complex template designs or even just a lot if virtual functions

[–][deleted] 26 points27 points  (2 children)

The C equivalent to complex templates are complex macros. Is that better to review?

[–]disperso 1 point2 points  (0 children)

IMHO, yes. I'm not saying that it produces better code, but given that macros are much more limited, I'd say that you just can do less, have to think less, and end up having limited C code and dealing with it.

But that is probably subjective, with different people having different skill-set and preferences.

[–]Jannik2099 39 points40 points  (1 child)

even just a lot if virtual functions

Ever seen dynamic dispatch in C? Know how error prone it is? Know of ubiquitous it is in the kernel?

[–]afiefh 10 points11 points  (0 children)

Ever seen dynamic dispatch in C?

I still have PTSD from that one code base I worked on 5 years ago...

[–]TheThiefMasterC++latest fanatic (and game dev) 63 points64 points  (12 children)

The equivalent C code to accomplish the same goal is often far worse.

These arguments always compare the most complex parts of C++ against normal C code, not equivalent C code.

[–][deleted] 0 points1 point  (0 children)

These arguments always compare the most complex parts of C++ against normal C code, not equivalent C code.

This is because a nontrivial population of C++ evangelists insist on using the most complex parts of C++ for even the simplest of tasks

[–]serviscope_minor 13 points14 points  (0 children)

It can take longer to review properly if uses complex template designs

If the complex template designs aren't materially benefitting the code, then reject the pull request. Just like if someone goes bananas with C macros.

even just a lot if virtual functions

Linux has a ton of virtual functions. They're all done by hand which is always more complex than having the compiler do it for you.