1. Re: Eu's poor design(Irv)

--- jbrown105 at speedymail.org wrote:

> > In most "high level" languages, after you define a
> > variable 
> > as a certain type, you can just "print" that
> variable
> > without concern about the type. Not with Eu. You, 
> > the programmer, have to choose the correct print
> > function from a number of supplied functions
> > to properly display each type of variable. This is
> a
> > job 
> > for the computer language, not the programmer. 
> > For examples, see almost any language other than 
> > asm or C. 
> 
> You can do that in Eu.
> 
> print(1, x)
> 
> or even
> 
> ? x

Well, not exactly.
Given the following:
 integer x
 atom y
 sequence z

x = 23
y = 3.1415
z = "Hello"

Many languages will allow you to something like:
print(x,y,z) 
and it will come out looking like you would expect. 

But in Eu, not only can't you print several variables 
with one command, but you also must choose different 
print commands for each, if you want them to look like
what you are expecting:

print(1,z) -- {72,101,108,108,111} (not much of a
greeting, is it?

? z -- {72,101,108,108,111} (no improvement)

puts(1,x) -- ^W  (short for WTF?)

ok, I'll try print(1,x,y,z) -- nope, print takes only
2 args.

How about print(1,{x,y,z})
{23,3.1415,{72,101,108,108,111}}
Halfway there.

Maybe print(1,x & y & z)
{23,3.1415,72,101,108,108,111}
An array of 7 numbers?

Now I'm really confused, and I still don't see the 
stuff I put in there!

Of course, after a bit of experience, you learn that 
you should write:
print(1,x) print(1,y) puts(1,z)
or
printf(1,"%d %f %s",{x,y,z})

See how this would confuse a beginner?
Doesn't this make debugging harder if you 
don't know what type the data you're looking at is 
"supposed" to be? Or if you do know, but the data 
turns out to be something else. 

As you say, this is because Eu doesn't really have a 
string type.  

But "Hello" looks very much like a string, doesn't it?
Eu didn't fuss about that assignment, so it must be
ok,
and most people who have written even one ("Hello
World") program in any language other than machine
code naturally expect a programming language to know
about strings.

As I said, Euphoria is pretty good - mostly because of
its  clean, clear syntax (borrowed from Pascal, it
appears) but in many ways it could certainly be
better. 
What would it take, 1 extra byte to identify a string
as a string so Eu could handle strings gracefully?

Irv

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu