From: Robert A Duff on
"Yannick Duch�ne (Hibou57)" <yannick_duchene(a)yahoo.fr> writes:

> So (especially if you're a teacher), ...

(I'm not a teacher, although I've done some teaching of
programming. I like to think of myself as a language designer,
and part of my job as a language designer is to make
the language easy to learn.)

>...just provide them a package with
> useful stuffs of the like.

Yes, that can work. But it can also be confusing: the student
wonders why Simple_IO is not available when they move to a
different environment.

>...This is how I first switched from a Pascal
> dialect to Ada 95 : I could understand somethings, found it was not so
> much easy at first glance, but still could create a package with
> functionalities inspired from what's provided with typical Pascal
> program ; then later just dropped this.
>
> The pending question may be now : when should students or beginners be
> able to understand the concept of using an �external� component ?
> Perhaps they should not start typing anything prior to that, and should
> start learning, at the very beginning, listening someone recounting
> them nice and happy stories involving basic abstraction principles :)

Interesting question. I think beginners need to learn a few
basic things (like how to use an 'if' statement) before
getting into "abstraction principles".

Dijkstra took it to an extreme: students have to spend a year
doing mathematical proofs about programs, before they're
allowed to compile or run their programs. I don't recommend that. ;-)

- Bob
From: Randy Brukardt on
"Robert A Duff" <bobduff(a)shell01.TheWorld.com> wrote in message
news:wccd3x7lww8.fsf(a)shell01.TheWorld.com...
> "Randy Brukardt" <randy(a)rrsoftware.com> writes:
>
>> I actually don't buy the need for the Assert pragma in the first place:
>> such
>> checks are rarely expensive and thus should simply be part of the code
>> always.
>
> If they're not expensive, then you're not using it enough. ;-)

If they're expensive, they have to be programmed and debugged like any other
code. That causes extra work, which is the exact opposite of what an agile
programmer would do. (And I've been an agile programmer long before anybody
defined the technique or made lots of money selling seminars about it.)

> Also, the other advantage of pragma Assert over an Assert
> procedure is that you can put the pragma in declarative parts
> and package specs.

True, although I have sometimes used functions and dummy constants for that
purpose. (They'd have to be declared "volatile" in order to be portable, I
guess; it doesn't matter for Janus/Ada since we never eliminate objects or
their last write.)

>>... (And the ones that are expensive need a lot more control than simply
>> on or off: Janus/Ada uses trace switches that can be controlled on a
>> per-unit basis.)
>
> Sorry, I don't buy that sort of argument in general: If you want to
> do (simple) X, you probably also want (complicated) Y, so we're
> not going to allow X.

No, that's not my argument at all. "Simple X" in this case is useless or
even harmful. You *have to* do compilacated Y, otherwise you are are only
using the seat belts in the garage. It almost never makes sense to turn
these things off, so why even have the capability? It's like giving everyone
a shotgun but telling them never to use it.

Anyway, I realize that you have said that you don't believe in the "seat
belt" analogy. As such, there is really no point in arguing with you on this
topic: we don't even agree on the arena of discourse.

Randy.




From: Randy Brukardt on
"Jeffrey R. Carter" <spam.jrcarter.not(a)spam.acm.org> wrote in message
news:hs1t6h$kj2$1(a)tornado.tornevall.net...
> Yannick Duch�ne (Hibou57) wrote:
>> I could not tell anything about this, as I've forgotten too much about
>> C++ (and especially concerning area).
>
> You can never forget too much about C++.

If I actually used a signature line, I think I'd be using that one!!

Randy.

You can never forget too much about C++. - Jeffrey Carter



From: Randy Brukardt on
"Robert A Duff" <bobduff(a)shell01.TheWorld.com> wrote in message
news:wcctyqjh2rw.fsf(a)shell01.TheWorld.com...
....
> I disagree. Certainly removing the extra blank would not introduce
> bloat. And in fact, giving 'Image the exact same functionality
> as Integer_Text_IO would _simplify_ the language, by making
> it more uniform.

Humm, I could see giving 'Image more functionality, but the entrety of
Integer_Text_IO would be way too much. The formatter for Integer Put is
*huge* (about 300 lines in Janus/Ada). I could see adding a Width parameter,
but not the base stuff. Keep in mind that the code for 'Image is part of
every program (it's written in assembler in Janus/Ada to keep it as small as
possible); I would not want to bloat up every program that much.

Randy.


From: Randy Brukardt on
"Robert A Duff" <bobduff(a)shell01.TheWorld.com> wrote in message
news:wccpr17h2od.fsf(a)shell01.TheWorld.com...
> "Yannick Duch�ne (Hibou57)" <yannick_duchene(a)yahoo.fr> writes:
>
>> Le Fri, 07 May 2010 15:37:55 +0200, Georg Bauhaus
>> <rm.dash-bauhaus(a)futureapps.de> a �crit:
>>> Put (Num_Errors);
>>> Put_Line (" errors detected.");
>> Here is, that's also my preferred way to do to output execution logs.
>>
>> That's not so much annoying, while this is a
>> written-once-used-many-times.
>
> Well, that "Put (Num_Errors);" is hiding something. You have to
> instantiate Text_IO.Integer_IO for all the integer types you
> need to output. That's annoying.

It doesn't work very well, either, if you are outputting to a message box or
to a log manager: in both cases the entire message string has to be passed
at once. (That's the case in virtually all of my newer programs.) Not many
real programs do much output to Standard Output.

Randy.