comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm-host.bauhaus@maps.futureapps.de>
Subject: Re: Properties
Date: Thu, 02 Dec 2010 00:24:14 +0100
Date: 2010-12-02T00:24:15+01:00	[thread overview]
Message-ID: <4cf6d91e$0$6980$9b4e6d93@newsspool4.arcor-online.net> (raw)
In-Reply-To: <op.vm1v5lh4z25lew@macpro-eth1.krischik.com>

On 12/1/10 8:52 PM, Martin Krischik wrote:
> Am 28.11.2010, 13:37 Uhr, schrieb Georg Bauhaus <rm-host.bauhaus@maps.futureapps.de>:
>
>> As such, an ASIS enabled Ada processor should be able to write
>> these without too much effort.
>
> Not from a readability point. The argument for properties is that they don't clutter your code. Imagine that when 'Image, 'Value etc. pp where purposed your solution was choosen and code generator would actually add the code for those functions into source. Would that not look hyper ugly.

I don't see how "automatic" get/set subprograms offer
software engineering advantage, even when they are terse
and semi-implicit and purport to avoid repetitive clutter.
It's the desire for the structural clutter that get/set
style really is that I find worrisome.

I'd like to mention an alternative language design idea
by Jeffrey Kingston for contrast with get/set style for
record components.  Whenever you invoke an operation of
an object, you create a new object.


Observe the programs resulting from get/set style. If they
are working, aren't they typically hiding spaghetti coding,
and privacy intrusion?

There certainly are ways of justifying programs in spite
of these qualities.  One is the post hoc fallacy:

"The get/set feature works, since this program works.
Therefore, to choose the get/set approach was right."

If the post hoc fallacy helps you as a person to get
along, fine.
If the post hoc fallacy helps bring customers to Ada,
that's fine for the vendors, I'd say.
Is it fine, though, with those companies in industry
needing to maintain software in order to stay competitive?


There is an everyone-does-it argument in favor of get/set.
I list some use cases.  Which ones do I miss?

- array like access to data structures.

The low level style thinking shines through.
Sometimes just right.  Worth a language change?

- GUI field updates

