SamiKalliomaki / eppabasic

A new web based basic language inspired by CoolBasic.
Other
11 stars 3 forks source link

Attempting to set a variable to DrawScreen() results in mysterious error messages #53

Open expositionrabbit opened 9 years ago

expositionrabbit commented 9 years ago

In this piece of code

Dim x = DrawScreen()
Print(x)
x = 5

the first line displays no error messages (it should, as DrawScreen doesn't return a value). The following line displays

Funktiota 'Print' ei ole määritelty

which is quite confusing for innoncent children. The third line displays

Ei voi tehdä tyyppimuunnosta tyypistä 'Number' tyyppiin 'undefined'

which also confuses innoncent children. The console displays vaguely sensible error messages, but innoncent children do not know how to open it.

fergusq commented 9 years ago

These errors raise from the fact that there is no "Void" type or whatever it is called in basic languages. The return type of DrawScreen & Co. is undefined, so x has also an undefined type.

The error messages are the worst part of the current version of the IDE. It would much more helpful for small, innocent people to introduce verbose and elaborate texts that support the learning of the young programmer.

An examples of such profound messages would be the followings:

Muuttujaa x ei voida luoda, sillä DrawScreen ei ole funktio vaan aliohjelma. Aliohjelmat eivät palauta arvoa jota laittaa muuttujaan. Oletko varma, että kutsut oikeaa funktiota?

and

Funktiota Print ei toimi annetuilla arvoilla. Se tarvitsee yhden arvon, eikä sille saa antaa enempää arvoja. Oletko varma, ettet halua käyttää &-operaattoria yhdistääksesi annetut arvot ennen, kuin kutsut Print-funktiota?