Re: OO's best feature survey results
From: Topmind (topmind_at_technologist.com)
Date: 10/30/03
- Next message: JXStern: "Re: OO's best feature survey results"
- Previous message: Shayne Wissler: "Re: How to refactor duplicated code without using helper classes?"
- In reply to: Alfredo Novoa: "Re: OO's best feature survey results"
- Next in thread: Alfredo Novoa: "Re: OO's best feature survey results"
- Reply: Alfredo Novoa: "Re: OO's best feature survey results"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Oct 2003 14:38:46 -0800
> > >
> > > > 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
> ...
That could simply be a short-cut for:
if isEqual(a, '1') then ....
In fact, I often make routines like that in web
programming to strip away leading and trailing
white spaces and make it ignore capitalization
for the compare. To the interpreter, it is only
a function call. It may have no concept of
"Boolean" built in.
>
> a = '1' returns a boolean value.
>
> How would you solve this?
It returns whatever the heck isEqual() wants to
return. To the interpreter, it is a function that
takes strings as a parameter and returns
strings. It is blind to human purpose or
intention.
>
> > 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
Again, assume that "+" is just a shortcut for an
Add() function. For the sake of argument, assume
that Add is not a built-in function.
c = add(a, b)
>
> This language is still typed, but I would like to detect the error in
> compilation time.
What Add() or isEqual() does is up to the implementor(s).
>
> > "Type"
> > is something very temporial in this approach.
>
> No, types are immutable and eternal, but variables may hold values of
> many types.
Didn't Universe just say that types are, or are often situational?
You two should get on the same page, or perhaps agree that
"type" is a psychological viewpoint and not a universal
truth.
>
> > 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.
Declared by the human, not by the interpreter. Again,
the interpreter is blind to human intent. It only processes
strings as the programmer tells it. And, one can write
their own Add() function using just strings. (It may not
be the most efficient approach CPU-wise, but that is
an internal implementation issue.)
>
> How do you solve this?
>
> if '10' > '9' then ...
See above.
>
> > 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.
"Types" are too artificial IMO for many things, perhaps most.
>
> > 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).
I don't know that entity == type. If so, why have a separate
term "entity"?
>
> Without types the relational model can not exist.
I disagree. True, the "Oracle way" and its clones may involve typed
columns, but I don't see anywhere where relational theory
demands types anymore than a procedural language does.
>
> 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.
Why not call them constraints instead of types?
Constraints can be mixed and matched also so that
they do not always form a clean tree. In otherwords,
a "set of constraints".
This is turning into a definition issue. I don't question
that everything can be viewed as types IF one wants to,
as described in a reply to Universe. (I had a typo there
where I said "is-a-type" instead of "is-a-table", BTW.)
It is the utility of such that I question.
>
>
> Alfredo
-T-
- Next message: JXStern: "Re: OO's best feature survey results"
- Previous message: Shayne Wissler: "Re: How to refactor duplicated code without using helper classes?"
- In reply to: Alfredo Novoa: "Re: OO's best feature survey results"
- Next in thread: Alfredo Novoa: "Re: OO's best feature survey results"
- Reply: Alfredo Novoa: "Re: OO's best feature survey results"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|