Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Interviews: Ask Bjarne Stroustrup About Programming and C++

samzenpus posted about 2 months ago | from the go-ahead-and-ask dept.

Programming 427

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.

Sorry! There are no comments related to the filter you selected.

Just Wanted To Say One Thing (0, Troll)

Anonymous Coward | about 2 months ago | (#47671269)

Even though I'm an unemployed programmer since the banking crash, I still believe in C++. I can't fathom programming in any of those interpreted languages.

Re:Just Wanted To Say One Thing (-1)

Anonymous Coward | about 2 months ago | (#47671635)

Obvious troll is obvious.

Re:Just Wanted To Say One Thing (-1, Troll)

Anonymous Coward | about 2 months ago | (#47671905)

My question to Bjarne Stroustrup is: Why do you have such a stupid name?

Re:Just Wanted To Say One Thing (0)

Anonymous Coward | about 2 months ago | (#47672031)

Really? You feel good now there behind your keyboard writing such a mean and stupid thing? Must be great to be you.

Re:Just Wanted To Say One Thing (-1)

Anonymous Coward | about 2 months ago | (#47672111)

Shut the fuck up, little bitch.

USP (1, Interesting)

Anonymous Coward | about 2 months ago | (#47671303)

Your language has become one of the most popular in history. If you were launching it today, how would you "market" it? What do you think is the unique selling point?

Ideal team size and composition (1)

Anonymous Coward | about 2 months ago | (#47671305)

If you had to create a new language and compiler from scratch, what would be the ideal size and composition of the team? From what fields would you try to recruit people?

Do you think the H1B system is a joke? (1)

Joe_Dragon (2206452) | about 2 months ago | (#47671311)

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:Do you think the H1B system is a joke? (3, Interesting)

Richard Dick Head (803293) | about 2 months ago | (#47671413)

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 skilled professions?

Re:Do you think the H1B system is a joke? (1)

Orestesx (629343) | about 2 months ago | (#47671529)

It's a fair question, he lives and works in the United States at an international that no doubt employs many H1B's.

Re:Do you think the H1B system is a joke? (0)

Anonymous Coward | about 2 months ago | (#47671493)

Why ask this of Bjarne Strousup? Is he an H1B immigrant? Is he chained to his job, or do you expect his work to be rather cheap?

Cutting features and old syntax? (5, Interesting)

Katatsumuri (1137173) | about 2 months ago | (#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?

Re:Cutting features and old syntax? (0)

Anonymous Coward | about 2 months ago | (#47671403)

Are you asking in a roundabout way if inheritance and overloading should be deprecated in favor of templates and lambdas? Because that's nasty

Re:Cutting features and old syntax? (1)

Immerman (2627577) | about 2 months ago | (#47671891)

Why would you assume such a thing? C++ is rife with old, rarely-used "cruft". Meanwhile templates and lambdas are great, but they provide advantages largely orthogonal to inheritance. I'll grant you that purely on merit overloading is potentially a legitimate "cruft"candidate as it adds essentially no functionality while potentially increasing confusion, especially operator overloading, but it's so pervasive within the standard libraries that extracting it would likely drive away most of the developer base.

Re:Cutting features and old syntax? (2)

Wootery (1087023) | about 2 months ago | (#47671955)

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 be growing too big for its own good. They're much less concerned with backward-compatibility, which I suspect helps with the ugliness problem, but doesn't help with, say, high-barrier-of-entry-to-reimplement, or high barrier until you're able to read real-world D code.

Firs7 post (-1)

Anonymous Coward | about 2 months ago | (#47671357)

Morgan Stanley (0)

Anonymous Coward | about 2 months ago | (#47671359)

Why work for the vampire squid?

Is the complexity of C++ a practical joke? (5, Interesting)

Anonymous Coward | about 2 months ago | (#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:Is the complexity of C++ a practical joke? (-1, Redundant)

Torp (199297) | about 2 months ago | (#47671455)

Wish i had mod points... it summarizes my thoughts about modern C++ exactly.

Re:Is the complexity of C++ a practical joke? (2, Insightful)

UnknownSoldier (67820) | about 2 months ago | (#47671621)

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.

Re:Is the complexity of C++ a practical joke? (1, Funny)

Anonymous Coward | about 2 months ago | (#47671899)

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.

What's happened to C++ is the antithesis of engineering. Engineering involves planning and design.

It's more like building an upside-down doghouse in your attic, then forcing beavers to build a damn inside it.

Re:Is the complexity of C++ a practical joke? (5, Insightful)

just_another_sean (919159) | about 2 months ago | (#47671681)

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.

Re:Is the complexity of C++ a practical joke? (4, Insightful)

Katatsumuri (1137173) | about 2 months ago | (#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.

Re:Is the complexity of C++ a practical joke? (5, Insightful)

Immerman (2627577) | about 2 months ago | (#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.

Re:Is the complexity of C++ a practical joke? (1)

Katatsumuri (1137173) | about 2 months ago | (#47672157)

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.

Re:Is the complexity of C++ a practical joke? (1)

Anonymous Coward | about 2 months ago | (#47672187)

Posting as AC because of moderation.

To add to this, it's also useful to have a copy of the standard (a PDF can be picked up from ANSI for around $40), and become familiar with it's layout. You don't need to read it cover to cover, but be comfortable enough to locate relevant sections when necessary.

Re:Is the complexity of C++ a practical joke? (2)

mark-t (151149) | about 2 months ago | (#47672013)

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-world problems which arise in this regard are generally reflective of poor programming skill, not a poorly designed programming language.

Re:Is the complexity of C++ a practical joke? (1)

Katatsumuri (1137173) | about 2 months ago | (#47672109)

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.

Re:Is the complexity of C++ a practical joke? (1)

jopsen (885607) | about 2 months ago | (#47671967)

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

Re:Is the complexity of C++ a practical joke? (0)

gbjbaanb (229885) | about 2 months ago | (#47671731)

actually, I agree with this too - some of the stuff added to C++ is just not pleasant. Its like someone wanted a relatively specialised addition, got it in the standard, and there it is - for all to see and think "did we really need this?!".

I'd like to think the language should be 2-tiers, the easy stuff and the "advanced, specialised" stuff, but maybe that's just promoting the C++ style of "C with classes" that some people code. (not that its necessarily that bad a thing, C is good, RAII is good, together with some pre-rolled STL bits they're great).

Maybe a better question is to ask how much of the C++11 features he expects will actually be used by the majority of C++ developers. I can see for ranges being used a *lot*, but delete functions (ie you put =delete after a declaration to stop it being accessed, like you do with pure virtual functions set to =0), ro some of the other things. What about move operators - good idea, but it'd going to take a long time to get all the documents about C++ updated to include the 4 default constructors for example (ie ctor, dtor, copy ctor, move ctor), not to mention the nasty syntax for using them.

Re:Is the complexity of C++ a practical joke? (1, Funny)

micahraleigh (2600457) | about 2 months ago | (#47671867)

Java added lambda's.

C# pioneered lambda's.

Java and C# have individually higher adoption than C++:

https://sites.google.com/site/... [google.com]

Seems like lambda's are an ascending trend.

On the other hand ... so are murders in Chicago.

Re:Is the complexity of C++ a practical joke? (4, Informative)

smaddox (928261) | about 2 months ago | (#47671961)

C# pioneered lambda's.

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

Re:Is the complexity of C++ a practical joke? (5, Funny)

kthreadd (1558445) | about 2 months ago | (#47671969)

C# pioneered lambda's.

(get (off) (my lawn))

Re:Is the complexity of C++ a practical joke? (1)

mark-t (151149) | about 2 months ago | (#47672043)

C# pioneered lambda's.

Uh...no [wikipedia.org]

Re:Is the complexity of C++ a practical joke? (0)

Anonymous Coward | about 2 months ago | (#47671915)

This is a well-thought out post, but it could be *really* good if it didn't attack the author's motives by implying that they intentionally made their work bad. That is just a form of ad-hominem attack. Paraphrasing here:

Don't start with:
Did you intentionally create the biggest piece of garbage possible, or did it happen by accident? I was surprised that it layered more complexity and inscrutability...

Instead, start with:
C++ started as a simple set of extensions onto C, but today I was surprised that it layered more complexity and inscrutability...

Web Friendly (1)

gunner_von_diamond (3461783) | about 2 months ago | (#47671399)

Are there any future plans to gear c++ more towards the increasingly popular web development, or will that depend on 3rd party libraries, etc.?

On the evolution of C++ (5, Interesting)

stox (131684) | about 2 months ago | (#47671401)

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?

Seriously (-1)

Anonymous Coward | about 2 months ago | (#47671419)

How bad does it hurt when kicked in the Bjarne's?

Favourite programming language (5, Interesting)

Bugamn (1769722) | about 2 months ago | (#47671421)

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

Re:Favourite programming language (1)

Anonymous Coward | about 2 months ago | (#47671809)

Probably Malbolge.

Do you ever feel bad? (3, Interesting)

slashdice (3722985) | about 2 months ago | (#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?

Re:Do you ever feel bad? (1)

dentin (2175) | about 2 months ago | (#47672095)

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.

also: (3, Insightful)

slashdice (3722985) | about 2 months ago | (#47671441)

Has everyone responsible for the std::vector<bool> tragedy been kicked in the nuts until they are no longer at risk of reproducing?

Regrets (5, Interesting)

Anonymous Coward | about 2 months ago | (#47671447)

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

Replacement for iostream (5, Interesting)

tepples (727027) | about 2 months ago | (#47671459)

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?

Future of C++ Standard Library (3, Interesting)

DaphneDiane (72889) | about 2 months ago | (#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?

Designing a Language and not a Compiler (2)

dasacc22 (1830082) | about 2 months ago | (#47671479)

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 (4, Interesting)

Orestesx (629343) | about 2 months ago | (#47671489)

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

On syntax (0)

Anonymous Coward | about 2 months ago | (#47671497)

When are you going to recant your decision that types are more impotant then syntax clarity and tell everyone you made mistake putting the * next to the type instead of next to the variable where it belongs?

ABI (5, Interesting)

gbjbaanb (229885) | about 2 months ago | (#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).

Re:ABI (1)

MouseTheLuckyDog (2752443) | about 2 months ago | (#47671563)

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?

Re:ABI (0)

Anonymous Coward | about 2 months ago | (#47671975)

I'm pretty sure the proposal for a stable C++ ABI has been more or less well received. IIRC there were some complaints about having to maintain two ABIs (one stable, one modern), but people are working on it as far as I know.

diversity? (5, Funny)

slashdice (3722985) | about 2 months ago | (#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?

AI writing code? (2, Interesting)

Katatsumuri (1137173) | about 2 months ago | (#47671519)

Do you think AI will start replacing junior programmers in the foreseeable future, similar to car drivers and call center operators?

Re:AI writing code? (2)

Marginal Coward (3557951) | about 2 months ago | (#47671587)

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

Re:AI writing code? (1)

Katatsumuri (1137173) | about 2 months ago | (#47671901)

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.

compilers touted as early form of A.I. (1)

peter303 (12292) | about 2 months ago | (#47671857)

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.

Re:compilers touted as early form of A.I. (1)

Katatsumuri (1137173) | about 2 months ago | (#47672075)

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 custom, unique tasks will no longer be a complex skill? Will we see a decline in the number of people specifically hired as programmers?

I understand we will not literally hire some Bender-like robot, or maybe even get any actual code. More likely, it's just that the generic software will become more interactive and functional. But still, it will displace some human labor. That's what I'm talking about, and I'm curious about other people's opinion when that turning point may come in this industry.

Memory Allocation (0)

Anonymous Coward | about 2 months ago | (#47671541)

Why doesn't C++ have in language support for memory allocation?
And don't give me that baloney about it being a library feature: We all know that memory allocation of variables on the stack is not handled manually by the programmer.
If you don't add it C# and Java with their GC awfulness will continue to eat C++'s lunch.

new and delete; viral disposability (2)

tepples (727027) | about 2 months ago | (#47671649)

Why doesn't C++ have in language support for memory allocation?

C++ has the new and delete operators, whose low-level operation a class can customize. Could you clarify what you're asking for?

If you don't add it C# and Java with their GC awfulness will continue to eat C++'s lunch.

The problem with tracing garbage collection as implemented in Java, C#, and the like is that it tends to break the Resource Acquisition Is Initialization (RAII) idiom [wikipedia.org] seen in C++, where an object's destructor is responsible for freeing non-memory resources held by the object, and the language supports calling this destructor automatically in many cases. Instead, GC languages have what I call "viral disposability" [pineight.com] : a conventional name for an explicit destructor method that an object's owner must remember to call, and anything holding a disposable object must also be disposable.

Re:new and delete; viral disposability (1)

angel'o'sphere (80593) | about 2 months ago | (#47672185)

That is nonsense.
RAII concepts work on plain objects, which enter scope and leave scope, like in a function, and call the constructor on 'allocation' and the destructor when the scope is left. Either via an exception or a return.

A GC works on pointers/references, and works seamlessly together with RIAA, constructors/destructors.

Worst case is, a GC stumbles over some memory that is already flagged as being freed due to a 'delete' in a destructor.

Multiple Return Types? (1)

UnknownSoldier (67820) | about 2 months ago | (#47671545)

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

intead of having a native way to hint the compiler about how hot or cold a function is.

inline = 100 void Foo(); // function is 100% hot, always inline
 
inline = 0 void Foo(); // function is 0% cold, never inline
 
inline = 75 void Foo(); // function is 75% hot, inline most of the time

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

Re:Multiple Return Types? (2)

tepples (727027) | about 2 months ago | (#47671775)

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?

Defining subsets of C++ (1)

tepples (727027) | about 2 months ago | (#47671793)

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?

Re:Defining subsets of C++ (1)

UnknownSoldier (67820) | about 2 months ago | (#47672023)

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

Re:Defining subsets of C++ (1)

DickBreath (207180) | about 2 months ago | (#47672141)

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

Re:Multiple Return Types? (1)

angel'o'sphere (80593) | about 2 months ago | (#47672139)

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.

Boost ASIO (2)

Rob Riggs (6418) | about 2 months ago | (#47671597)

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.

Darl McBride says SCO owns C++ (2)

DickBreath (207180) | about 2 months ago | (#47671619)

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]

What do you think about beta.slashdot.org? (1)

slashdice (3722985) | about 2 months ago | (#47671657)

Would it suck less if they used c++?

C++ is an over bloated monster (4, Insightful)

Jay Maynard (54798) | about 2 months ago | (#47671663)

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?

Re:C++ is an over bloated monster (0)

Anonymous Coward | about 2 months ago | (#47671949)

"How can I learn to tolerate your creation" is not a valid interview question unless you are interviewing Uwe Boll.

One of my favorite quotes (1)

Anonymous Coward | about 2 months ago | (#47671677)

"I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone". Do you still feel this way, or are you more comfortable with modern smartphones than the phones that were available at the time of your statement?

How do you feel about the haters? (4, Interesting)

BenSchuarmer (922752) | about 2 months ago | (#47671725)

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

Re:How do you feel about the haters? (2)

DickBreath (207180) | about 2 months ago | (#47672085)

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

Templates all over again (3, Interesting)

Marginal Coward (3557951) | about 2 months ago | (#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?

Re:Templates all over again (1)

Imagix (695350) | about 2 months ago | (#47671819)

Uh, have you seen the stuff that Andrei Alexandrescu does with templates?

Re:Templates all over again (0)

Anonymous Coward | about 2 months ago | (#47672019)

>Uh, have you seen the stuff that Andrei Alexandrescu does with templates?
Nothing anymore because he moved on to D ?

But yes, Andrei Alexandrescu knows his shit and he's clearly good. Too bad D has a more or less forced GC (without it you're pretty much freestanding, no library will work without).

If (0)

Anonymous Coward | about 2 months ago | (#47671779)

if (condition) statement;

or

if (condition)
    statement;

or

if (condition) {
    statement;
}

Re:If (0)

Anonymous Coward | about 2 months ago | (#47672003)

if (condition)
  {
    statement;
  }

Will there ever be a breaking change ? (0)

Anonymous Coward | about 2 months ago | (#47671803)

With C++ standardization picking up steam, and C++'s backward compatibility being a feature, I'm wondering, will there ever be a non backward compatible version of C++ ?
Not as in purposefully making all those millions of lines of code written in the past decades not compile, but using all the hindsight to fix those choice that turned out to be not so good in practice and allowing a "cleaner" language to come out of what looks more and more like a mess of accepted proposals.

I see lots of people complaining about C++ being "Too big". I personally don't mind, nothing is stopping me from using that simpler and maybe more modern subset of the language I want, but aren't you worried that all those old features might hold C++ back and slow down standardization and "innovation" in the future ?

C++ is the most powerful tool I've had the chance to use, and I'm glad to see it being actively improved again, but I'm not sure how long it can keep being at the same time all the languages it used to be and wants to become.

Given that (2)

maroberts (15852) | about 2 months ago | (#47671807)

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?

Re:Given that (1)

Marginal Coward (3557951) | about 2 months ago | (#47671947)

Having used both extensively, I can tell you that it is much more difficult to write slow, bloated, overly complex code in C than in C++. It keeps you honest in that way. Also, most of the good things of C++ such as object-oriented programming and templating can be done at a basic level in C. For example, in C++, a class function is just an ordinary function with a hidden pointer to a (class) structure. Why not just pass in a pointer to a class structure in C? And class member privacy can easily be a matter of naming convention rather than something the compiler enforces.

C++ has its value, and may be better suited for building large, complex, systems such as GUI frameworks, but C is a great choice for cases where speed and minimal size are paramount, such as most embedded code as well as the Linux kernel. In principle, it's possible to write fast, small code in C++ by using its features selectively. However, if you do that, you're left with mostly just the features you could have emulated in C anyway.

Oh, and did I mention that in its current form C is the "perfect" programming language? Other languages have their own goals, but judged in terms of its own goals, C does what it's trying to do better than just about any other language - far better than C++ meets its goals. There's a reason that changes to C over its many years have been very minimal, and virtually always for the better.

Which feature would you add to C++? (3, Interesting)

jonwil (467024) | about 2 months ago | (#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?

Auto & Concepts to replace Templates ? (0)

Anonymous Coward | about 2 months ago | (#47671883)

Couldn't auto & concepts replace templates in those simple use cases where you don't want compile time Turing completeness, but just a simple generic function working on anything with an operator+ or maybe with an argument matching the concept of a container.

I want auto as a type for function arguments. Wouldn't that be simpler, easier to read, beautiful ?

Why is C++ such an utter pile of shit? (0, Troll)

Anonymous Coward | about 2 months ago | (#47671885)

Seriously.

Re:Why is C++ such an utter pile of shit? (3, Funny)

DickBreath (207180) | about 2 months ago | (#47672115)

There are optimizations you can use to improve your experience with C and C++.

Just insert these into your header files for both time and space improvements in your compiled code.

#define struct union; // uses less memory
#define while if; // makes code run faster

Now how can you say bad things about a language that is so easily improved?

C++ without the C (4, Interesting)

kthreadd (1558445) | about 2 months ago | (#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++?

Re:C++ without the C (0)

Anonymous Coward | about 2 months ago | (#47672167)

Isn't Swift that ridiculously slow language that managed to end up *SLOWER THAN PYTHON* on benchmarks even though it used LLVM ?
Or maybe you're talking about the *other* Swift language, since Apple apparently picked a name that was already taken.

Legacy (0)

Anonymous Coward | about 2 months ago | (#47671943)

A lot of C++ complexity comes from trying to maintain compatibility with legacy code. Many of the new features could have been implemented more cleanly if the legacy support was dropped.

What part of C/C++ legacy has been the most troublesome to overcome?

Seriously (0)

Anonymous Coward | about 2 months ago | (#47672007)

How bad does it hurt when kicked in the Bjarne's?

EST? or EDT?!? (2)

GNious (953874) | about 2 months ago | (#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 ??

Complexity (1)

dentin (2175) | about 2 months ago | (#47672029)

"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 the return type of the = operator is void, disallowing both "a=b=c" and "if (a = b)" constructs
- all 'if', 'while', 'for' etc statements must be braced
- certain types of simple arithmetic operations, for example a signed 16 bit integer multiplied by an unsigned 16 bit integer, may only be handled by dedicated macros to ensure proper operation. These macros must be manually tested and verified on each platform the software is ported to.

Many of these things seem trivial, but they add up. I have seen many hours lost to unbraced 'if' statements; I have seen five different compilers require five different sets of casts to ensure that a 16x16->32 bit integer multiply produces the correct results. There are many holes in the language specification which allow compilers to silently generate arbitrary code, requiring extensive debug and testing time when porting to new platforms.

Both porting and maintenance would be eased by truly looking at the lower layers and making some difficult decisions to improve parsing and deprecate dangerous or confusing constructs. Are there plans in future specifications to do this?

Adding library support for graphics (Cairo)? (1)

snake_case_hoschi (3785199) | about 2 months ago | (#47672071)

Hello! I december 2013[1] Herb Sutter has written about adding a graphics library to C++. As far as I know Cairo is a well written und usable library and in fact my complete desktop is using it (GNOME/GTK+ on GNU/Linux). But I shy away from the idea to see a graphics library within the standard, because drawing graphics is not part of the base requirements like Input/Output, String-Handling or Containers. What do you think about that? Is Cairo, as an low-level graphics library, also agnostic enough for the long-term future of C++? In my eyes Java only suffered from the integration of AWT/Swing as toolkit into the JRE. But AWT/Swing is a high-level toolkit and merely based on the paradigma of "runs anywhere". Thank you [1] http://lists.cairographics.org... [cairographics.org]

Personal programming projects (3, Interesting)

kthreadd (1558445) | about 2 months ago | (#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?

More features (0)

Anonymous Coward | about 2 months ago | (#47672125)

What features do you think are missing that would make the language utterly incomprehensible, as opposed to almost completely incomprehensible, such as it is already?

Fizz Buzz (2)

kthreadd (1558445) | about 2 months ago | (#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"?

What features if any would you remove? (1)

anarcobra (1551067) | about 2 months ago | (#47672195)

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?

Worst C++ development threat? (1)

qrwe (625937) | about 2 months ago | (#47672197)

According to you, what is the worst thing that could happen to the C++ development, i.e. what nightmare would you never like to see happen to an upcoming standard?
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?