From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: Convention for naming of packages
Date: Tue, 14 Feb 2012 10:08:37 +0100
Date: 2012-02-14T10:08:37+01:00 [thread overview]
Message-ID: <op.v9nvont0ule2fv@douda-yannick> (raw)
In-Reply-To: 1nsv5nr9t05qd$.4u7741n9thcp.dlg@40tude.net
Le Mon, 13 Feb 2012 22:02:17 +0100, Dmitry A. Kazakov
<mailbox@dmitry-kazakov.de> a écrit:
>>> package Units.Base is
>>> Current : constant Unit;
>>> Luminescence : constant Unit;
>>> Temperature : constant Unit;
>>> ...
>> This is a good example, but still not a singleton,
>
> That was an example of singleton values.
That's an example way to declare symbols. I feel singleton as constant are
apart (I use this too). Interesting topic, but would drift from naming
conventions.
>> that's a specification, there is no need for an instantion here.
>
> This one for singleton objects:
>
> package Standard_IO is
> Input : File_Type; -- Assuming File_Type limited
> Output : File_Type;
> Error : File_Type;
>
> Here is an example for singleton type:
Personally, I prefer functions instead of this (don't want to comment more
on that, would drift from naming convention too).
>> About package holding singleton really holding singleton, like say a Log
>> package which would create a singleton file "Log.File" objct, I believe
>> that's not good for re‑usability (ex. what about multiple task?). Better
>> provide a type with a constructor,
>
> Constructor = constructor or constructor = constructing function? The
> latter is bad design.
I never get into trouble with this. If I am likely to get into troubles
with it, I would like to know before it happens and have a chance to
prevent it before, obviously. On the mean time, I'm not a big tagged type
user, and feel to understand your objections to it, mainly applies to
tagged types hierarchies. I would enjoy some pointers on the web on this
topic. However, as long as I think "creation function", there are little
risk I will get surprised with Ada's creation functions.
> As for the example with log file, it is better not to expose it:
>
> package Logging is
> type Category is mod ...;
> Warning : constant Category;
> Error : constant Category;
> Info : constant Category;
> Any : constant Category;
> ...
> procedure Log (Event : Category; Text : String; Stamp : Time :=
> Clock);
> ...
> end Logging;
I agree (as a side not, I would also add a Source parameter to this :-P ).
>> What lacks for me here, is some paper with in deep talks about naming
>> convention in numerous ways.
>
> J-P provided one. He is one, whom opinion you can always trust (even if
> you disagree).
I trust his paper, and read the one he pointed since long. As you probably
noticed, I use the convention he pointed to, with just a tiny variation.
Still does not cover enough of my concerns. And by the way, although I
trust him, I don't necessarily have to always agree with him: a good
practice is like a good spelling to me, the good spelling of a word
depends on the language (a word well spelled in a language is no good in
another language, what ever how much it is well spelled in its original
language); similarly, a practice is likely to apply fine in a context
where a set of other practices also applies. And this depend on the target
and applications among others criteria.
Anyway, the paper he pointed to, although valuable, does not cover the
questions I raised (but make me raise these questions in some way!). And I
found no deeper papers on the web, except the ones from J.P. Rosen and
some Quality & Style Guide for Ada (unfortunately, I don't adhere to most
of the naming conventions from this Quality & Style Guides).
That's why I am experimenting during the opportunity of a short enough
application, to not have to experiment later on a bigger one (would
inevitably drives to hard disappointments).
>> If a container type, named Container_Type can provide itself the type
>> for
>> its index. How can you refer to it, if not via some expression, like
>> "Container_Type.Index_Type"?
>
> T'Index. Note that this is not an expression proper because in a
> statically
> typed language the algebra of types is separated from the core (object)
> language. The type and type-valued operations are not the first class
> citizens. Types in Ada have a meta language with rudimentary expressions
> of
> its own. Yes it should be extended a bit, but not too much. Otherwise you
> could lose the property of being statically typed.
Yes, I was wrong when I used the word "expression" for that purpose.
T'Index vs T.Index may be an interesting topic, but an extrapolating one
(as Ada is actually not this way) I don't want to go into now.
Well, I will go on with my "Run"/"Apply"/"Value"/"Evaluated"/"Get" and so
on, with the hope I will end into something stable and satisfying with
clear enough definitions.
--
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University
next prev parent reply other threads:[~2012-02-14 9:08 UTC|newest]
Thread overview: 88+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-09 21:10 Convention for naming of packages Yannick Duchêne (Hibou57)
2012-02-09 21:39 ` Jeffrey Carter
2012-02-10 15:07 ` Yannick Duchêne (Hibou57)
2012-02-10 17:04 ` Georg Bauhaus
2012-02-10 17:09 ` Georg Bauhaus
2012-02-10 17:41 ` Yannick Duchêne (Hibou57)
2012-02-13 9:33 ` Yannick Duchêne (Hibou57)
2012-02-11 0:56 ` Randy Brukardt
2012-02-13 3:09 ` BrianG
2012-02-10 17:21 ` Pascal Obry
2012-02-10 18:03 ` Yannick Duchêne (Hibou57)
2012-02-11 1:06 ` Randy Brukardt
2012-02-11 9:22 ` Simon Wright
2012-02-11 10:17 ` Yannick Duchêne (Hibou57)
2012-02-11 19:24 ` Yannick Duchêne (Hibou57)
2012-02-11 20:06 ` Simon Wright
2012-02-12 9:18 ` Yannick Duchêne (Hibou57)
2012-02-12 10:22 ` Simon Wright
2012-02-13 9:21 ` Yannick Duchêne (Hibou57)
2012-02-12 19:53 ` J-P. Rosen
2012-02-12 21:19 ` Yannick Duchêne (Hibou57)
2012-02-13 8:53 ` Dmitry A. Kazakov
2012-02-13 9:12 ` Yannick Duchêne (Hibou57)
2012-02-13 11:03 ` Dmitry A. Kazakov
2012-02-13 11:57 ` Yannick Duchêne (Hibou57)
2012-02-13 12:30 ` Yannick Duchêne (Hibou57)
2012-02-13 13:07 ` Dmitry A. Kazakov
2012-02-13 14:01 ` Yannick Duchêne (Hibou57)
2012-02-13 14:59 ` Dmitry A. Kazakov
2012-02-13 15:05 ` Yannick Duchêne (Hibou57)
2012-02-13 15:23 ` Dmitry A. Kazakov
2012-02-14 21:02 ` Yannick Duchêne (Hibou57)
2012-02-13 13:01 ` Dmitry A. Kazakov
2012-02-13 13:04 ` Yannick Duchêne (Hibou57)
2012-02-13 13:19 ` Dmitry A. Kazakov
2012-02-13 14:20 ` Yannick Duchêne (Hibou57)
2012-02-13 15:11 ` Dmitry A. Kazakov
2012-02-13 16:24 ` Yannick Duchêne (Hibou57)
2012-02-13 17:19 ` Dmitry A. Kazakov
2012-02-13 18:10 ` Yannick Duchêne (Hibou57)
2012-02-13 21:02 ` Dmitry A. Kazakov
2012-02-14 9:08 ` Yannick Duchêne (Hibou57) [this message]
2012-02-14 13:33 ` Dmitry A. Kazakov
2012-02-14 14:40 ` Yannick Duchêne (Hibou57)
2012-02-14 15:26 ` Dmitry A. Kazakov
2012-02-13 10:45 ` Georg Bauhaus
2012-02-13 10:59 ` Yannick Duchêne (Hibou57)
2012-02-14 10:18 ` Yannick Duchêne (Hibou57)
2012-02-14 11:51 ` Yannick Duchêne (Hibou57)
2012-02-14 22:21 ` Manuel Collado
2012-02-15 4:09 ` Simon Wright
2012-02-15 6:13 ` Niklas Holsti
2012-02-15 11:26 ` Yannick Duchêne (Hibou57)
2012-02-15 11:39 ` Georg Bauhaus
2012-02-15 11:47 ` Georg Bauhaus
2012-02-15 6:30 ` J-P. Rosen
2012-02-15 8:36 ` Simon Wright
2012-02-15 22:56 ` Robert A Duff
2012-02-15 11:27 ` Yannick Duchêne (Hibou57)
2012-02-15 11:43 ` Georg Bauhaus
2012-02-15 12:33 ` Georg Bauhaus
2012-02-15 12:55 ` Yannick Duchêne (Hibou57)
2012-02-15 17:30 ` Georg Bauhaus
2012-02-09 22:33 ` Simon Wright
2012-02-09 22:35 ` J-P. Rosen
2012-02-10 14:38 ` Yannick Duchêne (Hibou57)
2012-02-10 9:47 ` Mart van de Wege
2012-02-10 14:24 ` Yannick Duchêne (Hibou57)
2012-02-13 3:02 ` BrianG
2012-02-10 12:19 ` Brian Drummond
2012-02-10 14:22 ` Yannick Duchêne (Hibou57)
2012-02-10 19:16 ` Jeffrey Carter
2012-02-11 16:31 ` Martin Dowie
2012-02-16 17:44 ` Convention for naming of anything Yannick Duchêne (Hibou57)
2012-02-17 19:46 ` Yannick Duchêne (Hibou57)
2012-02-17 21:53 ` Manuel Collado
2012-02-17 22:12 ` Yannick Duchêne (Hibou57)
2012-02-17 23:52 ` Adam Beneschan
2012-02-18 0:24 ` Yannick Duchêne (Hibou57)
2012-02-18 0:50 ` Yannick Duchêne (Hibou57)
2012-02-18 22:53 ` BrianG
2012-02-19 11:16 ` Simon Wright
2012-03-06 0:36 ` Randy Brukardt
2012-02-18 11:32 ` Georg Bauhaus
2012-02-18 13:02 ` Yannick Duchêne (Hibou57)
2012-02-19 18:07 ` Phil Clayton
2012-02-19 21:53 ` Yannick Duchêne (Hibou57)
2012-02-20 0:21 ` Phil Clayton
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox