Re: OO's best feature survey results

From: Alfredo Novoa (alfredo_at_ncs.es)
Date: 10/30/03


Date: 30 Oct 2003 02:55:47 -0800

topmind@technologist.com (Topmind) wrote in message news:<4e705869.0310292318.56212c8f@posting.google.com>...
> >
> > > I will agree that people tend to think in "types"
> >
> > Types are an essential concept in modern programming.
>
> I don't agree with that. I could easily live with a programming
> language where everything is a string

You always need the boolean type.

if a = '1' then
  ...

a = '1' returns a boolean value.

How would you solve this?

> many scripting/dynamic languages actually do. An "add" operation
> will "convert", or at least treat the operands as if
> they were numbers during the operation.

With that kind of variables you usually can check the type of the
stored value, and the interpreter checks the types before doing the
operations. Eg

a := '0';
b := '#@#@';

c := a + b; // invalid conversion error

This language is still typed, but I would like to detect the error in
compilation time.

> "Type"
> is something very temporial in this approach.

No, types are immutable and eternal, but variables may hold values of
many types.

> You call them "numbers" during the operation, but
> they are just strings and the result is just string.

String is the representation, buy they behave like numbers and they
are numbers.

How do you solve this?

if '10' > '9' then ...

> They are a part of a lot of programming languages, but not
> a necessity.

And programming languages are not a necessity either, but they make
our lifes more comfortable.

> Besides, typing working on a small scale does not necessarily
> translate to a larger scale. Extrapolating "integer" ADT
> type concepts to business entities is a big leap.

Business entities map very well to relation typed variables (AKA
tables).

Without types the relational model can not exist.

I agree with you about that biz entities map very bad to scalar typed
variables.

> > Types are constant. This is not a type, it is a derived variable.
>
> Constant?

Of course. The integer type is the same always.

> Does that mean that dynamical languages don't
> really have types?

If you change a "type" what you have is another type.

Eg:

type A is integer constraint A > 0 and A < 100;
drop type A;
type A is integer constraint A > 0 and A < 10;

You call A to two different types.

Alfredo



Relevant Pages

  • Re: PL/I string representations (was Re: To Richard Heathfield: enoughs enough)
    ... > I apologize in advance to the expert PL/I programmers if this is all ... dedicated to string processing with PL/I. ... > as well as appendices on "Revised Report on the Algorithmic Language ... Also NPL (New Programming Language) was an early name ...
    (comp.programming)
  • Re: Why C Is Not My Favourite Programming Language
    ... If you decide afterall that C programming is just not your thing you ... > C has no string type. ... > compiler take care of the rest. ... Why does any normal language ...
    (comp.lang.c)
  • Re: A note on personal corruption as a result of using C
    ... impossible to write effective string validation routines by definition ... programming becomes an engineering: ... programming language. ...
    (comp.programming)
  • Re: Unicode string libraries
    ... The C string representation suffers from two problems: chars are tied to bytes and the use of a nul terminator with pointer to head scheme means that string length has to be computed by passing over the data. ... What matters is the tradeoff you want between functionality (what operations the language supports), execution speed, and ease of programming. ... If you are going to support non-European languages then it is quite difficult to have an easy programming interface. ...
    (comp.programming)
  • Re: CStr() vs. .ToString()
    ... of object BASED programming and not consistent with the object ORIENTED ... yes there is a difference between a method and a language ... As for CStr() in particular, I've said over and over that this is my ... if you need to process Nothing differently than a string, ...
    (microsoft.public.dotnet.languages.vb)