September 26, 2014
On 9/26/2014 12:47 PM, H. S. Teoh via Digitalmars-d wrote:
> I would, except that right now I'm working on a dmd PR. ;-)

No hurry.

> Do you have
> references to back up your claims (references deemed acceptable by WP)?

Yes, I quoted from Bjarne's 1986 book "The C++ Programming Language".

Bjarne writes in "Possible Directions for C++" he writes "Because of destructors the C solution is insufficient and C++ will eventually be forced to develop an exception handling mechanism."

   -- Proceedings and Additional Papers C++ Workshop Santa Fe, NM, 1987

That's the first reference I can find to adding EH to C++. It does not propose any syntax.

In 1988 and 1990 there are proposals for ways to add EH to C++.
September 26, 2014
On 9/26/2014 2:04 PM, "Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang@gmail.com>" wrote:
> On Friday, 26 September 2014 at 18:46:19 UTC, Walter Bright wrote:
>> I wrote a C++ compiler in 1987. Nobody had ever heard of exceptions.
>
> Lisp had exceptions in the 60s. In the 80s exception handling was fashionable in
> language design. :)

I meant in the context of C++.


>> Bjarne's 1986 "The C++ Programming Language" does not mention RAII or
>> exceptions, but does say on pg. 158:
>>
>> "Calling constructors and destructors for static objects serves an extremely
>> important function in C++. It is the way to ensure proper initialization and
>> cleanup of data structures in libraries."
>
> I would not call this RAII,

I would. The whole point of destructors is to automatically clean up resources when the object goes away, which was (later) dubbed RAII.

September 26, 2014
On Friday, 26 September 2014 at 20:48:20 UTC, Paulo Pinto wrote:
> I started coding C++ on MS-DOS in 1993 with Turbo C++ 1.0 all the way up to Turbo C++ 1.5 for Windows 3.x. Also used Borland C++ occasionally.
>
> I cannot remember any longer which version eventually added support for exceptions, but it was already a Windows 3.x version I would say.

Watcom had some exception support around 1993 according to comp.lang.c++, but it was probably not a big selling point to add it for other vendors on the MS platforms.

I remember it was very difficult to find a good free C++ implementation though. Cfront was kind of annoying (and did not support exceptions either). In the free software movement C/Unix was the real deal and my impression was that C++ was not viewed as "cool", so it took a while for g++ to get the quality up to acceptable standards.

My uni had DEC/SGI with C++, but at home where I preferred to do that type of programming I was stuck with C until g++ had improved by the mid 90s. And… of course… the uni did not teach C++ since it has a horrible design. I was only aware of one lecturer that had a C++ interest. I think they only had C++ available by accident (being part of a standard suite).

> The early 90's in Portugal, meant no Internet and no BBS access outside Porto and Lisbon.

:-/ I did some BBSing in the late 80s, early 90s. It had a special feel to it, compared to the internet I think. More like a house/pub. I was lucky and got good Internet access at the university throughout the 90s (it was connected to ARPAnet/Internet already in 1973 so I think they gave it a high priority).
September 26, 2014
On Fri, 26 Sep 2014 11:52:21 -0700
"H. S. Teoh via Digitalmars-d" <digitalmars-d@puremagic.com> wrote:

> Then wikipedia should be edited to be more accurate, while said people are still alive!! Otherwise the distorted version of the events will come to be regarded as fact.
it's very hard to introduce correct facts to wikipedia.

the strange this is that it's very easy to introduce incorrect facts if they are looking "normal".


September 26, 2014
Walter Bright <newshound2@digitalmars.com> wrote:
> On 9/26/2014 8:21 AM, Manu via Digitalmars-d wrote:
>> I've never used an exception before. I can't imagine a reason I would ever want to.
> 
> Nothrow is your friend, then!
> 
> 
> BTW, you need exceptions if there appears in your code things like:
> 
>     if (errorHappened) goto LcleanupCode;

No you need destructors/RAII/finally. And all those work equally with without exceptions (early return).

Tobi
September 26, 2014
On Fri, Sep 26, 2014 at 09:32:54PM +0000, via Digitalmars-d wrote: [...]
> I remember it was very difficult to find a good free C++ implementation though. Cfront was kind of annoying (and did not support exceptions either).  In the free software movement C/Unix was the real deal and my impression was that C++ was not viewed as "cool", so it took a while for g++ to get the quality up to acceptable standards.
> 
> My uni had DEC/SGI with C++, but at home where I preferred to do that type of programming I was stuck with C until g++ had improved by the mid 90s.  And… of course… the uni did not teach C++ since it has a horrible design. I was only aware of one lecturer that had a C++ interest. I think they only had C++ available by accident (being part of a standard suite).
[...]

