PDA

View Full Version : What!!!!! You don't have to declare var's


MonsterJoe
10-13-2004, 11:56 PM
Newbie alert!!

I'm completely new to Laszlo and JavaScript but have
many years of experience in Java, C/C++, Delphi etc.

I've been through most of the documentation and I'm
begining to understand the overall picture. But one
thing that strikes me is that in JavaScript you don't
have to declare variables. I'm shocked. That simply
can not be true. Hasn't the inventor of JavaScript
learned anything from the past.

By not requiring to declare variables, you won't
catch all the spelling errors we humans are famous
for.

Please add an option to require explicitly declaring
variables. Even the Visual Basic guys have found
out that this is a good idea. They have their
"option explicit" statement.

metasarah
10-14-2004, 08:51 AM
I added a feature request to our internal bug database (which we plan to make externally accessible via openlaszlo.org). So far we've been reluctant to diverge from standard Javscript, but I agree that its nice to have the compiler catch typos.

We have mitigated this somewhat in that classes with their attributes and methods are declared in XML and the debugger provides run-time warnings. If you are having trouble isolating a bug, run your app with ?debug=true and you might see some helpful warnings that can help you find the problem.

MonsterJoe
10-14-2004, 10:01 PM
Thanks!

When the bug database becomes public available I'll definitiely vote for this feature.