From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Top 10 Worst C# Features Date: Thu, 3 Sep 2015 14:12:12 -0500 Organization: JSA Research & Innovation Message-ID: References: NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1441307534 7321 24.196.82.226 (3 Sep 2015 19:12:14 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 3 Sep 2015 19:12:14 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:27701 Date: 2015-09-03T14:12:12-05:00 List-Id: "G.B." wrote in message news:ms9cm8$leh$1@dont-email.me... ... > AFAICT, today we have string literals identifying things > that can be called (Gtk), or we have selectors (Objective-C) > for a similar thing, etc. A mouse click or gesture is thus > another kind of event to which programmers might want to attach > something that reacts. How would static type systems help, > knowing that trying to make them help has allegedly failed > in the past? I have no idea why you think this is a problem. Claw uses statically defined action routines that one overrides. This is type-safe, it's impossible to handle an action that cannot happen (such as a click on a drawing canvas), and one can easily see that all required actions are handled (they're abstract in that case). GWindows uses (optionally) call-back access-to-subprograns, which definitely have the first two properties (but not the third). The implementation of this (the actual GUI binding) is groddy, but that's because we're trying to build something clean on top of a C implementation that resists that at every step. :-) So I fail to see any problem that isn't being addressed here. Finalization is a very special kettle of fish, because the objects don't exist afterwards. It's needed to provide last wishes to objects, for clean-up of various sorts. (For instance, Claw uses finalization to unhook windows from the active window list, else we'd be calling actions on non-existent windows. There is no other bullet-proof way to do that, if one wants there library to work in the face of exceptions and abort, as well as programmer mistakes [failing to call Close appropriately].) Randy.