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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Your wish list for Ada 202X Date: Tue, 22 Apr 2014 11:14:44 +0200 Organization: cbb software GmbH Message-ID: <10o6qo98dwzjs$.rdpzvq7w1lep.dlg@40tude.net> References: <7f1c01c5-3563-4b94-9831-152dbbf2ecdc@googlegroups.com> <1w6eh0aiksmdh$.1h16p7y0b8c6h.dlg@40tude.net> <17twpp4p8u7o$.1idvzaaio4f3t$.dlg@40tude.net> <1wjmcbk375lzk.6o7dpqcp3va3.dlg@40tude.net> <11241mc0j3ewn.14ahwtra3l1i8.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: G+aXx1XI67D34t54ibhUPQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 X-Original-Bytes: 3111 Xref: number.nntp.dca.giganews.com comp.lang.ada:185933 Date: 2014-04-22T11:14:44+02:00 List-Id: On Tue, 22 Apr 2014 02:30:17 -0600, Shark8 wrote: > On 22-Apr-14 02:02, Dmitry A. Kazakov wrote: >> But there should be no Open operation at all. > > Why not? > It seems to me that Open could be ideal for some object, like say an > object representing flood-gates, or an internally used operation for an > "e-mail reader", or dozens of other things (perhaps file processing > [e.g. Get_File_List, Filter, Open as basic 'operations' of the processor]). This is a completely irrelevant case. I talked (and I believe Randy did too) about Open like file open and hence the problem that it cannot be inherited with consequent maintenance problems for clients. >> This is another language problem that Ada forces you to introduce Open, >> which adds unusable object states (not yet opened object), must be >> overridden (but there is no way to spell that requirement), must call >> to the parent's Open (but. again, no way to ensure that). > > Not entirely true; with pre/post conditions, and perhaps type-invariants > you can prohibit such states from being entered (which will result in an > exception). Which is exactly the problem - this introduces erroneous states, where there should be none. From the SW design POV there shall be no way to create a closed file, an uninitialized widget, a float with the FPU turned off etc. The elementary principle of SW design is that the program must be functional in each of its states., in other words be a correct program. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de