Slashdot Mirror


Is C++ a 'Really Terrible Language'? (gamesindustry.biz)

Long-time Slashdot reader slack_justyb writes, "Jonathan Blow, an independent video game developer, indicated to gamesindustry.biz that while working on a recent project he stopped and considered how miserable programming can be. After some reflection Blow came to the realization as to why. [C++ is a] 'really terrible, terrible language.'"

The main flaw with C++, in Blow's opinion, is that it's a fiendishly complex and layered ecosystem that has becoming increasingly convoluted in its effort to solve different problems; the more layers, the higher the stack, the more wobbly it becomes, and the harder it is to understand.
"Blow is the developer of two games so far -- Braid and The Witness -- and developed a new programming language known as Jai in hopes to help C++ game developers become more productive."

With Jai, Blow hopes to achieve three things: improve the quality of life for the programmer because "we shouldn't be miserable like many of us are"; simplify the systems; and increase expressive power by allowing programmers to build a large amount of functionality with a small amount of code.

Long-time Slashdot reader xx_chris calls C++ "the triumph of syntax over clarity," while in the interview Blow calls C++ 'a weird mess.' But the original submission ends with these questions. "Is Blow correct? Has C++ become a horrific mess that we should ultimately relegate to the bins of COBOL and Pascal? Are there redeeming qualities of C++ that justify the tangle it has become?

"And is Jai a solution or just yet another programming language?"

