comp.lang.ada
 help / color / mirror / Atom feed
From: "G.B." <bauhaus@futureapps.invalid>
Subject: Things that OO programming lacks (was: What exactly is the licensing situation with GNAT?)
Date: Fri, 14 Nov 2014 16:29:56 +0100
Date: 2014-11-14T16:29:56+01:00	[thread overview]
Message-ID: <m45757$huh$1@dont-email.me> (raw)
In-Reply-To: <5yzci4a8snfg.1dfsqjyvneeym$.dlg@40tude.net>

On 14.11.14 14:35, Dmitry A. Kazakov wrote:
>> That's the theory. But in practice, having all the hard stuff written
>> >already just promotes cutting and pasting of a different color. The code
>> >that*uses*  those classes is normally not reusable. That's what is cutting
>> >and pasting. It's been shoved down a level or two.
> Maybe. But, again, what would be better?

Better? A mode of expressing what we know beyond our objects,
in dedicated language:

Since programmers are starting to know more about patterns
of connecting objects, I suppose something expressing those
patterns more clearly would be useful.
For example, "connections" may refer to order of calls in time,
and to "flow" caused by "data".

A way to express these patterns of OO  programming will avoid
producing intractable state manipulation code (a.k.a. spaghetti).
OO does not prevent programmers from just operating setters
and getters, "knowing" the effects this has on the "other" object.

When a programming method using patterns relies on naming
and conventions, like the GoF patterns do, that's not language,
is it?

Another important example is events.

Consider a system with many inputs, many outputs, and also
some treads. A GUI program, or a control unit, an OS, etc.
There will be events in need of a response.
Events are generated either by programs or by the world.

Then I want to express, at the language level, using
dedicated source text:

-  What are all of the events than can have a normal effect
    on the program?

-  What are the possible orders of these events?

-  How can I arrange for orders of events to be know
    at or after run time?

-  How can I connect events expressly to objects that
    respond to the events?

-  How can I learn, by looking at specific language in
    a program, which objects are connected to an event?

At first, Ada's task type seem to covers order of events,
in bodies (only?). Using the control structure of the
language facilitates expressing possible orders:

   task body ... is
   begin
      ...
      accept first_this;
      ...
      accept then_that (...)
      ...
      loop
       select
         accept either_A (...)
         ...
       or
         accept or_B (...)
         ...
       end select;
      end loop;
   end ;

But this is only half way, since task objects' definition does not,
by design, show possible connections of multiple task objects in
a program.  The other side, that of calling tasks (selectively)
adds to the complexity of analysis.

Similarly, there are ways to place a restriction on the
order of subprogram calls. For example, one might force an order
by having a sequence of functions consume and produce objects
from an ordered sequence of types:

    function A (Obj : T0) return T1:
    function B (Obj : T1) return T2:
    ...
    function M (Obj : T16) return T5:
    ...

