9 Replies Latest reply on May 8, 2017 9:53 AM by Chardb

    Lingo vs Javascript

    Level 7
      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?



        • 1. Re: Lingo vs Javascript
          Level 7
          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.
          • 2. Re: Lingo vs Javascript
            Ex Malterra Level 1
            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.
            • 3. Re: Lingo vs Javascript
              Level 7
              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@gmail.com> wrote in message
              news:g64nfq$55l$1@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.


              • 4. Re: Lingo vs Javascript
                Level 7
                > 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@macromedia.com> wrote in message
                news:g64vp3$e49$1@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.
                >


                • 5. Re: Lingo vs Javascript
                  mziskandar Level 1
                  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.
                  • 6. Re: Lingo vs Javascript
                    Level 7
                    Good points, mziskandar.
                    > 2. Easier to learn
                    I doubt that many languages with similar functionality can claim to be
                    easier
                    than lingo. None that I know of, at least.

                    > 3. Performance
                    Director was built for lingo. Therefore, internally, even though for certain
                    functions js could settle with less arguments (since it won't use them all,
                    anyway) leading to faster execution speed, space for all arguments is
                    allocated, as required for lingo. That's the case with Xtras, so I'd bet it
                    is also the case with native objects.


                    "mziskandar" <mziskandar@yahoo.com> wrote in message
                    news:g669mq$rn6$1@forums.macromedia.com...
                    >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.
                    >
                    >




                    • 7. Re: Lingo vs Javascript
                      Level 7
                      I have been coding with Lingo since the mid 90s and would like to learn
                      more JavaScript, but just find it too difficult. I would like to do
                      more with Flash as well, but find it way to difficult. Director and
                      Lingo is so much easier and there are a lot of examples to learn from.
                      When I look at JavaScript examples, I have a great deal of difficulty
                      understanding them. The object orientation is powerful, and if you
                      understand C++ and other complicated languages like that, JavaScript is
                      easier to pick up. Unfortunately, when I see functions with (this) in
                      them, I have trouble following what's going on. So, thank god for Lingo
                      - it sure makes life a lot easier for people to learn scripting that are
                      not professional C++ programmers.
                      1 person found this helpful
                      • 8. Re: Lingo vs Javascript
                        fazstp Level 2
                        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.

                        • 9. Re: Lingo vs Javascript
                          Chardb Level 1

                          I agree with you entirely. I like the conceptual ease of Director. I also like Lingo a lot.

                          I could do anything I wanted in it and reference material was readily available in books, manuals put out by Adobe.

                          I am finding it hard to jump to Animate and Actionscript.

                          Charan