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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,248f80acc3d5ccb3 X-Google-Attributes: gid103376,public From: Florian Weimer Subject: Re: Objects properties - Ada design issues question Date: 2000/02/04 Message-ID: <877lgklryd.fsf@deneb.cygnus.argh.org>#1/1 X-Deja-AN: 581616895 References: Mail-Copies-To: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@cygnus.argh.org X-Trace: deneb.cygnus.argh.org 949690426 30554 192.168.1.2 (4 Feb 2000 18:53:46 GMT) Organization: Penguin on board User-Agent: Gnus/5.0804 (Gnus v5.8.4) Emacs/20.4 Mime-Version: 1.0 Reply-To: Florian Weimer NNTP-Posting-Date: 4 Feb 2000 18:53:46 GMT Newsgroups: comp.lang.ada Date: 2000-02-04T18:53:46+00:00 List-Id: "Vladimir Olensky" writes: > A : [property] constant Integer; > B : [property] Integer; Using [] isn't a good idea, because it doesn't fit Ada very well. (This character isn't used by the language now, perhaps that's why you chose it.) In addition, I would preserve [] (and @) for Objective Ada. ;) Microsoft patented the [] construct (for preventing clashes with existing syntax and keywords) several years ago, BTW. > It would be very interesting to hear different opinions > regarding this "objects properties" issue and it's > prospective of being implemented in future Ada revisions. > As was shown this could be done without changing current > Ada syntax. Why are Get/Set subprograms inferior to this approach? IMHO, this is just syntactic sugar of very questionable quality. It doesn't make sense to me to write: Some_Label.Width := New_Width; Some_Label.Height := New_Height; instead of: Resize (Some_Label, Width => New_Width, Height => New_Height); The latter one is much more explicit and immediately suggests that some kind of operation takes place. Finally, use of properties seems to be rather restricted to visual GUI design, and there are some technical reasons for it in this region. For example, in Delphi, they aren't mere syntactic sugar, but they provide some kind of introspection feature needed by the GUI design tool (which has to present the properties of, say, a label to the developer so that he can make adjustments).