Whoa, this brings back the memories! I remember taking a course in college where the prof was teaching us this idiom, which by today's standards is rather laughable (and probably no longer compiles -- this dates back to before the first C++ standardization in 1998):

	class MyClass {
		...
		MyClass &Myclass(Myclass &);
		...
	}

	// Gotta love the audacious violation of DRY here:
	MyClass &MyClass::MyClass(MyClass &mc)
	{
		...
		return *this;
	}

This was on g++ in the early to mid 90's, just around the time C++ templates first became widely available. I still remember trying both c++ (the compiler, not the language) and g++, and perhaps one or two other compilers installed on the lab compute servers, and finding that one compiler would support new feature X but not new feature Y, but the other compiler that supported feature Y had a buggy implementation of feature X. So it was quite frustrating that many of the cool new features couldn't be used together 'cos of buggy compiler implementations. Not to mention subtle differences in dialect that sometimes makes your projects uncompilable with another compiler. Fun times.


T

-- 
People tell me I'm stubborn, but I refuse to accept it!
September 27, 2014
On 27 September 2014 04:20, Walter Bright via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> On 9/26/2014 8:21 AM, Manu via Digitalmars-d wrote:
>>
>> I've never used an exception before. I can't imagine a reason I would ever want to.
>
>
> Nothrow is your friend, then!

It certainly is. The only thing that ever ruins my nothrow-ness are phobos calls ;)

> BTW, you need exceptions if there appears in your code things like:
>
>     if (errorHappened) goto LcleanupCode;

Initialisation logic often looks like this, and I buy the value of
exceptions in this case. However, I've never successfully implemented
it yet though, because the calls that create code like that always
seem to be extern-C calls in my experience... :/
I'm not sure why my D code doesn't manifest those patterns, D just
seems to produce different code than C/C++...
September 27, 2014
On 2014-09-27 02:47, Manu via Digitalmars-d wrote:

> Initialisation logic often looks like this, and I buy the value of
> exceptions in this case. However, I've never successfully implemented
> it yet though, because the calls that create code like that always
> seem to be extern-C calls in my experience... :/

Perhaps you should wrap those call an throw an exception.

-- 
/Jacob Carlborg
September 27, 2014
On Friday, 26 September 2014 at 21:19:29 UTC, Walter Bright wrote:
> I would. The whole point of destructors is to automatically clean up resources when the object goes away, which was (later) dubbed RAII.

Yeah, but RAII takes it to the extreme where you create dummy classes that only consist of constructors/destructors so that the stack unwinding does all cleanup/closing/freeing without any try/catch.

Before C++ templates that looked verbose and ugly syntactically, and it is still tedious if you only use the specific resource in one location.  "scope(exit)" is often more transparent IMO.
September 27, 2014
Am 26.09.2014 23:32, schrieb "Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang@gmail.com>":
> On Friday, 26 September 2014 at 20:48:20 UTC, Paulo Pinto wrote:
>> I started coding C++ on MS-DOS in 1993 with Turbo C++ 1.0 all the way
>> up to Turbo C++ 1.5 for Windows 3.x. Also used Borland C++ occasionally.
>>
>> I cannot remember any longer which version eventually added support
>> for exceptions, but it was already a Windows 3.x version I would say.
>
> Watcom had some exception support around 1993 according to
> comp.lang.c++, but it was probably not a big selling point to add it for
> other vendors on the MS platforms.

Watcom only became big on MS-DOS when they started offering a 32bit MS-DOS extender (remember those?). That feature, coupled with good code generation, made many game studios go for it.

But that is the only thing I know from it. In Portugal, Borland and Microsoft ruled the MS-DOS developer tools.

>
> I remember it was very difficult to find a good free C++ implementation
> though. Cfront was kind of annoying (and did not support exceptions
> either). In the free software movement C/Unix was the real deal and my
> impression was that C++ was not viewed as "cool", so it took a while for
> g++ to get the quality up to acceptable standards.
>

Back in those days I got to buy my tools. Only knew what FOSS was about around 1995.

In 1993 I got hold of Turbo C 2.0 and Turbo C++ 1.0, after a couple of years of doing Turbo Pascal, already with OOP using Turbo Vision.

C just looked stone age when compared with Turbo Pascal 6.0 features and I immediately switched to C++ after a few months of pure C.

Since then I have been on C++ troop ranks on the usual C vs C++ debates.

The sad thing is that nowadays many new C++ programmers behave against languages with automatic memory management, the same way we were seen by C programmers in those days.

You quite right about us not being cool in UNIX world. Outside of CORBA, it was always an uphill battle to use C++. Specially in the FOSS front.

I wrote one of the first tutorials on how to use yacc/bison and lex/flex with C++ instead of C, as I could not find any.

--
Paulo