Re: Arithmetic overflow checking



Patricia Shanahan wrote:
On 7/14/2011 10:14 PM, MikeP wrote:
Patricia Shanahan wrote:
On 7/6/2011 8:35 AM, rop rop wrote:
Hi,

If I want to have arithmetic-overflow checking in all parts of an
application,
what is the most practical, simple, efficient way to achieve this?

Write the application in Ada.

Patricia

But C# is very Java-like and has "checked" and also the
compiler-level equivalent, so C# would be the better alternative.
(And yes, I do know you were just kidding about Ada).



No, I was not really joking, though I did not attempt to find all the
languages that would meet the stated requirement.

Don't look now, but if you weren't joking, then you recommended Ada to a
Java programmer! Oh my.


I'm very strongly of the opinion different languages should provide
different features, making different trade-offs, and programmers
should pick the language for a job based on its requirements and
those features.

You have to admit, it's quite a chasm between Java/C# and Ada.

The alternative a lot of programmers follow seems to be to pick one
language,

I do/did that. (C++ is my poison).

ignore all the others,

I have regularly looked at other languages and used them in minor ways
for evaluation.

and then complain when there is a
mismatch between that language's features and their current
requirements.

In another post, I said that I think that today (like in right now) the
awareness of the overflow issue (language support) has achieved critical
mass. Combine that with the alternatives that are available and more yet
to come, a language cannot afford to go the path of, say, C anymore for
it will lose relevance much more quickly. It's not complaining. It's
customer feedback (companies BEG their customers for such!). Companies
that don't recognize their customers needs and change with the times, go
out of business. Java is not C and can't afford to stagnate like C did
(OK, C++ gave it a "reconditioning"), or it won't last.


I have no problem with pushing minor changes and additional features
within the general framework of a language, but if the basic framework
is not a good match for a job, the solution is to pick a language that
is more suitable.

C# will fit in a lot of places where Java does (or so I assume given what
I know about them, as I'm don't use either language other than for
evaluation and case study). Pushing away programmers to other languages
instead of evolving the language according to the expectations (i.e.,
what programmers have come to expect to be standard feature in a given
class of language) is surely a path to obsolescence.


.



Relevant Pages

  • Re: Overloading parentheses and type expectations
    ... Unlike the way has many uses in Ada. ... More worthy of being included in the language? ... When computers had less characters for syntax, and programmers ... brain be better at detecting the error on line 3 and not on ...
    (comp.lang.ada)
  • Re: Fun with C
    ... arguments following the rules of the C language definition. ... programmers still got clobbered by this language-legal insanity. ... Ada is Ada and C is C. ... As it is also stupid to say that C sucks. ...
    (comp.lang.ada)
  • Re: How C is better then C++
    ... Each language has its strengths and weaknesses, and for each of those languages there are some contexts where it's advantages make it the superior one; and there are additional context where neither language is appropriate ... While most C++ programmers use only a limited subset of C++ features that may, in itself, be no more complicated than C, anyone who intends to do maintenance work on C++ code written by someone else will have to be at least familiar with every feature that the other person might choose to use. ... However, the designers of C++ were not idiots; most of the additional features of C++ were designed with the explicit intent of making it easier to avoid making particular types of errors, when those features are used correctly. ...
    (comp.lang.c.moderated)
  • Re: A hole in Ada type safety
    ... some random component (as is currently the case in Ada). ... Remember that no programming language can ... sloppy or careless programmers ... allowed to use reference counting, ...
    (comp.lang.ada)
  • Re: Ada 2005?
    ... Ada already has that. ... There is no way to restrict dynamic dispatch to make overloading of it. ... > language simply does not have the proper machinery to support it. ... wouldn't allow programmers to play with fire. ...
    (comp.lang.ada)