Re: checking if NUMERIC



On Sun, 21 Oct 2007 14:01:53 +1300 "Pete Dashwood"
<dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

:>"Binyamin Dissen" <postingid@xxxxxxxxxxxxxxxxxx> wrote in message
:>news:8jdkh39o3nfprmdit5jok7lpna84dkvqkl@xxxxxxxxxx
:>> On Sun, 21 Oct 2007 02:47:59 +1300 "Pete Dashwood"
:>> <dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

:>> :>1. The compiler controls what gets moved to fields.
:>> :>2. The compiler recognises types.
:>> :>3. Given a type (Class in COBOL) of "numeric" the compiler should ensure
:>> it
:>> :>actually IS numeric when you use it. If it is unable to do so, then
:>> there is
:>> :>little point in having such a numeric class in the language.

:>> :>Other languages which support types, check the types and do not allow
:>> :>invalid data in them. (hence the need for casting and explicit "convert"
:>> :>functions in languages like C#...)

:>> Obviously you have failed to learn the concept of records, where storage
:>> areas
:>> may contain different types of data depending on context.

:>Obviously? :-)

:>I'm sure you're right. It is probably amongst the many things I have failed
:>to learn over 40 years in IT.

:>(Makes you wonder how I make a living really, doesn't it? :-))

I have seen those in the field that make money despite lack of ability. As a
side point, I am not making that claim about you.

:>One of the things I HAVE learned, however, is to question the accepted
:>practice, and try to think about things from different perspectives.
:>Sometimes, this pays off; sometimes it doesn't.

:>If the only way to think about data was as record formats, Relational
:>Databases would be a bit pointless, but Messrs.Codd and Date were not
:>limited by the current perceived wisdom at the time they formulated the
:>Relational Model.

Sometimes data is best accessed relational, sometimes it is best accessed
hierarchical. Sometimes it is best accessed as elementary fields, sometimes it
is best as records. (Best includes space, speed, integrity, etc. - not all
applications run on a dedicated PC - most involve servers).

One point you seem to be missing is that COBOL is not the "best" language for
all applications and that to change it in the way you suggest, while perhaps
making it better for your needs, would make it much worse for other needs.

Perhaps COBOL compilers should instantiate the nanny/Dashwood option which
would generate code to validate numerics/alphabetics at each operation that
might affect such a field. The compiler would also need to warn if any
overlays or group moves had mismatched types. Some might find it useful. Most
would find it a pain.

You might wish to expand your repertory to other languages and use the one
that best fits the application.

--
Binyamin Dissen <bdissen@xxxxxxxxxxxxxxxxxx>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.
.



Relevant Pages

  • Compiler positions available for week ending January 13
    ... Scholarships for PhD study in Informatics@Edinburgh ... UK students ... Centre for Intelligent Systems and their Applications ... Probabilistic Approaches to Natural Language Generation ...
    (comp.compilers)
  • Re: Programmers unpaid overtime.
    ... whichever language the help is required in. ... > or trolls, like Richard, who have a following of other trolls. ... > Quite a lot of running applications are in VB-4 and are extended using ... > Goose, cudgel thy brains. ...
    (comp.programming)
  • Re: A tale of two laptops (was): Mirror, mirror on the wall, who is the most gabby of us all?
    ... ...Don't write applications programs... ... Machine language or, for the effete, Assembler language ... we had software which would read the code and gen flowcharts. ... Planners make up schedules, Managers ...
    (soc.culture.scottish)
  • Re: OO languages
    ... applications in an OO language? ... There are no *typical* time constraints nor resource ... If the application crashes, the user can ...
    (comp.arch.embedded)
  • Re: An Observation
    ... It is systems programming in support of a class of ... for applications. ... of attention to *human* communication. ... While TeX has largely replaced troff in scientific publishing, it's recognizably a member of the same family of markup languages. ...
    (comp.lang.forth)