From: Shark8 <onewingedshark@gmail.com>
Subject: Re: Arbitrary Sandbox
Date: Thu, 9 Feb 2012 20:11:31 -0800 (PST)
Date: 2012-02-09T20:11:31-08:00 [thread overview]
Message-ID: <8cc41562-9d61-4e23-b288-7b96837075b0@t2g2000yqk.googlegroups.com> (raw)
In-Reply-To: ba9ac809-fc4a-4361-ae58-5b493f7f7d8c@t24g2000yqj.googlegroups.com
On Feb 9, 8:47 pm, Tez <mont...@gmail.com> wrote:
>
>>> So, how would you sell an executive on or against Ada (or C#) [for this
>> particular use]*?
>
> I definitely want to say Ada.
Then say Ada; give him your sale's-pitch!
* -- I'm omitting this; because I can.
But, seriously, there's several things I'd say to try to sell it,
although
I'm not by any means an Ada expert.
1 -- Maintainability
Ada is extremely maintainable, its syntax lends itself more to
"self-
documenting" code than anything I've seen from the curly-brace
languages.
('Self-documenting' is a myth, BTW; comments still rule in that
regard.)
I've heard people say that they've plopped 20-year-old Ada code into
a
compiler from a completely different vendor, had clean-compiles and
were
up-and-running with no changes (note, this changes when compiler-
specific
features, like GNAT's 'IMG attribute, are used). This indicates, to
me,
that the well-defined nature, and the rejection of the non-
conforming
implementations, give the source-code more stability** precisely
because
the language is standardized. (**Stability in that the source does
not
change meaning dependent upon which compiler is being used.)
2 -- Compile- (and run-) Time Error-Checking
I've been using PHP for about the past year; and I _REALLY_ miss
this.
I can't count the number of times that I've had to go back and fix
some
code that someone broke because they changed the return-type format;
yes,
this particular problem won't crop up in C# as it has return-types
attached
to its functions, but consider: the earlier a bug is caught the
cheaper it
is to fix.
And then there's array indexing; given that Anders Hejlsberg (of
Turbo
Pascal and Delphi) was recruited by Microsoft and given the lead
position
I would be VERY surprised if the index-checking wasn't addressed in
C#,
but C# *STILL* forces you to use zero-based indexing, which is a
stupid
limitation that only gets in one's way. {In order to, say, match a
column
number from a spreadsheet with it's associated array-index,
especially
when the spreadsheet's column-numbers are one-based and someone's
talking
about "column 3" after it's been read-in it becomes easy for the off-
by-1
error to creep in.}
Subtyping is another feature that is, quite frankly, AMAZING that
other
languages haven't adopted. Being able to exclude values from a
problem-
set means that you can write your code in such a way as to cater to
the
"general case" and rely on the subtype-exclusion to weed-out the
problematic values; case-in-point, Null-exclusion if you have a
procedure
whose inner-processes are checking for Null all the time you can
simply
re-write it as though you know that the pointers aren't Null and
then
ensure that the subtype excludes null -- an attempt to assign the
bad
value will be caught by the compiler, if it's static, or raise the
CONSTRAINT_ERROR exception if it is dynamic.
E.G Function X( Input : SOME_ACCESS ) Return SOME_TYPE is
[...] checks that Input is not null [...] end X;
would become
Subtype NN_SOME_ACCESS is Not Null SOME_ACCESS;
Function X( Input : NN_SOME_ACCESS ) Return SOME_TYPE is
[...] just use Input as if it weren't null [...] end X;
3 -- Structuring & Reliability (Packages)
This goes hand-in-hand with maintainability; but the ability to have
a
single well-defined specification and implementation separation is
something else that I miss greatly when I'm forced to do PHP; the
reason
one can't "just program" in PHP is because you have to go to the
function
itself and determine things like what type/format the parameters are
expected to be in, and the return type (or even if there is one), or
if
any of those change due to a parameter or some magic global
variable. Now
I don't expect C# to be that bad, but in my experience C & C++ are
_HORRID_ when it comes to maintaining an separation of spec and
body.
Just like the big boon of being able to concern yourself with "just
the
parameters and the procedure" was a big leap forward in making
provable
and reliable code in the industry, packages allow you to do the same
but
in a scalable manner. Furthermore, the specification/implementation
divide means that you can sit down and *design* the system rather
than
the current (far more bug-prone) "just grow the system" attitude
that
seems more prevalent where I work. (Yes, it's website-design, and
yes
that attitude is *why* we use PHP... but as someone once said, it
doesn't
matter if you have a method for multiplying that is a hundred times
faster but gives the wrong answer [sometimes], it's not a hundred
times
faster, it's wrong.)
As for the other interesting things in Ada, like concurrency, I'm not
an
expert nor do I know if they would be applicable to your project. Yes,
you
can argue that all of my points are moot "with best practices" or
"correct
software engineering" and that "careful programming" can avoid them;
but
let me counter with this analogy: a "careful driver" who is "correct
in
all aspects regarding traffic statutes" and knows his car intimately
is
the most dangerous driver to be around when he's tired (sleep
deprived)
and under pressure.
next prev parent reply other threads:[~2012-02-10 4:11 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-09 23:47 Arbitrary Sandbox Rob Shea
2012-02-10 0:10 ` Rob Shea
2012-02-10 2:01 ` Tez
2012-02-10 2:21 ` Rob Shea
2012-02-10 2:47 ` Tez
2012-02-10 4:11 ` Shark8 [this message]
2012-02-13 2:23 ` BrianG
2012-02-10 4:17 ` tmoran
2012-02-10 4:41 ` Rob Shea
2012-02-10 6:15 ` Jeffrey Carter
2012-02-10 6:18 ` Rob Shea
2012-02-10 19:39 ` Jeffrey Carter
2012-02-10 6:19 ` Thomas Løcke
2012-02-10 9:32 ` Rob Shea
2012-02-10 10:09 ` Thomas Løcke
2012-02-10 11:39 ` Ludovic Brenta
2012-02-10 12:05 ` Brian Drummond
2012-02-11 10:32 ` Maciej Sobczak
2012-02-11 11:39 ` Dmitry A. Kazakov
2012-02-11 21:15 ` Maciej Sobczak
2012-02-11 21:38 ` Dmitry A. Kazakov
2012-02-11 23:05 ` Rob Shea
2012-02-13 2:10 ` Tez
2012-02-13 9:08 ` Yannick Duchêne (Hibou57)
2012-02-13 16:28 ` Pascal Obry
2012-02-10 9:47 ` Georg Bauhaus
2012-02-10 11:45 ` Erich
2012-02-10 11:48 ` Ludovic Brenta
2012-02-11 6:11 ` Rob Shea
2012-02-12 2:10 ` Randy Brukardt
2012-02-12 8:40 ` björn lundin
2012-02-14 0:26 ` Shark8
2012-02-15 21:07 ` Randy Brukardt
2012-02-15 22:10 ` Yannick Duchêne (Hibou57)
2012-02-18 4:47 ` Shark8
2012-02-18 8:26 ` Dmitry A. Kazakov
2012-02-18 10:45 ` Yannick Duchêne (Hibou57)
2012-02-18 11:31 ` Dmitry A. Kazakov
2012-02-18 11:58 ` Niklas Holsti
2012-02-18 12:57 ` Yannick Duchêne (Hibou57)
2012-02-18 18:55 ` Robert A Duff
2012-02-18 19:24 ` Niklas Holsti
2012-02-18 20:06 ` tmoran
2012-02-18 21:53 ` Niklas Holsti
2012-02-18 22:58 ` Robert A Duff
2012-02-19 0:47 ` tmoran
2012-02-20 23:39 ` Robert A Duff
2012-02-21 3:29 ` tmoran
2012-02-21 17:17 ` tmoran
2012-02-21 21:03 ` Robert A Duff
2012-03-06 0:52 ` Randy Brukardt
2012-02-20 22:52 ` Adam Beneschan
2012-02-18 23:03 ` BrianG
2012-02-19 8:45 ` Dmitry A. Kazakov
2012-02-20 23:27 ` Robert A Duff
2012-02-21 8:36 ` Dmitry A. Kazakov
2012-02-21 9:59 ` Simon Wright
2012-02-21 10:59 ` Dmitry A. Kazakov
2012-02-21 17:25 ` Robert A Duff
2012-02-21 18:53 ` Dmitry A. Kazakov
2012-02-21 21:19 ` Robert A Duff
2012-02-22 8:24 ` Dmitry A. Kazakov
2012-02-21 21:25 ` Yannick Duchêne (Hibou57)
2012-02-22 8:26 ` Dmitry A. Kazakov
2012-02-21 8:47 ` Georg Bauhaus
2012-02-21 16:58 ` Robert A Duff
2012-03-06 1:06 ` Randy Brukardt
2012-03-07 5:43 ` Yannick Duchêne (Hibou57)
2012-03-07 13:05 ` Robert A Duff
2012-03-07 19:32 ` tmoran
2012-03-07 20:24 ` Dmitry A. Kazakov
2012-03-08 0:50 ` Robert A Duff
2012-03-08 1:50 ` tmoran
2012-03-08 11:01 ` Brian Drummond
2012-03-08 1:01 ` Shark8
2012-03-08 1:33 ` Randy Brukardt
2012-02-20 20:52 ` Tero Koskinen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox