Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: [OT] Perl / Computer Science Science Fair Projects

by tilly (Archbishop)
on Sep 09, 2008 at 18:01 UTC ( #710161=note: print w/ replies, xml ) Need Help??


in reply to Re^2: [OT] Perl / Computer Science Science Fair Projects
in thread [OT] Perl / Computer Science Science Fair Projects

I ran across that, and immediately decided that there was so little backwards compatibility that I was going to forget it again.

Also you can't use the let keyword unless you've explicitly declared that you're using version 1.7.

<script type="application/javascript;version=1.7"> ... </script>
which strikes me as a very annoying design choice.


Comment on Re^3: [OT] Perl / Computer Science Science Fair Projects
Download Code
Re^4: [OT] Perl / Computer Science Science Fair Projects
by BrowserUk (Pope) on Sep 09, 2008 at 20:35 UTC
      It is certainly similar, and was done for a similar reason.

      However the Perl version had better cause to do it (there is popular code in the wild which conflicts with Perl 5.10 features, whereas worries about functions named "let" are more theoretical), and did it with a language mechanism that is used by a lot of third party modules.

      But there are other significant differences. The JavaScript version has horrible action at a distance. If my library uses let, you have to know that when you load it in a different file. How to do it is not obvious. If I have multiple JavaScript snippets, I have to include that feature in each one. If I wish to inline some JavaScript in a tag, there is (as far as I know) absolutely no way for me to say that I want features turned on. (Yes, in autogenerated code it sometimes does make sense to put complex JavaScript in tags.) Furthermore if I'm a novice bitten by JavaScript's unusual scoping rule, there is no easy way for me to discover that workaround.

        If I wish to inline some JavaScript in a tag, there is (as far as I know) absolutely no way for me to say that I want features turned on.

        Specifying the default scripting language, from the HTML spec.

        (I'm not disagreeing with anything you said. I just thought you might be interested in this.)

        Way way off the OP topic but...

        Specifying the version in a single <script> tag doesn't seem all that big a deal to me. Load a single js file with that tag and then load all other external scripts programmatically with the XPCOM inteface @mozilla.org/moz/jssubscript-loader or something like JSAN. That way everything else loaded specifies the same version, then add your inline script attributes and/or event handlers programmatically as well.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://710161]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2014-09-20 00:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (151 votes), past polls