comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: What is your opinion on Global Objects?
Date: Thu, 20 Nov 2014 22:35:16 +0100
Date: 2014-11-20T22:35:16+01:00	[thread overview]
Message-ID: <m4lmq9$970$1@dont-email.me> (raw)
In-Reply-To: <a5e96019-1451-4949-8e55-c05912bdb33f@googlegroups.com>

Le 20/11/2014 21:33, sbelmont700@gmail.com a écrit :
> For what it's worth, I'm in the "pass everything as an argument" camp
> (and really functional programming in general), and loathe the
> 'hidden state' setup, for the following reasons:
Let's see what the other camp has to respond...

> 1. You are hardcoded to a particular implementation (i.e. no dispatching)
Yes, it is more static, therefore safer and more easily provable.
Dispatching is a very powerful tool, but only when you really need it.

> 2. You always end up needing a second object, no matter much you think you don't think you will.
Doesn't meet my experience. Knowing that by design there can be only one
object simplifies understanding and provability. You don't have to worry
about which object you are dealing with - there is only one.

> 3. The majority of the program becomes impure
??? Please explain you notion of "purity".

> 4. Things that access global objects are way more complex to try and test
Yes, when accessing in uncontrolled ways global variables from multiple
places. No with proper encapsulation (like here) with accessors and
selectors that can control exclusive access if necessary.

> 5. Everything is compile-time constant (i.e. no creating or deleting things dynamically).
I would regard this as a huge benefit - dynamicity has always been
opposed to simplicity and provability.

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr


  reply	other threads:[~2014-11-20 21:35 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-18  1:36 What is your opinion on Global Objects? Hubert
2014-11-18  2:52 ` Jeffrey Carter
2014-11-18  3:08   ` Hubert
2014-11-18  3:16     ` Shark8
2014-11-18  5:09     ` Jeffrey Carter
2014-11-18 11:23     ` Brian Drummond
2014-11-19  2:50       ` Hubert
2014-11-19  3:03         ` Jeffrey Carter
2014-11-19  9:13           ` Hubert
2014-11-19 10:22             ` J-P. Rosen
2014-11-19 17:37             ` Jeffrey Carter
2014-11-20 16:34         ` Stephen Leake
2014-11-20 21:11           ` Adam Beneschan
2014-11-21 15:25             ` Stephen Leake
2014-11-21 21:53             ` Randy Brukardt
2014-11-21  1:25           ` Hubert
2014-11-21  3:00           ` Brad Moore
2014-11-19 10:11   ` Jacob Sparre Andersen
2014-11-20  6:21     ` Hubert
2014-11-18  8:54 ` Dmitry A. Kazakov
2014-11-20 20:33 ` sbelmont700
2014-11-20 21:35   ` J-P. Rosen [this message]
2014-11-21  1:02     ` sbelmont700
2014-11-21  1:31       ` Hubert
2014-11-21  9:01     ` Dmitry A. Kazakov
2014-11-22  7:46       ` J-P. Rosen
2014-11-22  9:02         ` Dmitry A. Kazakov
replies disabled

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