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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4b27f494a96e0530 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: A community Windows binding References: <2004100600261150073%david@bottoncom> <2smd6iF1mo0mcU1@uni-berlin.de> <4168EA68.6D6A2B39@yahoo.com> In-Reply-To: <4168EA68.6D6A2B39@yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Thu, 14 Oct 2004 12:53:58 -0400 NNTP-Posting-Host: 198.96.223.163 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1097772836 198.96.223.163 (Thu, 14 Oct 2004 12:53:56 EDT) NNTP-Posting-Date: Thu, 14 Oct 2004 12:53:56 EDT Organization: Bell Sympatico Xref: g2news1.google.com comp.lang.ada:5207 Date: 2004-10-14T12:53:58-04:00 List-Id: CBFalconer wrote: > Stephen Leake wrote: >>Jeffrey Carter writes: >>>Callbacks and dispatching are essentially the same thing in a >>>windowing system. You have to write little pieces of code that >>>can be invoked in any order at any time outside your control. >>>You have to use global variables extensively for these little >>>pieces of code to communicate. The code is difficult to read >>>because you have to understand all these little pieces to >>>understand any part of the software. >> >>In Windex, GWindows, CLAW, and GtkAda, each "little piece of >>code" has as a parameter the user window type. That type stores >>all the information needed; no global variables are necessary. >> >>I can (with a lot of effort to suppress my normal style :) >>write messy, hard to read code in Windex, using global >>variables. But it's certainly not required. > > I disagree that callbacks and dispatching are essentially the same, Agreed. In a dispatching program there is too much temptation for the programmer to have unwanted coupling between the cases of code (they could share object(s)/variable(s) that were unintended). In a callback, this risk is reduced because the object(s)/variable(s) are localized to the callback itself. -- Warren W. Gay VE3WWG http://home.cogeco.ca/~ve3wwg