Live data from Hacker News

Evolving a language in and for the real world: C++ 1991-2006 (2007) [pdf]

stroustrup.com

1–10 of 27 posts

Re: Evolving a language in and for the real world: C++ 1991-2006 (2007) [pdf]

#4
post #3

"Exceptions are typically — and correctly — seen as a control structure". So much for those who say using exceptions for flow control is bad .

Goto is a control structure as well. Does not mean you should use it (with certain exceptions). Unlike exceptions though, you can use it in limited amount in your codebase. With exceptions it's either everywhere or nowhere.

Re: Evolving a language in and for the real world: C++ 1991-2006 (2007) [pdf]

#5
post #3

"Exceptions are typically — and correctly — seen as a control structure". So much for those who say using exceptions for flow control is bad .

If they're important enough to be part of the language, somebody's going to use them... and common library functions will too. Exceptions aren't usually something you can boycott in a language ... and if you're going to have to use them, well, it's best to treat them as part of your program's logic, yes? Consider the many different errors Google handles and it's not always a dead failure... https://github.com/google/lmctfy/blob/master/util/task/codes... it's nice to be able to both return a value and an unambiguous exception state with automatic closure of resources (e.g. finally, or rewinding the stack...) such that you can safely retry without cleaning up after yourself. That's the goal here. Of course, Google's Go language avoids exceptions by using multiple return values, conventions and a defer statement... but then you can't easily put all your error handling code in any one place, can you, without restructuring your code? To each language its conventions, I suppose.

Re: Evolving a language in and for the real world: C++ 1991-2006 (2007) [pdf]

#6
post #3

"Exceptions are typically — and correctly — seen as a control structure". So much for those who say using exceptions for flow control is bad .

Goto is a control structure as well. Does not mean you should use it (with certain exceptions). Unlike exceptions though, you can use it in limited amount in your codebase. With exceptions it's either everywhere or nowhere.

[deleted]

Re: Evolving a language in and for the real world: C++ 1991-2006 (2007) [pdf]

#7
This is a great paper! It was given at HOPL 3 (History of Programming Languages, a conference which runs every 15 years). I'd recommend all of the HOPL 3 papers to aspiring language nerds, but especially the ones on C++, Lua, Haskell and Self.

Re: Evolving a language in and for the real world: C++ 1991-2006 (2007) [pdf]

#9
post #7

This is a great paper! It was given at HOPL 3 (History of Programming Languages, a conference which runs every 15 years). I'd recommend all of the HOPL 3 papers to aspiring language nerds, but especially the ones on C++, Lua, Haskell and Self.

Yeah, for a somewhat longer paper, it's eminently readable. Very human in tone.

Re: Evolving a language in and for the real world: C++ 1991-2006 (2007) [pdf]

#10
Another good read is the book "The Design and Evolution of C++".

http://www.stroustrup.com/dne.html

It does provide a very clear rationale why C++ became the way it was (C++98), given the design goals and the constraint of being C compatible as much as possible, both in language and compiler toolchains.

Post reply on HN