Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #30088
| From | "Osmium" <r124c4u102@comcast.net> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: The (anti) C++ FQA Lite -- worth a look |
| Date | 2014-07-24 12:28 -0500 |
| Message-ID | <c3cu18FognpU1@mid.individual.net> (permalink) |
| References | <03303eb6-523d-4e95-ab0c-28e162ec2341@googlegroups.com><93a9602c-41b2-4fef-b915-06428d794172@googlegroups.com><lqq619$1hqg$1@adenine.netfront.net><c3clqrFmok1U1@mid.individual.net> <20140724173628.73bf30f5@laptop.homenet> |
"Chris Vine" wrote: "Osmium" <r124c4u102@comcast.net> wrote: > "Juha Nieminen" wrote: > > > The above are a good example of completely inconsistent logic. He > > both decries the language being "too complex", and at the same time > > that it isn't complex enough, lacking some arbitrary features in > > some other languages. The above examples are, basically, "it's too > > complex", "it's not complex enough", "it's too complex", "it's not > > complex enough". > > I have zero interest in defending the article in question. But WRT > "too complex", consider the following. C++ has an exception > mechanism. C provided <signal.h> to handle certain exceptions, which > C++ renamed and kept. Can't you see how providing two methods to do > one thing is more complex than providing one method? This has > nothing at all to do with whether the approach used to develop C++ > was necessary and proper. It has to solely to do with the end result. I have never seen anyone equate asynchronous signals with exceptions (using the word "exceptions" in its normal programmatic sense). They are completely different things. I believe microsoft may have implemented some hardware faults as programmatic exceptions outside the C++ standard, which would instead trigger an asynchronous signal in unix-like environments, but that is as close as it gets. Perhaps you meant to refer to escape continuations as implemented by setjmp() and longjmp(), which are in setjmp.h rather than signal.h, and which can be used as a poor-man's exception mechanism in C? They are valid in C++ subject to §18.10/4 of the C++11 standard - in particular you cannot jump up the call stack out of a scope in which there are objects with non-trivial destructors. Presumably the decision was taken by the standards committee to retain the C behaviour of longjmp() in simply wiping out any stack objects jumped over, rather than to unwind the stack as in the case of exceptions. It could have gone either way. However C-style escape continuations are much more limited in use than C++ exceptions. Their behaviour in C++ could have more closely followed the behaviour of C++ exceptions, but they could not have replaced C++ exceptions. I prefer to think of _anomalies_, rather than errors or exceptions, something out of the ordinary happened. I also had in mind the error functions in <stdio.h> as well, but nothing was further from my mind than setjmp and longjmp. ISTM that if one knew at the outset of the design of a computer language that anomalies would have to somehow be taken care of, a sufficiently clever person could integrate these things together. Gather your thoughts, focus on design, defer the naming of this thing till towards the end. I was trying to focus on one thing. But since you brought it up, why did the C++ language need setjmp and longjmp? As a matter of fact why did they need printf? Was the thought that <stdio.h> can be taught a minute ot so? C++ is a *language*, right? Not some dialect of some other language. You can learn English without knowing Latin or anything else. BTW, K&R use the word "exceptions" WRT <signal.h>in their obscure little book. I know nothing at all of Ada but one of my first steps would be to contact someone fluent in Ada to see how they handled the general problem.
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
The (anti) C++ FQA Lite -- worth a look "K. Frank" <kfrank29.c@gmail.com> - 2014-07-16 08:06 -0700
Re: The (anti) C++ FQA Lite -- worth a look Öö Tiib <ootiib@hot.ee> - 2014-07-16 16:12 -0700
Re: The (anti) C++ FQA Lite -- worth a look "K. Frank" <kfrank29.c@gmail.com> - 2014-07-18 09:39 -0700
Re: The (anti) C++ FQA Lite -- worth a look Öö Tiib <ootiib@hot.ee> - 2014-07-19 03:48 -0700
Re: The (anti) C++ FQA Lite -- worth a look Juha Nieminen <nospam@thanks.invalid> - 2014-07-24 05:36 +0000
Re: The (anti) C++ FQA Lite -- worth a look "Osmium" <r124c4u102@comcast.net> - 2014-07-24 10:08 -0500
Re: The (anti) C++ FQA Lite -- worth a look Bo Persson <bop@gmb.dk> - 2014-07-24 18:00 +0200
Re: The (anti) C++ FQA Lite -- worth a look Chris Vine <chris@cvine--nospam--.freeserve.co.uk> - 2014-07-24 17:36 +0100
Re: The (anti) C++ FQA Lite -- worth a look "Osmium" <r124c4u102@comcast.net> - 2014-07-24 12:28 -0500
Re: The (anti) C++ FQA Lite -- worth a look Dombo <dombo@disposable.invalid> - 2014-07-24 23:50 +0200
Re: The (anti) C++ FQA Lite -- worth a look Juha Nieminen <nospam@thanks.invalid> - 2014-07-25 05:36 +0000
Re: The (anti) C++ FQA Lite -- worth a look Jorgen Grahn <grahn+nntp@snipabacken.se> - 2014-07-25 18:18 +0000
Re: The (anti) C++ FQA Lite -- worth a look Chris Vine <chris@cvine--nospam--.freeserve.co.uk> - 2014-07-24 23:29 +0100
Re: The (anti) C++ FQA Lite -- worth a look Chris Vine <chris@cvine--nospam--.freeserve.co.uk> - 2014-07-24 23:45 +0100
Re: The (anti) C++ FQA Lite -- worth a look scott@slp53.sl.home (Scott Lurndal) - 2014-07-25 14:05 +0000
Re: The (anti) C++ FQA Lite -- worth a look Juha Nieminen <nospam@thanks.invalid> - 2014-08-04 05:59 +0000
Re: The (anti) C++ FQA Lite -- worth a look scott@slp53.sl.home (Scott Lurndal) - 2014-08-04 14:52 +0000
Re: The (anti) C++ FQA Lite -- worth a look Juha Nieminen <nospam@thanks.invalid> - 2014-08-05 06:57 +0000
Re: The (anti) C++ FQA Lite -- worth a look Öö Tiib <ootiib@hot.ee> - 2014-08-05 05:53 -0700
Re: The (anti) C++ FQA Lite -- worth a look Martijn Lievaart <m@rtij.nl.invlalid> - 2014-08-05 16:20 +0200
Re: The (anti) C++ FQA Lite -- worth a look Öö Tiib <ootiib@hot.ee> - 2014-08-05 16:58 -0700
Re: The (anti) C++ FQA Lite -- worth a look Juha Nieminen <nospam@thanks.invalid> - 2014-08-07 11:04 +0000
Re: The (anti) C++ FQA Lite -- worth a look scott@slp53.sl.home (Scott Lurndal) - 2014-08-05 14:27 +0000
Re: The (anti) C++ FQA Lite -- worth a look Juha Nieminen <nospam@thanks.invalid> - 2014-08-07 11:06 +0000
Re: The (anti) C++ FQA Lite -- worth a look Thomas Richter <thor@math.tu-berlin.de> - 2014-07-28 21:01 +0200
Re: The (anti) C++ FQA Lite -- worth a look Öö Tiib <ootiib@hot.ee> - 2014-08-03 16:22 -0700
csiph-web