16

Disclaimer: I apologise in advance for those tired of language wars, if it bugs you that much just skip this rant.

"C++ is better than C"

An accepted truth. OO is better than Procedural, C++ is an upgrade from C, it fixed all the problems.

End of.

Except - when it comes to actual evidence, empirical studies have shown that there are no productivity gains with C++ vs C.

This bugs me the most because it's such a fringe view, OO has dominated industry purely by dogma, alternative programming paradigms are just simply ignored because: "OO is best. End of."

https://researchgate.net/profile/...

Comments
  • 7
    @illusion466 interested to see why you think they are both rubbish.

    C is incredibly useful for performant applications
  • 2
    @illusion466 though embedded systems it matters, I get your point.

    My main point was referring to the evidence that one language/paradigm is more productive than the other. Rather than just assuming based on your own bias and experience.

    I'm here to challenge dogma.
  • 2
    I don't think you can compare the two. Yes they share the name and the Syntax, but the programming style is very diffrent. In c++ one can programm Object Oriented, Imperativ or functional and probably in many ways more I don't now of. In C, as far I know, Imperativ programming is the only way. I'm not saying this is a bad thing, but because I like mixing styles I prefer C++. Important is "prefer", the language you write the best code in is automatically the best language for you.
  • 3
    @Batburger I think they can be compared to a degree, they are both general purpose programming languages.

    But that wasn't really the crux of my point.

    My biggest problem is with people who blindly accept the "common knowledge" that C++ or OO are more productive than another language or paradigm, when there are actually many good studies that show there really is no difference. This has been debunked many times.

    Yet do a Google search and one sees such an idea is entirely a minority view.
  • 0
    @Hedgepig I 100% agree no language is the best. One would never use c++ for integrated chips for instance. Or JS for AAA games. Or R for extending applications.
  • 1
    @Batburger though most of those have been done. AAA JS game is becomming more and more technically feasible
  • 0
    @Hedgepig It's odd having to spacify the scope of the game
  • 1
    m_post.addFlag( SARCASM );
    m_post.comment( "I personally like writing my algos in xhtml. I heard it was a really fast programming lang" );
    m_post.removeFlag( SARCASM );
  • 0
    @Batburger You can go OO in C. Search Abstract Data Type ;)
  • 2
    I don't understand these 'wars' people always bash C/C++ and then go ahead and give arguments on why we need languages like Java. It's like saying a screwdriver is bad for hammering nails, yes I know that's why we have hammers! I agree that there are bad languages I just don't think C or C++ are one of them.
  • 1
    @Hedgepig I get what you're saying, but i think you are dismissing OOP completely.
    It's just a methodology that isn't available in C (a.f.a.i.k)

    I like the structure it adds to my code, makes it somewhat easier to communicate "how it works" when its about a complex system.

    But i dont always code like that especially when im writing scripts.
  • 3
    @bioDan out of interest did you learn OOP from the start?

    I'm more just frustrated by the dogma of OOP, it is almost completely accepted as the best methodology based on little to no evidence beyond personal experience.

    Funny enough I am more of a functional guy
  • 1
    @Hedgepig nah.. I started by playing with code that my older cousin wrote in QBASIC and PASCAL. They are not (a.f.a.i.k. or at least QBASIC isnt) O.O.
    Then i learned C and quickly moved to C++ during my high-school period. But even although i knew what my code does in a very superficial way, i didnt do any O.O.P. (this was in Israel, from about 1995-2002)
  • 2
    @bioDan Sounds like a good procedural foundation. Though I think it's not a bad idea to learn other methodologies like functional or logic
  • 3
    You labelled this as a language war, but it's more of a paradigm war, so I'll contribute to that:

    I think OOP is overly complicated for one simple reason: objects are stateful. Just think about this: how often do you get the same results when calling an object's method with the same arguments?
  • 2
    @Hedgepig it may even be an excellent idea! I guess its all about the same old question of "what do you want to develop today?"
  • 2
    @shellbug cool insight!
  • 3
    @bioDan I've seen people struggle with OOP because they end up writing classes that handle too much state.

    Reasoning with state while handling logic makes it harder to write and test code.
  • 3
    On the other hand, one can make their objects immutable and make methods return new instances that reflect the state changes.
    This eliminates side effects on objects and thus reduces complexity.
  • 2
    @shellbug exactly. Couldn't have said it better myself.
  • 1
    @shellbug can that be called OO then? My understanding is it is inherently stateful because the core principles of OO are to deal with state.
  • 2
    @Hedgepig I believe so. An immutable object is still a representation of state after all. Take a look at Java's String class for example.
Add Comment