Skip navigation
Currently Being Moderated

Lingo vs Javascript

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?



 
Replies
  • Currently Being Moderated
    Jul 22, 2008 8:53 AM   in reply to Newsgroup_User
    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.
     
    |
    Mark as:
  • Currently Being Moderated
    Jul 22, 2008 8:48 PM   in reply to Newsgroup_User
    I prefer Lingo over js in Director..
    1. Examples - a lot on the web.
    2. Easier to learn - from the examples.
    3. Performance - maybe its the same - It will depend on your code - learn from the examples.
    4. Support/troubleshooting - almost all seniors in Director using Lingo.
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 10, 2008 5:51 PM   in reply to Newsgroup_User
    I started to dabble in Javascript because it does have some useful functions that are hard to replicate in Lingo but I got scared off when a try-catch bug crapped out my data.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)