Slashdot Mirror


Interviews: Ask Bjarne Stroustrup About Programming and C++

In addition to being the creator of C++, Bjarne Stroustrup is a Managing Director in the technology division of Morgan Stanley, a Visiting Professor in Computer Science at Columbia University, and a Distinguished Research Professor in Computer Science at Texas A&M University. Bjarne has written a number of books and was elected a member of the National Academy of Engineering. He will be doing a live Google + Q & A within the C++ community on August 20th, 2014 at 12:30pm EST, but has agreed to answer your questions first. As usual, ask as many as you'd like, but please, one per post.

20 of 427 comments (clear)

  1. Cutting features and old syntax? by Katatsumuri · · Score: 5, Interesting

    Sometimes well-established languages keep adding new features and syntactic constructs until most developers are not even aware of all the possibilities, and use maybe 20% in their usual daily work. The old features and syntax are kept around for compatibility and to keep the old guard content, even if cutting them would lead to faster compilation, more elegant language and less confusion.

    This may be part of the reason for the constant introduction of new trendy languages with radically simplified syntax and libraries... Which then follow the same pattern. Few languages are introducing new paradigms, many are trying to be a "better" C++, Java, LISP, JavaScript or Perl.

    Do you think this cycle is inevitable, or could it be a good idea to sometimes clean up the syntax and the obscure features in new specification versions, to keep the established languages more competitive?

  2. Is the complexity of C++ a practical joke? by Anonymous Coward · · Score: 5, Interesting

    C++ is one of the most complex, inscrutable computer languages ever created. When I read about C++11, I was surprised that it layered more complexity and inscrutability on top of what was already there (like the weird lambda syntax). I wonder if C++ has become an over-the-top example of how not to do a programming language. Is that by intent, or did it just happen? In future versions of the language, will any cosmetic changes be made to create a more understandable language that doesn't overload a small set of symbols and keywords, so that normal programmers have a chance to figure out the language? The language seems to have reached the point that C++ gurus design it for other C++ gurus, and everyone else ignores it. C++ was once the up and coming language of choice, but it has become so difficult that programmers have considered it damage and routed around it. Are you comfortable with this fate for C++, as a niche language for insiders, or do you want to use your influence to rehabilitate the language so that more programmers will use it?

    1. Re:Is the complexity of C++ a practical joke? by narcc · · Score: 5, Funny
    2. Re:Is the complexity of C++ a practical joke? by just_another_sean · · Score: 5, Insightful

      A practical joke? Are you joking? C++ is not designed so that every feature must be learned and used. It's complexity derives from the fact that it supports OOP, functional programming, generic programming and I'm sure others that Bjarne would happily describe to you and the reasoning behind supporting features being included in the language. Those that are confused by C++'s complexity are doing it wrong. As with Perl it's OK to use only what you're comfortable with, no one is going to make fun of you for not using advanced features and if you like you can keep a C++ program pretty basic.

      But it supports all these features to give people what they need to get their jobs done. Lambdas looked a little strange to me at first too but as I studied the examples in Bjarne's book they became clear and I think they are quite expressive, easy to use and worth looking into, especially when you combine them with the types and algorithms in the STL.

      Look, I'm a Bjarne fanboy, have been since I started programming in the 90's so maybe my bias is showing through but I never thought I'd come to an article about C++ on /. and find the only comments above a 3 were people whining about how complex a programming language is. Programming is complex, system's programming doubly so and C++ is designed to help reduce that complexity, while at the same time remaining resource efficient, when it's used correctly. If it's too hot to handle for you there is always Visual Basic.

      --
      Creationist Textbook Stickers Declared Unconstitutional by CowboyNeal
    3. Re:Is the complexity of C++ a practical joke? by Katatsumuri · · Score: 4, Insightful

      it's OK to use only what you're comfortable with

      ...until you have to read, debug, maintain and extend someone else's code.

    4. Re:Is the complexity of C++ a practical joke? by Immerman · · Score: 5, Insightful

      And? Life is a learning experience, so break out the reference manuals and learn something new. Unless you've been thrown in way over your head it's unlikely you'll encounter more than one or two new methodologies in any given codebase, and it'll probably be pretty glaringly obvious when you run into a language feature you don't understand.

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    5. Re:Is the complexity of C++ a practical joke? by smaddox · · Score: 4, Informative

      C# pioneered lambda's.

      Whaaaaaat? C# was created in 1999/2000. Lisp, which was based on lambda calculus, was first specified in 1958.

    6. Re:Is the complexity of C++ a practical joke? by kthreadd · · Score: 5, Funny

      C# pioneered lambda's.

      (get (off) (my lawn))

    7. Re:Is the complexity of C++ a practical joke? by dentin · · Score: 4, Insightful

      This is a very good set of observations, and I also feel that C++ has become a 'niche language for insiders'. The syntax is difficult; it's remarkably easy to shoot yourself in the foot in unobvious ways; and porting can be problematic, as no two compilers compile the same code the same way. Trivial mistakes such as pointer aliasing are often compiled -silently and without error-, producing different results at different optimization levels, and -this is considered normal-. Over the years, you learn these things and you figure out which things to avoid, but for new people coming into the language, it's a huge barrier to entry.

      If the goal is to really get a lot more programmers to use it, the base syntax almost certainly needs to be improved. Rather than providing some obscure syntax to do some obscure library feature, make it easy to do simple things and make the language as idiotproof as possible. Make compilers either strictly produce well defined output as per the spec, or throw an error. Do -something- to improve template syntax.

      Pretty much all of the new features I've seen in the C++11 spec are niche features, things used by high-end library writers with 20 years of experience to do complicated library things. That's good, libraries are important. But libraries will not translate into users if normal users cannot use them, and libraries will not translate into users if the language itself is the bulk of the learning curve.

      --
      Alter Aeon Multiclass MUD - http://www.alteraeon.com
  3. On the evolution of C++ by stox · · Score: 5, Interesting

    How do you feel about the evolution of C++ since it was first implemented with Cfront? What began as a pretty straightforward language has been expanded to significant complexity. Has this evolution been positive, or has it been an attempt to make the language apply to too many possible applications?

    --
    "To those who are overly cautious, everything is impossible. "
  4. Favourite programming language by Bugamn · · Score: 5, Interesting

    What is your favourite programming language that isn't C++ (or C)?

  5. Regrets by Anonymous Coward · · Score: 5, Interesting

    What do you regret most in C++ and how would you like to change it?

  6. Replacement for iostream by tepples · · Score: 5, Interesting

    The general consensus as I understand it is that the <iostream> wing of the C++ standard library is hairy, convoluted, time inefficient, and space inefficient in implementation. What's the better solution? <cstdio>? Is Boost.Format, as shutdown -p now suggested, any good?

  7. Hour of Code by Orestesx · · Score: 4, Interesting

    What is your opinion of the the "Hour of Code" as promoted by CSEdWeek? Does it trivialize computer science education?

  8. ABI by gbjbaanb · · Score: 5, Interesting

    Do you think that one thing holding C++ back is the lack of a standarized binary interface?

    Currently if I want to make a module that can be consumed by others (whether than is others using a different language, or a different C++ compiler, or even just to use a pre-built module without sources) I have to export everything as C and use its (de-facto if nothing else) binary standard.

    I think an ABI for C++ would increase its "real world" attractiveness considerably with little, if any, overhead. Do you agree, or are there issues around this that make it a significant challenge (apart from vendor adoption of course).

  9. diversity? by slashdice · · Score: 5, Funny

    Workforce diversity is a big issue these days. What steps has the c++ working group taken to increase the numbers of female and minority contributors? C++ (perhaps unfairly, due to the popularity) is often criticized in feminist circles for being a patriarchal programming language. Will you be taking steps to address those concerns?

    --
    Copyright (c) 1990 - 2014 Dice. All rights reserved. Use of this comment is subject to certain Terms and Conditions.
  10. C++ is an over bloated monster by Jay+Maynard · · Score: 4, Insightful

    I learned C++ the hard way: by hacking on a million-LOC program. It's taught me to loathe the language. It's big, complex, and incomprehensible. I once spent three days chasing a bug through a twisty little maze of templates, all different. I routinely struggle with the implications of static vs. not, member variables vs. globals vs. statics, functions that are part of a class vs. those that aren't... Getting code to even compile is often an exercise in trying something, running the build process, then trying something else, lather, rinse, repeat. It's left me frustrated enough to want to drive to College Station and scream at the walls.

    All of this has left me wishing for the days of C, in which I'm quite fluent.

    Nevertheless, the world seems (perhaps overly) enamored of C++, and I'm probably going to have to deal with it. How do I learn to at least tolerate it, if not like it, instead of actively hating it?

    --
    Disinfect the GNU General Public Virus!
  11. How do you feel about the haters? by BenSchuarmer · · Score: 4, Interesting

    The comments and questions here look overwhelmingly negative. On the other hand, all of this passion only exists because people are using C++.

  12. C++ without the C by kthreadd · · Score: 4, Interesting

    Apple recently introduced a language they call Swift or Objective-C without the C. It is technically a completely different language from Objective-C though. When C++ started out it had the major benefit that it was (mostly) compatible with C which at the time was immensely popular, making it trivial to mix new C++ code with existing C code. Today C is still a popular language but not as widely used as it once was. Assuming that C++ could drop C compatibility, how would you take that opportunity to improve C++?

  13. Code rejuvenation by SansEverything · · Score: 4, Interesting

    You speak alot about code rejuvenation and bringing old code to new standards. As you are working on C++14, many compilers do not fully support C++11 yet. In the past, it was even worse. Don't you think that this lack of feature support from compilers is a major problem and the biggest obstacle to code rejuvenation?