22 of 603 comments (clear)

  1. Re:Yes by Joce640k · · Score: 5, Insightful

    Nope.

    People who don't understand C++ are doomed to recreate it, badly.

    --
    No sig today...
  2. Use a subset by Anonymous Coward · · Score: 2, Insightful

    And choose your libraries wisely.

  3. Know what things to avoid. by Anonymous Coward · · Score: 5, Insightful

    Part of the challenge of using a language is not just knowing all of the things you *can* do. It is also knowing which things are best to avoid, and what the pitfalls are.

    1. Re:Know what things to avoid. by Anonymous Coward · · Score: 1, Insightful

      No. There's a huge difference between learning the proper idioms of a language vs. needing to avoid dangerous, confusing, and hard to use aspects of a language. Good languages have very few of the latter, bad languages have many. Considering how often people talk about using subsets of C++, I'd say it's obvious which category it falls into.

  4. No it's not. by Anonymous Coward · · Score: 2, Insightful

    No C++ is not a terrible language.
    It's still IMHO the best general purpose language there is, but it has grown a devilishly high threshold to master.

    With "general purpose" I mean a language you can use in both user-mode and kernel-mode, that you can use to express and implement anything in.

    It's like a toolchest with so many tools it'd baffle a newcomer, and probably not even half of them would be user by a master craftsman in a single project, but together they create the best toolchest there is - is looking only at a single language.

    Perhaps that last point is what most miss - there is no silver bullet.

    1. Re:No it's not. by OneHundredAndTen · · Score: 4, Insightful

      It's a worthy conceptual child of PL/1.

  5. Doctor, it hurts when I go like this by Anonymous Coward · · Score: 2, Insightful

    If one uses every single feature of C++, then it's probably a really terrible language.

    If one only uses features that make C++ better than C, then it's usually good enough.

  6. You are holding it wrong by Nkwe · · Score: 3, Insightful

    C++ is not necessarily a horrible language, but it does allow you to write horrible code. You can also write easy to read well organized code that is "good" - it's entirely up to the developer. With great power comes great responsibility, yadda yadda.

    You can write really good or really bad code in pretty much any language. Generally if your code ends up unreadable, you are doing it wrong.

    That being said, if the semantics of a language tend to encourage people to write horrible code, does it make it a bad language? Good question. Discuss.

  7. Re:Yes by Narcocide · · Score: 5, Insightful

    Doesn't happen much, but this time I'm going to have to agree with Anonymous Coward. All that will be accomplished by making programming languages easier is fostering the proliferation of even less qualified jackasses flooding the market with dangerously insecure and buggy code.

  8. This is why Rust is popular. by Anonymous Coward · · Score: 1, Insightful

    Rust is a new language developed by Mozilla. It can be seen as the successor to C++, because it puts so much emphasis on zero-cost abstraction and high performance (unlike a language like Java), while also being a lot safer (unlike C). Rust is basically what C++ would have been had it been developed 30 years later. This is why we've seen Rust become so popular so quickly: it gives the benefits of C++, but avoids so many of C++'s problems. You don't have to move to a language like Java or Perl or Go any longer. You can just use Rust, which is like a leaner, more modern C++.

  9. Re:Obcious by david.emery · · Score: 4, Insightful

    Disagree. It's more convoluted than C, but adapts C's very error-prone syntax. It's more complex than Basic, FORTRAN or COBOL. It doesn't have the simplicity of Pascal nor the consistency of Java or Ada.

    It's definitely a 'science experiment that escaped from the lab.'

  10. Never learned C++ by innocent_white_lamb · · Score: 4, Insightful

    I've been programming for over 40 years (shudder..) and have always used C. Never seen a need for C++ for the sort of things that I do.

    Perhaps it's because I don't do games and fancy graphics. I do things like counting pulses from water meters and getting coordinates from survey instruments.

    You could get some really fancy graphics out of Amigas using C, though. :)

    --
    If you're a zombie and you know it, bite your friend!
  11. It wasn't always shit by Tsolias · · Score: 3, Insightful

    Before c++11, c++ had great features that helped you write cleaner code.
    The last time I bothered in a bureaucratic way with c++ was in 2013 when I was in a committee to send some features in for suggestion.
    The meeting had a lot of people yelling at a guy who was part of isocpp iirc half a decade ago, and he flew from usa for that purpose.
    I left in the middle of this shit.
    Long story short and I am adding here not only my opinion but the opinion of every colleague who wrote c++ in research labs in different hierarchy levels inside an os, C devs do need C++ to help them write code easier, without hassles and give them more tools when they need them.
    C++ the last 10 years has been adopting the web dev language cycle.
    You have to have the bleeding edge of features to stay relevant...as frameworks languages and apis die and born every day.
    C++ has no enemies, yet it's getting tackled by its own people.
    Instead of having powerful lean language, just like C, you have a clusterfuck of a language.
    I stopped using the bewest and coolest features because most of them are useless and don't worth the extra effort to include them in your programming style and most importantly there are out there a shitload of colleagues who don't know or care about the latest and greatest feature.... Because they are s/w engineers, not programming hipsters.
    I don't think c++ will ever recover. It will grow and grow in terms of features and also those features will become more and more irrelevant as less and less people will adopt them.
    Tbh C with classes had a negative meaning 15 years ago. Now it seems like the sane way of writing good and intuitive c++ code.
    Maybe it's just me.

  12. Re:Yes by MichaelSmith · · Score: 5, Insightful

    There is nothing saying you have to use every bit of it.

    Other than the guy you inherited the codebase from.

  13. Re:C++ is great by mykepredko · · Score: 4, Insightful

    Saying it's better than Javascript isn't a ringing endorsement.

  14. For certain values of terrible. by AnotherBlackHat · · Score: 3, Insightful

    C++ is, IMO, terrible.

    I hate that it allows polymorphism. Worse, it makes people think that polymorphism is a desirable feature that helps create clear, readable code.

    It encourages the creation of functions that operate on classes instead of on generic data types.
    For example, if a C++ program has a "car" class that include the elements "miles" and "gas" a C++ programmer is likely to create a function
    car::calc_mpg() which requires (seemingly) no arguments, rather than the more generic calc_mpg(int miles, int gas)
    The problem is, the first is not reusable, and depends heavily on knowledge of the car class.

    It encourages inheritance, which fundamentally breaks the box-model (a.k.a. the black-box-model) of programming.
    Rather than breaking things into discrete, understandable chunks, it encourages massive classes that must be understood in their entirety.

    Then there's operator overloading, code that can be executed before main(), putting code in unexpected places... I could go on, but I think you get the idea.

    The main problem is, C++ adds stuff with the unjustified expectation that more stuff automatically mean better.
    Sometimes more stuff is worse.

  15. Re:Obcious by jcr · · Score: 4, Insightful

    Nope, C++ wasn't designed at all: it was accreted.

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
  16. Re: Yes by Anonymous+Brave+Guy · · Score: 3, Insightful

    new[] and delete[] don't do anything that can't be done much better with std::vector.

    Well, they can be used to implement std::vector.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  17. Re:Yes by careysub · · Score: 5, Insightful

    I hope you get modded way up! This is the fallacy of the "but only use a subset and you are good".

    Real world programmers must maintain and modify code bases that have been written by people that no one currently at the company even knows.

    --
    Starships were meant to fly, Hands up and touch the sky - Nicky Minaj
  18. Re:Yes by dfghjk · · Score: 3, Insightful

    The discussion is moot when it involves inherited codebases. You are compelled to use the tools already selected whether you like them or not.

  19. Re:Yes - Bless You by NReitzel · · Score: 3, Insightful

    When one hires chimpanzees to write code, one gets code written by chimpanzees. No language tool will make up for lack of understanding. The more flexible a tool, the easier it is to write code that is simply horrid. To turn around and blame the language is disingenuous at best and at worst, promulgates the idea that good code is easy and within the grasp of just any old person.

    Anyone can play a scale on a piano. Anyone can figure out what the notes on the music mean. That does not mean that anyone can play Frédéric Chopin's Minute Waltz. More to the point, a "better" piano won't fix this.

    --

    Don't take life too seriously; it isn't permanent.

  20. Re:Yes - Bless You by Joce640k · · Score: 1, Insightful

    Performance-wise, compiled JS is pretty good these days.

    True, but:
    a) To get that performance you have to try and program using as few dynamic features as possible.

    b) The expressiveness of the language is terrible: Inheritance and code-re-use is non-existent ("prototype"? LOL!), building proper data structures in Javascript is impossible, at the end of the day everything devolves to closures and there's nothing maintainable or readable about that.

    Go search for "douglas crockford javascript" on youtube and see how many knots he ties the language in towards the end. He keeps using the word "elegant" but it's not true.

    --
    No sig today...