Currently Being Moderated
Jul 22, 2008 6:17 AM
Just wondering how many of you are actually using javascript
and/or mixed
language projects.
And has anyone actually switched to using js since it was
introduced?
Sure, js's syntax is common, and it was supposed to make
director more
attractive for new users, and it is stricter, resulting to
tidier code, plus
supports several neat stuff, and it's item accessing is zero
based. All good
so far. However, there are some handy lingo-specific concepts
that are not
js compatible. Most important perhaps, the ability to pass
1-2 arguments to
properties. In lingo, when you use string.char[1], it is
interpreted as:
a. attempt to get property #char, passing 1 as argument to
the property
request.
If property arguments are supported by the object, and if '1'
is valid for
.char, then return the result. Otherwise:
b. return the property .char, and try to perform a getAt(1).
With js, there is no first step - it is always two commands-
where with
lingo it is either one or two.
Js is stricter, lingo is (or at least tries to be) smarter
and faster.
But in programming, 'smarter' also means more checks, so
smarter code could
also be slower code. In the above example, if step a
succeeds, then lingo is
faster, otherwise it is slower. Btw, since js doesn't support
passing
arguments to property requests, director(native) or third
party(xtras) code
that expect such arguments will fail ( which is the js
equivalent for "ab
cd".word[2] ? )
Anyways, back to the original question. What is it for you?
JS or Lingo?