Forgot your password?
typodupeerror
Programming

Interviews: Ask Bjarne Stroustrup About Programming and C++ 427

Posted by samzenpus
from the go-ahead-and-ask dept.
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.
This discussion has been archived. No new comments can be posted.

Interviews: Ask Bjarne Stroustrup About Programming and C++

Comments Filter:
  • Do you think the H1B system is a joke? and they are useing it to get cheap work out people chained to the job?

    • Re: (Score:3, Interesting)

      This question is a little US-centric. Let me try to iteravely improve on this...

      From your perspective, how is the globalization of commerce and specifically programming affecting you and those you know? Are the new high level scripting tools available to programmers since C++ became popular pushing the profession towards a more "commoditized" state, where people are easily replaceable and where the related skills and specialization eventually offer no better benefits and compensation than other less skil
      • by Orestesx (629343)
        It's a fair question, he lives and works in the United States at an international that no doubt employs many H1B's.
  • by Katatsumuri (1137173) on Thursday August 14, 2014 @12:52PM (#47671349)

    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?

    • by Wootery (1087023)

      Reminds me of of a blog-post I stumbled across a while ago: Heat Death Of Programming Languages [blogspot.co.uk]

      Other than a select few (C and Scheme spring to mind), programming languages get more and more bloated and incoherent over time. We certainly see this in C++, which is probably the 'best' example of the ugliness that arises through backward-compatibility. There are 4 different languages in C++ now: C++ proper, the preprocessor, the template system, and the compile-time-friendly subset.

      I suspect the D language may

      • What is the compile-time-friendly subset?

        The preprocessor should not be used for things that affect code, like constants or function-like macros. Those should be const declarations and templates, respectively. Its primary remaining use is conditional compilation. That hardly counts as a language.

        It's unfortunate that the template system isn't closer to normal C++ (in Common Lisp, the macro, which does more or less what templates do, is written using normal Common Lisp), but it's not that bad.

        • by Wootery (1087023)

          What is the compile-time-friendly subset?

          constexpr [wikipedia.org]. The subset was grown considerably in C++14.

          Its primary remaining use is conditional compilation. That hardly counts as a language.

          Well, no, it does count as its own language, because... it is. If you grant that the preprocessor is, at least. It's clearly separated from the C++ 'core' language, and it's something non-trivial that a C++ programmer needs to know about. Much like the preprocessor.

          There are plenty of neat tricks to be had with the template system that aren't really just conditional compilation. Type traits [cplusplus.com], static-asserts [boost.org], Boost.Function [boost.org] and Boost.Bind [boost.org] spring to mind.

      • That's an interesting take on things.

        The C standards people have resisted adding much to the language. This is good, but it's been a long time since I've reached for C for a new project. The main reason is that that the language is quite primitive and does very little automatically. For those reasons it won't go, but there's little reason to use it in new projects.

        And LISP always did everything anyway but personally I like the last 60 years of parsing theory and find it much easier for the compiler to parse

  • by Anonymous Coward on Thursday August 14, 2014 @12:54PM (#47671361)

    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?

    • Re: (Score:3, Insightful)

      by UnknownSoldier (67820)

      This needs to be modded +10.

      C++ has become a clusterfuck of engineering.

      Some of the most painful moments of my life were working on a professional C++ compiler. Almost everyone uses the EDG front end to minimize the pain of parsing C++ into an AST.

      • Almost every except GCC which is probably the most popular compiler in the world, and LLVM which certainly has a decent following. I don't believe Visual Studio uses EDG for the main compiler either.

        • by Garen (246649)

          They do use it for Intellisense [edg.com] though, because C++ code is so difficult to process that Microsoft couldn't manage to re-use their own (presumably it'd be too much work to re-architect).

          Which means that there are essentially only two truly robust, re-usable C++ front-ends in the world: Clang and EDG. This is bad for everyone, because it hurts portability.

          (So I totally emphasize with the OP's comments. I wish there were some way to version the language, so that we wouldn't have to be saddled with backwards

    • by just_another_sean (919159) on Thursday August 14, 2014 @01:30PM (#47671681) Homepage Journal

      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.

      • by Katatsumuri (1137173) on Thursday August 14, 2014 @01:39PM (#47671737)

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

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

        • by Immerman (2627577) on Thursday August 14, 2014 @02:02PM (#47671925)

          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.

          • I agree, there's always new things to learn; in some languages more than in others. Some people find it exciting, others find it annoying. I currently don't use C++ daily, so I am not frustrated with it. In fact, I like many of the new features. But I can understand why some people complain.
        • by mark-t (151149)
          In my experience, most corporations where extending or maintaining code that another person has written, coding styles are generally adopted so that the code is uniform. Adoption of such styles does not, in general, limit the expressive capability of the language, it just means that when you write code, you will be writing it in a way that other people will be able to read and maintain. Of course, this is not a specific issue for C++... it is equally applicable to all programming languages, and the real-w
          • Just to make it clear, I was not judging the design of C++. I only made a counter-point to the "use your own subset" argument. I agree that coding standards reduce this problem, but they also cannot solve it completely.
          • by dentin (2175)

            Further, in my opinion, we should look at the most common coding conventions and consider adding pieces of them to the compiler and language specification if it makes sense to do so. Naming of functions almost certainly doesn't make sense; but requiring braces after all conditionals very well might (and may make compiler parsing of other constructs easier to handle.)

            The most common coding styles almost always touch on what would be 'best practices' in the field. Adding those 'best practices' to the core l

            • Require braces around all conditionals, and you (a) break immense amounts of code, and (b) make a lot of code harder to read.

        • Look, people are going to write crap code in any language. If you've got to figure out exactly what that yo-yo was trying to do, a few quick manual references aren't going to be much of an additional burden.

      • by jopsen (885607)

        A practical joke? Are you joking? C++ is not designed so that every feature must be learned and used.

        Agree... if someone wants to use STL to create a DSL, I say we let them shoot their own foot :)

    • by dentin (2175) on Thursday August 14, 2014 @02:31PM (#47672231) Homepage

      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.

    • by Kjella (173770)

      C++ is one of the most complex, inscrutable computer languages ever created. (...) Is that by intent, or did it just happen?

      Yes and no, depending on how you look at it. Once upon a time like 40+ years ago there was C. While there was others, C was massively successful in the 1970s because it was a very good but really thin abstraction layer over assembler, which was very common at the time. That means you could write C and it'd run on many different kinds of machines, conversely if your platform wanted to g

      • You can write iOS Apps in any language you want.
        The limitation to C/C++/Objective C is long long long gone.
        And now we have Swift anyway ... get your head out of the sand!

    • by Megane (129182)

      I suggest you read D&E to understand how various parts of the language came to be. Then read Google's C++ coding style standards so that you can realize that you are not alone, and other people think that many of the features of C++ are inscrutable crap, too.

      I mean, I understand the need for templates, but that doesn't mean I have any love for using them. C++ did a good job of adding OOP on top of C as a systems language (class methods are so much cleaner than tables full of pointers to functions), but

      • Class methods, that are those 'defined' with the keyword `staticâ in front, don't need tables of function pointers, nor do non virtual member functions / object methods ;) just nitpicking, sorry.

    • C++11 programs can avoid some complication. In general, it's a considerable improvement. It does introduce new concepts, but makes some older ones obsolescent. Any change to an established language has to be an addition (the only exception to this I know of being removing "export" in C++11), so while it's impossible to remove old features it is possible to avoid using them.

      The problem with modern C++ is that it is very often ineptly taught. Anybody teaching a C++ class that does more than mention C-t

  • by stox (131684) on Thursday August 14, 2014 @12:58PM (#47671401) Homepage

    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?

  • by Bugamn (1769722) on Thursday August 14, 2014 @01:00PM (#47671421) Journal
    What is your favourite programming language that isn't C++ (or C)?
  • by slashdice (3722985) on Thursday August 14, 2014 @01:01PM (#47671427)
    Maybe the premise of this question is wrong... but I seem to recall reading somewhere that you hate C but built C++ on top of it because it was popular. Is that true and if so, do you ever feel bad about the bait and switch?
    • by dentin (2175)

      Further, since C++ is often called 'a better C' and is not backwards compatible with C compilers, will there be specification changes to sanitize and improve the lower level C aspects that are problematic? Examples would be strict parsing of the language without compiler dependent ambiguity, removal of duplicate constructs such as the ternary operator, requiring braces after all conditionals, strictly defining the bit width of standard types (int = 32 bits, short = 16 bits, char = 8 bits), etc.

    • If you read his "Design and Evolution of C++", which is a great book, you'll find that he really liked the classes from Simula 67, and found it painful to translate all that into C when he actually had to run a large-scale simulation. The original "C with Classes" was a language that compiled to fast code and was heavily portable, but had Simula 67 classes.

      If you're going to ask about a "bait and switch", could you be specific about what you think that is?

  • also: (Score:3, Insightful)

    by slashdice (3722985) on Thursday August 14, 2014 @01:03PM (#47671441)
    Has everyone responsible for the std::vector<bool> tragedy been kicked in the nuts until they are no longer at risk of reproducing?
    • Similarly, are we stuck with that particular idiocy forever, or do you think we can get it out of the standard and into the garbage heap where it belongs?

      Remember, kids, almost all things in the container libraries are good STL containers, except for that one abortion that's easy for somebody to use and confusing if they fall into the trap?

  • Regrets (Score:5, Interesting)

    by Anonymous Coward on Thursday August 14, 2014 @01:04PM (#47671447)

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

  • by tepples (727027) <tepples AT gmail DOT com> on Thursday August 14, 2014 @01:04PM (#47671459) Homepage Journal
    The general consensus as I understand it is that the <iostream> wing of the C++ standard library is hairy [yosefk.com], convoluted [slashdot.org], time inefficient [vterrain.org], and space inefficient in implementation [pineight.com]. What's the better solution? <cstdio>? Is Boost.Format, as shutdown -p now suggested [slashdot.org], any good?
  • by DaphneDiane (72889) <tg6xin001@sneakemail.com> on Thursday August 14, 2014 @01:05PM (#47671471)

    One of the recent concerns raised with C++ compared to other popular languages is the breadth of the standard library. I know that the C++ standard committee was looking at adding a C++ transformed version of Cairo to the standard. And of course their is boost. What else do you see coming to address the perceived API shortcomings?

  • With so many new languages writing a spec and then a standard compiler to conform to the spec, I'm curious how you feel about writing a spec and not a compiler.

    How do you think this compares to other efforts? Do you enjoy this aspect or do you occasionally get your hands dirty with a particular compiler source? etc.
  • Hour of Code (Score:5, Interesting)

    by Orestesx (629343) on Thursday August 14, 2014 @01:07PM (#47671489)
    What is your opinion of the the "Hour of Code" as promoted by CSEdWeek? Does it trivialize computer science education?
  • ABI (Score:5, Interesting)

    by gbjbaanb (229885) on Thursday August 14, 2014 @01:08PM (#47671501)

    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).

    • Let me add to this, do you think an ABI plus a specified subset of C++ to be used in the creation of script interpreters and REPLS which can use binary modules created by C++ is a good idea?

  • diversity? (Score:5, Funny)

    by slashdice (3722985) on Thursday August 14, 2014 @01:11PM (#47671513)
    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?
    • I'm actually mainly concerned about females of asian+black ancestry or asian+caribbean ancestry. Well, considering the caribbeans are already a melange, I guess you get my drive.

      It would be so cool to have a few of such girls around in my office ... I would not mind if they only do C# or Java ...

  • AI writing code? (Score:3, Interesting)

    by Katatsumuri (1137173) on Thursday August 14, 2014 @01:11PM (#47671519)
    Do you think AI will start replacing junior programmers in the foreseeable future, similar to car drivers and call center operators?
    • Do you think AI will start replacing junior programmers in the foreseeable future, similar to car drivers and call center operators?

      Why ask Dr. Stroustrup and wait for an answer? Siri could tell you now...

      • I appreciate the humor, but actually Siri is another example of a human job (personal assistant) going partially obsolete. Not that the current implementation is good enough to answer questions like this one.
    • Compiliers allowed you to move from brutal machine-language numbers to language-like or math-like statements; from number to problem-domain concepts. Compilers were complex pattern recognition, rule-base translators that implemented this. I've seen some early ads touting COBOL as programming in "almost English" (har har). As with most soft-A.I. results, once you did it, it wasnt really considered A.I. anymore.
      • Agreed, I was also considering this when I was asking this question. Perhaps I should have elaborated further.

        The advances in software engineering tools so far made programming more efficient and more accessible, so more people can do it now, and some people can achieve much more in small teams. But still, it is a skill that qualifies as a profession, and people who do it part-time also need a lot of learning.

        The point of my question is, will it get to a degree when instructing the computers even for cu

  • When is C++ going to natively support multiple return types?
    i.e.

    float sin, cos, angle;
    sin, cos := SinCos( angle );

    Right now we can use a struct hack, but native support would be appreciated.

    _When_ are pragmas going to be standardized instead of relying on brain-dead proprietary extensions where MSVC does things one way and GCC another way? i.e. I'm specifically talking about the idiotic verbose

    __attribute__((always_inline))

    __inline
    __forceinline

    i

    • by tepples (727027)
      One question per post please.

      When is C++ going to natively support multiple return types?

      You refer to the struct or tuple hacks [stackoverflow.com]. PHP and Python use a tuple hack similar to C++'s to return multiple values. Perhaps what you really want is readable syntax for assignment of multiple variables from a std::tuple. And now my own question for Bjarne: When are we getting that?

      • by dentin (2175)

        Hopefully, not for a long time. C++ doesn't need more complexity at the moment. It needs less.

    • Lastly, C++ has been extremely complex. When is C++ going to simplify the total over-engineering of the language?

      The same way you simplify any other multi-paradigm language: Learn a subset and use it. PNG, SVG, and the like have "profiles", where an implementation can choose to leave particular sets of features unimplemented and declare this in its profile. Now my own question for Bjarne: Do you plan to implement anything like these profiles in C++ to make well-defined subsets easier to learn?

      • We _already_ went through the "mistake" of Embedded C++ [wikipedia.org] in the 90's -- a subset of C++ with no RTTI and Exceptions turned off.

        We don't need sub-sets of languages. We _already_ have those when programmers don't use all the complicated and over-engineered parts of C++.

        • > We don't need sub-sets of languages. We _already_ have those when programmers don't use all the complicated and over-engineered parts of C++.

          We don't need sub-sets of languages. We already have them when compilers don't fully implement the entire language. (Rewind to mind 1990's.)
          • by dentin (2175)

            Even when they do fully implement the entire language, the 'compiler dependent' aspects of the language allow compilers to produce arbitrary results.

      • by dentin (2175)

        No. No no no no no. No.

        Just, no.

        Having lived through the embedded C/C++ debacle, I can't stress 'no' hard enough.

    • Either you want to inline a function or not. You hotness makes no sense at all. Considering that compilers inline aggressively anyway if they can, you proposal is nonsense.

    • by dentin (2175)

      The last thing C++ needs right now is another complex feature which adds more syntax and fundamentally new operation.

  • by Rob Riggs (6418) on Thursday August 14, 2014 @01:22PM (#47671597) Homepage Journal
    When will Boost ASIO make in into the standard library? C++ really needs something of this magnitude for networking and asynchronous event handling. I have not heard much on N3360 since it was proposed.
  • by DickBreath (207180) on Thursday August 14, 2014 @01:24PM (#47671619) Homepage
    How do you feel about the fact that Darl McBride said that SCO owns C++?

    Source 1 [lwn.net]
    Source 2 [linuxtoday.com]
    Source 3 [wikiquote.org]
    Source 4 [thefullwiki.org]
  • by Jay Maynard (54798) on Thursday August 14, 2014 @01:28PM (#47671663) Homepage

    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?

    • by dentin (2175)

      Personally, I do a lot of the following:

      - learn the minimum aspects of the language needed to navigate your specific codebase, and learn them very well
      - copy/paste of terrible syntax to avoid compiler failures
      - avoid using templates if at all possible
      - create strongly typed specific-use classes that export only the minimum functionality of the underlying libstdc++ classes without using templates
      - keep all pointer casting to well defined, central locations
      - all production code runs with asserts on all the ti

      • Avoiding templates has two sides:
        a) not crafting your own, where a misplaces bracket causes 2000 lines of a compiler error message or
        b) using already existing templates

        If you don't use templates of the STL or BOOST, sorry ... no way to get hired, that is braindead!

        You rather write a C macro spanning 500 lines? Wow ... shake heads ...

  • by BenSchuarmer (922752) on Thursday August 14, 2014 @01:37PM (#47671725)
    The comments and questions here look overwhelmingly negative. On the other hand, all of this passion only exists because people are using C++.
    • > . . . all of this passion only exists because people are using ${SOMETHING}.

      I feel passionate about SCO (in a strongly negative way), but not because they are important, popular, or their products widely used. I feel passionate about Clojure (in a positive way) despite that it is not presently one of the top programming languages. How many people use something can be irrelevant to the legitimate reasons people feel passionately about it.
  • by Marginal Coward (3557951) on Thursday August 14, 2014 @01:43PM (#47671765)

    I'm a fan of C++ overall, but it seems to me that C++ templates are a bit of a disaster. They're so complex that I doubt that anybody but you and P. J. Plauger *fully* understands them. Also, when they're actually used, they often result in bloated, slow code - as I recently experienced when stepping through some STL string functions. Further, they bring on a lot of portability issues, evidently due to the difficulty that even the compiler folks have had in understanding and implementing them. Therefore, many programmers minimize their use of templates, both in their own code and in their use of templated library code.

    Compared to the complexity of C++ templates, the C macro preprocessor provides a rudimentary form of templating via its very simple and powerful paradigm of text substitution. I've had some success implementing a limited form of generic (type independent) programming in C using just the C preprocessor. I've had much less success doing generic programming via C++ templates.

    If you had templates to do all over again, what would you do differently? Was all the complexity of C++ templates (e.g. "partial specialization") really necessary to achieve its goals? Were the goals maybe too ambitious?

    • by Imagix (695350)
      Uh, have you seen the stuff that Andrei Alexandrescu does with templates?
      • Same as everyone else does.
        Waking up in the morning with a bright idea.
        Having it hacked in till lunch.
        Does not work for all corner cases for about 4 months.
        Losing interest as I wake up in the morning with a new bright idea. Working on it for another 6 months.
        Falling back to idea 1 and 'finishing' it ... getting excited about reviews in the 'C++ journal' and 'Dr. Jobbs' and Andrew Koenigs review in some odd other magazine. Getting mails why the thing still not works in odd corner cases. Asking for source cod

    • Sigh ...
      Idiocy all around ...
      How can a template end up,in slow bloated code if it only is a template, hence the word, for something you would have to write EXACTLY the same way by hand?
      So magically your hand written code would be less bloated, how so?, and less slow, how so?
      Sorry, such claims are nonsense ... they absolutely make no sense.

  • C++ is more or less a superset of C (give or take a few minor issues [wikipedia.org]), why has regular C continued to thrive?

  • by jonwil (467024) on Thursday August 14, 2014 @01:55PM (#47671877)

    If you could add one feature to C++ (either the language or the standard library) and have it adopted in the C++ standard and supported by all the compilers etc, what would it be and why?

    • by dentin (2175)

      It would be better if you asked along the lines of "If you could change any aspect of C++ and have it immediately adopted/supported" - you never know, his preference might be to change template syntax or something similar instead of adding something new.

  • C++ without the C (Score:5, Interesting)

    by kthreadd (1558445) on Thursday August 14, 2014 @02:00PM (#47671917)

    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++?

  • by GNious (953874) on Thursday August 14, 2014 @02:11PM (#47672027)

    The linked G+ post says "August 20th, 2014 at 12:30pm EST to 2:30pm EST", but August 20th, 2014 is during Summer Time/Daylight Saving Time ...

    So, is is 12:30pm EST, or 12:30pm EDT ??

  • "Are there any plans for future c++ specifications to focus on readability and debugging at the source level, as opposed to adding new features?"

    As everyone well knows, maintenance and debugging are by far the most time intensive aspects of software engineering. Over the years, I and many of the others I work with have evolved various 'personal standards' in our use of C and C++; these personal standards are almost entirely to aid in debugging and readability. A few examples from the C side:

    - pretend that

  • by kthreadd (1558445) on Thursday August 14, 2014 @02:19PM (#47672117)

    Apart from work, do you have any personal programming projects going on? Which type of programming do you like most and is there a particular project that you would like to implement?

  • by kthreadd (1558445) on Thursday August 14, 2014 @02:26PM (#47672181)

    In C++ how would you write the most elegant solution that prints numbers from 1 to 100, replacing any number divisible by three with the word "fizz", and any number divisible by five with the word "buzz"?

  • Is there any syntax in C++ that you would want to change, or remove, if you didn't have to worry about compatibility with previous version?
  • Dear Prof. Stroustrup,

    Writing templated C++ code has become one of my favorite way to write abstract algorithms in an efficient (runtime wise) way mostly because it not alone allows to know types at compile time, but also some values. Yet programming templates is nightmare because the template system is compile-time duck-typed. How can that system be made better? Concepts were proposed for integration in the C++ norm but got pulled back. Yet it seems they are essentially what is required. Will template prog

  • My main criticism of C++ is that it's overly verbose. There are many issues resulting from it (difficult to write, overuse of old school pointers, etc). Let's take the simple for loop (I'm using { in place of "less than" since /. code is retarded):

    // C
    int myVec[100];
    for (int i=0; i { 100; i++) myVec[i]=i;

    //Now, let's look at C++ (not 11):
    std::vector{int} myVec(100);
    for (std::vector{ int }::const_iterator i=myVec.begin(); i != myVec.end(); i++)
    { myVec[i]=i; } // When did you decide this ^^ was a good ide

  • Code rejuvenation (Score:4, Interesting)

    by SansEverything (3785255) on Thursday August 14, 2014 @05:33PM (#47673523)
    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?
  • by BlackHawk-666 (560896) <ivan.hawkes@gmail.com> on Friday August 15, 2014 @12:38AM (#47675537) Homepage

    Are there any features of the language that you wish hadn't been added or could now be removed?

If a listener nods his head when you're explaining your program, wake him up.

Working...