Or one could be using condition expressions, like in

   procedure P (Object : in out Typ; ...)
    with
      Pre => Object.State (State_No'(4711));


   function State (Object : in Typ) return State_No;

but both are not specific language, and at least the second,
i.e. Pre referring to object state, require mere conventions.

To me these look like a poor workarounds, Pre more than the types TK,
even when they assist the client programmer writing calls of
subprograms in proper order. Which only shows that a way to
express order, e.g. in interfaces, is valuable.

To have language for expressing connections in a program would
be better.  We only got tools that show graphs of a few arrows,
as in design diagrams for interfaces and models. But we do not
really have source text specifically addressing order of events,
and connections made on the occasion.



  reply	other threads:[~2014-11-14 15:29 UTC|newest]

Thread overview: 241+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-10  9:30 What exactly is the licensing situation with Gnat? Hubert
2014-11-10 10:03 ` Markus Schöpflin
2014-11-10 10:38 ` What exactly is the licensing situation with GNAT? Jacob Sparre Andersen
2014-11-10 11:09   ` Hubert
2014-11-10 11:19     ` Markus Schöpflin
2014-11-10 15:45       ` David Botton
2014-11-11  0:09         ` Hubert
2014-11-11 10:54           ` Georg Bauhaus
2014-11-11 11:05             ` Hubert
2014-11-11 13:37           ` john
2014-11-11 22:52             ` Hubert
2014-11-11 23:10               ` David Botton
2014-11-11 23:25                 ` Alan Jump
2014-11-12  0:50                   ` David Botton
2014-11-12  1:02                     ` Simon Clubley
2014-11-12  7:09                       ` Gour
2014-11-12 11:06                         ` David Botton
2014-11-12  7:41                       ` Simon Wright
2014-11-13  1:30                         ` Simon Clubley
2014-11-12  1:15                     ` Hubert
2014-11-12  1:24                       ` David Botton
2014-11-12  1:33                         ` Hubert
2014-11-12  7:13                         ` Gour
2014-11-12 10:56                           ` David Botton
2014-11-12  8:12                         ` Simon Wright
2014-11-12  8:35                           ` Hubert
2014-11-12  9:25                             ` Mark Carroll
2014-11-12  9:37                               ` Hubert
2014-11-12 10:31                                 ` jm.tarrasa
2014-11-12 10:43                                   ` J-P. Rosen
2014-11-12 10:44                                   ` Hubert
2014-11-12 12:06                                     ` Gour
2014-11-12 12:38                                       ` David Botton
2014-11-12 15:23                                         ` Gour
2014-11-12 16:30                                           ` David Botton
2014-11-12 13:20                                     ` Dmitry A. Kazakov
2014-11-12 22:53                                     ` Randy Brukardt
2014-11-12 23:21                                       ` David Botton
2014-11-13  1:49                                         ` Randy Brukardt
2014-11-13  8:18                                           ` Georg Bauhaus
2014-11-13 21:51                                             ` Randy Brukardt
2014-11-14  8:36                                               ` Dmitry A. Kazakov
2014-11-14 22:24                                                 ` Randy Brukardt
2014-11-14 22:43                                                   ` Jeffrey Carter
2014-11-15  9:18                                                   ` Dmitry A. Kazakov
2014-11-18  0:37                                                     ` Randy Brukardt
2014-11-18  9:04                                                       ` Dmitry A. Kazakov
2014-11-14  4:51                                         ` Randy Brukardt
2014-11-14  5:12                                           ` David Botton
2014-11-14  6:13                                             ` Randy Brukardt
2014-11-14  8:40                                               ` Dmitry A. Kazakov
2014-11-14 22:29                                                 ` Randy Brukardt
2014-11-15  9:29                                                   ` Dmitry A. Kazakov
2014-11-15  9:40                                                     ` Pascal Obry
2014-11-15 11:18                                                     ` Tero Koskinen
2014-11-15 11:36                                                       ` Dmitry A. Kazakov
2014-11-18  0:28                                                     ` Randy Brukardt
2014-11-18  9:20                                                       ` Dmitry A. Kazakov
2014-11-18 22:25                                                         ` Randy Brukardt
2014-11-19  9:10                                                           ` Dmitry A. Kazakov
2014-11-19 23:59                                                             ` Randy Brukardt
2014-11-20  9:53                                                               ` Dmitry A. Kazakov
2014-11-20 21:23                                                                 ` Randy Brukardt
2014-11-21  9:38                                                                   ` Dmitry A. Kazakov
2014-11-21 22:12                                                                     ` Randy Brukardt
2014-11-22  9:21                                                                       ` Dmitry A. Kazakov
2014-11-15 17:32                                           ` Florian Weimer
2014-11-15 19:58                                             ` 'Image (was: What exactly is the licensing situation with GNAT?) Georg Bauhaus
2014-11-18  0:39                                               ` Randy Brukardt
2014-11-18  8:20                                                 ` 'Image Björn Lundin
2014-11-18 22:29                                                   ` 'Image Randy Brukardt
2014-11-19 13:46                                               ` 'Image (was: What exactly is the licensing situation with GNAT?) Brian Drummond
2014-11-19 14:21                                                 ` 'Image G.B.
2014-11-20 13:32                                                   ` 'Image Brian Drummond
2014-11-13  0:48                                       ` What exactly is the licensing situation with GNAT? sbelmont700
2014-11-13  1:31                                         ` Randy Brukardt
2014-11-13  1:29                                       ` Randy Brukardt
2014-11-13  8:03                                         ` Georg Bauhaus
2014-11-13 22:22                                           ` Randy Brukardt
2014-11-13 16:26                                         ` Tero Koskinen
2014-11-13 22:29                                           ` Randy Brukardt
2014-11-13  1:54                                       ` Hubert
2014-11-13  2:04                                         ` Hubert
2014-11-13  7:53                                         ` Luther Bogart
2014-11-13  7:58                                           ` Luther Bogart
2014-11-13 16:38                                         ` Tero Koskinen
2014-11-13 21:57                                         ` Randy Brukardt
2014-11-13 22:02                                           ` Mark Carroll
2014-11-13 22:43                                           ` Jeffrey Carter
2014-11-14  1:36                                             ` Hubert
2014-11-14  4:45                                               ` Randy Brukardt
2014-11-14  5:24                                                 ` Hubert
2014-11-14  8:51                                               ` Dmitry A. Kazakov
2014-11-14  9:02                                                 ` Stan Mills
2014-11-14 10:14                                                   ` Dmitry A. Kazakov
2014-11-14 10:38                                                     ` Stan Mills
2014-11-14 12:57                                                       ` Peter Chapin
2014-11-14 22:33                                                         ` Randy Brukardt
2014-11-17  8:28                                                         ` Stan Mills
2014-11-14 13:35                                                       ` Dmitry A. Kazakov
2014-11-14 15:29                                                         ` G.B. [this message]
2014-11-14 16:32                                                           ` Things that OO programming lacks Dmitry A. Kazakov
2014-11-15 19:46                                                             ` Georg Bauhaus
2014-11-16 10:18                                                               ` Dmitry A. Kazakov
2014-11-16 18:51                                                                 ` Shark8
2014-11-16 19:33                                                                   ` Dmitry A. Kazakov
2014-11-17 15:17                                                                 ` G.B.
2014-11-17 17:28                                                                   ` Dmitry A. Kazakov
2014-11-17 18:23                                                                     ` G.B.
2014-11-17 20:02                                                                       ` Georg Bauhaus
2014-11-17 21:05                                                                       ` Dmitry A. Kazakov
2014-11-18 10:14                                                                         ` Georg Bauhaus
2014-11-18 13:42                                                                           ` Dmitry A. Kazakov
2014-11-18 18:50                                                                             ` G.B.
2014-11-18 19:18                                                                               ` Dmitry A. Kazakov
2014-11-17 19:21                                                                     ` Shark8
2014-11-17 20:44                                                                       ` Dmitry A. Kazakov
2014-11-16 17:54                                                             ` Simon Wright
2014-11-16 19:01                                                               ` Niklas Holsti
2014-11-16 19:14                                                                 ` Simon Wright
2014-11-16 19:39                                                               ` Dmitry A. Kazakov
2014-11-16 20:33                                                                 ` Simon Wright
2014-11-17  8:44                                                                   ` Dmitry A. Kazakov
2014-11-17 14:29                                                                     ` Simon Wright
2014-11-17 17:38                                                                       ` Dmitry A. Kazakov
2014-11-17  8:36                                                         ` What exactly is the licensing situation with GNAT? Stan Mills
2014-11-17 11:03                                                           ` Dmitry A. Kazakov
2014-11-17 14:20                                                             ` G.B.
2014-11-14  9:19                                                 ` Hubert
2014-11-14 10:30                                                   ` Dmitry A. Kazakov
2014-11-15  1:00                                                     ` Hubert
2014-11-15  1:24                                                       ` Hubert
2014-11-15  9:45                                                         ` Dmitry A. Kazakov
2014-11-15 10:27                                                           ` Hubert
2014-11-15 19:44                                                             ` Robert A Duff
2014-11-15  7:22                                                       ` Gour
2014-11-15  9:57                                                         ` Dmitry A. Kazakov
2014-11-15 10:51                                                           ` Gour
2014-11-15 11:26                                                             ` Dmitry A. Kazakov
2014-11-15 12:41                                                               ` Gour
2014-11-15 13:18                                                                 ` Dmitry A. Kazakov
2014-11-17  8:11                                                     ` Stan Mills
2014-11-17  8:28                                                       ` Dmitry A. Kazakov
2014-11-17  8:48                                                         ` Stan Mills
2014-11-17 10:40                                                           ` Dmitry A. Kazakov
2014-11-13  8:03                                       ` Pete Ballmer
2014-11-13  8:41                                         ` Georg Bauhaus
2014-11-13  8:59                                         ` Georg Bauhaus
2014-11-12 11:18                                   ` David Botton
2014-11-13  0:01                                   ` David Botton
2014-11-13  0:03                                     ` David Botton
2014-11-12 11:15                                 ` David Botton
2014-11-13 23:56                                   ` David Botton
2014-11-14  7:50                                     ` community-based compiler (was Re: What exactly is the licensing situation with GNAT?) Gour
2014-11-14  7:57                                       ` community-based compiler Gour
2014-11-14 14:53                                       ` community-based compiler (was Re: What exactly is the licensing situation with GNAT?) Luke A. Guest
2014-11-14 14:57                                         ` David Botton
2014-11-14 16:16                                           ` Luke A. Guest
2014-11-14 16:34                                             ` David Botton
2014-11-14 16:42                                               ` Luke A. Guest
2014-11-16 19:30                                               ` community-based compiler Florian Weimer
2014-11-14 15:27                                         ` Gour
2014-11-14 16:16                                           ` Luke A. Guest
2014-11-14 16:26                                             ` Gour
2014-11-14 16:48                                               ` Luke A. Guest
2014-11-16 19:31                                                 ` Florian Weimer
2014-11-14 16:03                                         ` community-based compiler (was Re: What exactly is the licensing situation with GNAT?) Tero Koskinen
2014-11-14 22:40                                         ` Randy Brukardt
2014-11-15  1:07                                           ` Luke A. Guest
2014-11-15  8:08                                           ` community-based compiler Gour
2014-11-16 19:29                                         ` Florian Weimer
2014-11-14 17:13                                       ` community-based compiler (was Re: What exactly is the licensing situation with GNAT?) Shark8
2014-11-14 18:55                                         ` David Botton
2014-11-14 20:53                                           ` Shark8
2014-11-14 21:07                                             ` Luke A. Guest
2014-11-14 22:35                                               ` Shark8
2014-11-15  1:07                                                 ` Luke A. Guest
2014-11-18  0:52                                                   ` Randy Brukardt
2014-11-18  3:06                                                     ` Luke A. Guest
2014-11-18  9:25                                                       ` Georg Bauhaus
2014-11-18 22:33                                                       ` Randy Brukardt
2014-11-15 12:44                                             ` Brian Drummond
2014-11-15 22:47                                               ` Shark8
2014-11-16 11:12                                                 ` Brian Drummond
2014-11-16 21:38                                                   ` Shark8
2014-11-17 11:28                                               ` Natasha Kerensikova
2014-11-19 13:48                                                 ` Brian Drummond
2014-11-27 12:52                                                 ` Brian Drummond
2014-11-14 21:05                                           ` Luke A. Guest
2014-11-14  8:25                                     ` What exactly is the licensing situation with GNAT? Pete Ballmer
2014-11-14 12:46                                       ` Peter Chapin
2014-11-15  8:47                                         ` Mart van de Wege
2014-11-16  9:32                                         ` Pete Ballmer
2014-11-16 19:41                                         ` Florian Weimer
2014-11-12 13:31                                 ` Jacob Sparre Andersen
2014-11-12 14:33                                   ` David Botton
2014-11-12 15:07                                     ` David Botton
2014-11-12 16:39                                       ` Simon Wright
2014-11-12 23:06                                     ` Randy Brukardt
2014-11-12 23:31                                       ` David Botton
2014-11-13  1:59                                         ` Randy Brukardt
2014-11-13  2:21                                           ` David Botton
2014-11-13 22:01                                             ` Randy Brukardt
2014-11-12 22:47                                 ` Randy Brukardt
2014-11-12 23:23                                   ` Britt
2014-11-13  2:10                                     ` Randy Brukardt
2014-11-13  5:13                                       ` Shark8
2014-11-13  9:43                                       ` Gour
2014-11-13 22:06                                         ` Randy Brukardt
2014-11-13 23:37                                           ` Gour
2014-11-13 16:51                                     ` Tero Koskinen
2014-11-13  7:46                                   ` George Curioso
2014-11-13 22:14                                     ` Randy Brukardt
2014-11-14  8:18                                       ` George Curioso
2014-11-12 10:53                             ` Simon Wright
2014-11-12 11:19                               ` David Botton
2014-11-12  8:16                         ` Simon Wright
2014-11-12  8:06                       ` Simon Wright
2014-11-12  8:26                         ` Hubert
2014-11-12  7:13                     ` Pascal Obry
2014-11-12  7:47                       ` Hubert
2014-11-12  9:08                       ` Thomas Jahrne
2014-11-12 10:19                         ` Georg Bauhaus
2014-11-12  9:30                       ` Mark Carroll
2014-11-12 11:05                       ` David Botton
2014-11-12 11:32                         ` Pascal Obry
2014-11-12 12:31                           ` David Botton
2014-11-12 13:17                             ` G.B.
2014-11-12 14:21                               ` David Botton
2014-11-12 18:31                                 ` john
2014-11-12 18:56                                   ` David Botton
2014-11-12 19:24                                     ` David Botton
2014-11-13  1:48                                   ` Simon Clubley
2014-11-13  7:40                                     ` Harry Bolger
2014-11-13  8:30                                       ` Georg Bauhaus
2014-11-13  8:41                                         ` Harry Bolger
2014-11-13  8:57                                           ` Georg Bauhaus
2014-11-13 14:30                                           ` Maciej Sobczak
2014-11-13 19:19                                             ` Peter Chapin
2014-11-13 19:43                                               ` David Botton
2014-11-12  7:38                 ` Simon Wright
replies disabled

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