From: alchemist on
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?



From: Mike Blaustein on
I see very few incentives to move from Lingo to JS. If you don't know
Lingo, and you do know JS (or ActionScript) then JS can be a more
approachable way to get into Director. But there is no payoff in
someone who knows Lingo moving into JS.

I do use a few things that JS syntax enables that is nonexistent in
Lingo, like RegEx and some string handling capabilities (like
toLower()), but in general, I will write a small wrapper handler in JS
around the function and then call it from Lingo.

But then I'm old school and still use verbose syntax in many cases.
From: Ex Malterra on
I much prefer JavaScript. I never liked Lingo syntax, probably because the
first scripting I ever learned was JavaScript. JS is the reason I upgraded to
MX 2004. Having mostly used C++, C#, Java, JavaScript and ActionScript 2.0 I'm
simply more used to their syntax. Sure, some things require just a little more
to do in JS vice Lingo... like symbol("someSymbol") instead of #someSymbol, but
for me personally it's more than worth it. And I gotta tell ya, try/catch is
great! The error info thrown isn't always especially useful, heck it's usually
not useful at all for that matter, but you generally know what might go wrong
in your code at those points anyway.

No offense meant to the fans of Lingo. I don't think it's crappy or anything;
I just prefer JS.

From: alchemist on
Thanks Mike - I'd guessed so, for you and most elder list members.

Actually, and besides general interest, my concern is how crucial is for an
Xtra to support js. You see, there are some property accessing methods that
can enhance lingo scripting greatly, but simply won't work with js.

"Mike Blaustein" <mblaustein(a)gmail.com> wrote in message
news:g64nfq$55l$1(a)forums.macromedia.com...
>I see very few incentives to move from Lingo to JS. If you don't know
>Lingo, and you do know JS (or ActionScript) then JS can be a more
>approachable way to get into Director. But there is no payoff in someone
>who knows Lingo moving into JS.
>
> I do use a few things that JS syntax enables that is nonexistent in Lingo,
> like RegEx and some string handling capabilities (like toLower()), but in
> general, I will write a small wrapper handler in JS around the function
> and then call it from Lingo.
>
> But then I'm old school and still use verbose syntax in many cases.


From: alchemist on
> No offense meant to the fans of Lingo. I don't think it's crappy or
> anything;
> I just prefer JS.

None taken. (how could?).. Though personally, I'm spending more time coding
c (js-like syntax) than lingo, I still prefer lingo when it comes to
director. And that's because of the generally more compact code for command
line tests / small scripts. For bigger projects perhaps using js is better.
But, though very familiar with both director and js syntax, actually using
js with director still requires getting accustomed to... Not to mention
referencing the help files...


"Ex Malterra" <webforumsuser(a)macromedia.com> wrote in message
news:g64vp3$e49$1(a)forums.macromedia.com...
>I much prefer JavaScript. I never liked Lingo syntax, probably because the
> first scripting I ever learned was JavaScript. JS is the reason I upgraded
> to
> MX 2004. Having mostly used C++, C#, Java, JavaScript and ActionScript 2.0
> I'm
> simply more used to their syntax. Sure, some things require just a little
> more
> to do in JS vice Lingo... like symbol("someSymbol") instead of
> #someSymbol, but
> for me personally it's more than worth it. And I gotta tell ya, try/catch
> is
> great! The error info thrown isn't always especially useful, heck it's
> usually
> not useful at all for that matter, but you generally know what might go
> wrong
> in your code at those points anyway.
>
> No offense meant to the fans of Lingo. I don't think it's crappy or
> anything;
> I just prefer JS.
>