Forms have not really become "smarter", though, after 30 years
of writing form input logic.  (Oh, I see!  If we did the
software engineering thing and use good algorithms instead of
record component assignments bridled by get/set, still à la FORTRAN 66,
we will not make any more money by writing the same programs
over and over. The old ones still work... O.K., that's a point.)

- data base objects

For building a layer on top of relational records, OK.
For quick and dirty database scripting it might be enough
to update some field in some view (or table) through some setter.
As a design guide, get/set let me understand the many reports about
data bases whose handling requires intimate knowledge of
the details of every program and of every table.

- ...

OK, I'm biased as I'm usually the one who cleans up after
those who think that getting and setting is the best software
design principle.

Anyway, one can always add get/set to Ada since that eases
the transition from the other languages who have added
get/set in very recent years, too.   And exclude get/set
from SPARK for the more critical programs.


~



  reply	other threads:[~2010-12-01 23:24 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-28  3:21 Properties Shark8
2010-11-28  8:15 ` Properties Dmitry A. Kazakov
2010-11-28 19:43   ` Properties Shark8
2010-11-29  8:34     ` Properties Dmitry A. Kazakov
2010-12-01 18:15       ` Properties Shark8
2010-11-28 12:37 ` Properties Georg Bauhaus
2010-11-28 21:22   ` Properties Shark8
2010-11-29 16:54     ` Properties Georg Bauhaus
2010-12-01 19:52   ` Properties Martin Krischik
2010-12-01 23:24     ` Georg Bauhaus [this message]
2010-12-05 16:15       ` (placepo) Properties Martin Krischik
2010-12-06 23:24         ` Shark8
2010-12-01 23:31     ` Properties Georg Bauhaus
2010-11-30  1:49 ` Properties Randy Brukardt
2010-11-30 16:58   ` Properties Charmed Snark
2010-11-30 17:22     ` Properties Dmitry A. Kazakov
2010-11-30 20:27       ` Properties Warren
2010-12-01  8:39         ` Properties Dmitry A. Kazakov
2010-12-01 15:21           ` Properties Warren
2010-12-01 15:59             ` Properties Dmitry A. Kazakov
2010-12-01 16:20               ` Properties Warren
2010-12-01 18:22                 ` Properties Dmitry A. Kazakov
2010-12-01 19:36                   ` Properties Shark8
2010-12-01 21:13                     ` Properties Dmitry A. Kazakov
2010-12-01 21:35                   ` Properties Maciej Sobczak
2010-12-01 21:45                     ` Properties Dmitry A. Kazakov
2010-12-02  9:57                       ` Properties Maciej Sobczak
2010-12-02 10:26                         ` Properties Dmitry A. Kazakov
2010-12-02 15:25                           ` Properties Maciej Sobczak
2010-12-02 15:46                             ` Properties Dmitry A. Kazakov
2010-12-02 21:11                               ` Properties Maciej Sobczak
2010-12-02 22:19                                 ` Properties Dmitry A. Kazakov
2010-12-03  4:43                                 ` Properties Randy Brukardt
2010-12-03 13:53                                   ` Properties Maciej Sobczak
2010-12-03 21:32                                     ` Properties Randy Brukardt
2010-12-04 22:13                                       ` Properties Maciej Sobczak
2010-12-06 23:30                                         ` Properties Shark8
2010-12-06 23:33                                         ` Properties Randy Brukardt
2010-12-04 17:43                           ` Properties Simon Wright
2010-12-04 20:48                             ` Properties Dmitry A. Kazakov
2010-12-04 22:27                               ` Properties Simon Wright
2010-12-04 22:31                                 ` Properties Vinzent Hoefler
2010-12-03  4:24                         ` Properties Randy Brukardt
2010-12-03  5:00                         ` Properties Shark8
2010-12-03 21:10                           ` Properties Randy Brukardt
2010-12-03 23:34                           ` Properties Jeffrey Carter
2010-12-06  6:02                             ` Properties Brad Moore
2010-12-06 23:25                               ` Properties Shark8
2010-12-01 19:48                 ` Properties Randy Brukardt
2010-12-01 21:10                   ` Properties Warren
2010-12-02  0:03                     ` Properties Shark8
2010-12-02 16:45                       ` Properties Warren
2010-12-02 17:32                         ` Properties Dmitry A. Kazakov
2010-12-02 20:45                           ` Properties Warren
2010-12-02 21:17                             ` Properties Adam Beneschan
2010-12-02 21:40                               ` Properties Warren
2010-12-03  3:34                             ` Properties Shark8
2010-12-03  8:16                               ` Properties Thomas Løcke
2010-12-02 20:52                           ` Properties Pascal Obry
2010-12-02 19:46                         ` Properties Adam Beneschan
2010-12-02 20:38                           ` Properties Warren
2010-12-02 21:39                             ` Properties Jeffrey Carter
2010-12-02 21:55                               ` Properties Warren
2010-12-03  9:33                               ` Properties Anonymous
2010-12-03  3:47                           ` Properties Shark8
2010-12-03  0:09                         ` Properties Robert A Duff
2010-12-03 15:49                           ` Properties Warren
2010-12-03 20:07                             ` Properties Shark8
2010-12-06 21:01                               ` Properties Warren
2010-12-06 23:22                                 ` Properties Shark8
2010-12-07 14:37                                   ` Properties Warren
2010-12-08 21:13                                   ` Properties Simon Wright
2010-12-09  1:21                                     ` Properties Shark8
2010-12-06 23:43                                 ` Properties Randy Brukardt
2010-12-07  0:56                                   ` Properties Jeffrey Carter
2010-12-07 11:23                                   ` Properties Maciej Sobczak
2010-12-07 11:51                                     ` Properties Georg Bauhaus
2010-12-07 15:35                                       ` Properties Maciej Sobczak
2010-12-07 17:02                                         ` Properties Georg Bauhaus
2010-12-07 14:39                                   ` Properties Warren
2010-12-03 15:40                         ` Properties Warren
2010-12-03 19:56                           ` Properties Shark8
2010-12-03 20:12                             ` Properties Warren
2010-12-03  5:53               ` Properties Shark8
2010-12-03  9:05                 ` Properties Dmitry A. Kazakov
2010-12-03 19:52                   ` Properties Shark8
2010-12-03 21:14                     ` Properties Randy Brukardt
2010-12-04  5:35                       ` Properties Shark8
2010-12-04 14:23                         ` Properties Peter C. Chapin
2010-12-04 18:53                           ` Properties Shark8
2010-12-13 15:10                       ` Properties Brian Drummond
2010-12-03 22:38                     ` Properties Dmitry A. Kazakov
2010-12-04  3:12                       ` Properties Shark8
2010-12-04 13:19                     ` Properties Georg Bauhaus
  -- strict thread matches above, loose matches on Subject: below --
2010-12-04 19:53 Properties Shark8
2010-12-04 23:27 ` Properties Thomas Løcke
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox