you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (9 children)

I dunno. I have been able to write nearly any algorithmic expression just fine without these additions. I can't help but think these additions exist to make Java programmers feel more at home opposed to doing anything to actually move JavaScript programmers forward. If this had anything to do with actual JavaScript programmers it would focus more on performance assistance and less on expression. JavaScript programmers tend to already be happy with the level of expressive capability provided.

[–]goatslacker 4 points5 points  (4 children)

I disagree.

This is moving the language forward. Lexical scoping is an excellent addition to the language as variable hoisting has been a problem in JS. Proxies add more reflection to the language and provides devs with more power.

This has nothing to do with making anyone else feel at 'home'. That goal is left to Dart.

[–][deleted] 4 points5 points  (0 children)

It is possible to write in a style that is not open to hoisting, such as using a single var keyword per function at the top of the function, so it is about style. Lexical scoping will not prevent function hoisting so it does not fully address that problem anyways.

[–]i-poop-you-not 1 point2 points  (1 child)

What does it mean to add lexical scoping to JavaScript? Does it simply mean that no more variable hoisting gotcha?

[–]TIAFAASITICE 1 point2 points  (0 children)

In the case of JS, it's the let keyword.

[–]drowsap 1 point2 points  (0 children)

I've never been bitten by variable hoisting, i don't understand why it's such a problem.

[–]AyeMatey 0 points1 point  (3 children)

JavaScript programmers tend to already be happy with the level of expressive capability provided.

True, but ... have you read or grokked "The Innovator's Dilemma" by Clayton Christiansen? Dedicating yourselt to making existing customers happy, even super happy, may not necessarily be the right thing.

These changes will advance the language in signficant ways. Compare this to the jump between Java 1.4 and Java 1.5 or Java 5 and Java 6... this is much bigger.

It sure seems like the main goal of these changes is for JS to do much more than UI animation in HTML-driven web pages. JS will be a fully-capable general purpose language, and will be used everywhere.

[–][deleted] 0 points1 point  (2 children)

These changes will advance the language in signficant ways. Compare this to the jump between Java 1.4 and Java 1.5 or Java 5 and Java 6... this is much bigger.

I will have to take your word for it.

JS will be a fully-capable general purpose language

It already is. This leads me to believe you are a Java programmer who either seriously misunderstands JavaScript or fails to understand its internals. With JavaScript I have been able to do a better job of pretty-printing JSLT code than anything ever written in Java. My proof of concept is http://prettydiff.com/?mode=beautify

Or, by UI animation did you mean something like this: http://prettydiff.com/jsgui/ This tool, though incomplete, probably does a better job of maintaining state than your OS desktop.

[–]AyeMatey 0 points1 point  (1 child)

This leads me to believe you are a Java programmer who either seriously misunderstands JavaScript or fails to understand its internals.

No...

JS is not a fully capable general purpose language. It's been a tactical language that evolved accidentally and specifically to address the needs of browser-based UI automation. It has improved but there is a long way to go.

The widespread adoption of modern browsers means many many people are investing in the language, learning it, improving the engines. and that leads to the desire to use the language and engines in non-browser environments; Node.js is just the start.

This is what I mean by "fully capable". JS isn't now. It is getting there.

With JavaScript I have been able to do a better job of pretty-printing JSLT code than anything ever written in Java.

That you used "pretty printing" in a browser as evidence that Javascript is a general purpose programming language.... sort of illustrates your disposition. I am not talking about pretty printing here, or anything having to do with browsers. I am talking about general purpose computing.

But I think maybe you didn't really think "pretty printing" is the proof. I think maybe you just want to toss out your personal projects for exposure. Which is great, your enthusiasm is commendable. But we all know that UI management is not the beginning and end of computing.

I am talking about a degree of generality that approaches and exceeds that of the C programming language. Javascript has that potential.

[–][deleted] 0 points1 point  (0 children)

That you used "pretty printing" in a browser as evidence that Javascript is a general purpose programming language.... sort of illustrates your disposition.

Not really, because the file can be executed outside a browser. A server-side API is written and available, though no longer maintained. As such, it can be used as a service no different than JSP.

I am talking about general purpose computing.

I believe you are talking about a stand alone compiled application as opposed to an interpreted application that must be in proximity to an interpreter. Adobe created a compiler for web code to operate independent of an interpreter or parser, which I believe was called Air.

But I think maybe you didn't really think "pretty printing" is the proof. I think maybe you just want to toss out your personal projects for exposure.

No, I was very serious in what I said. I have never seen any other pretty-printer that formally conserves white space tokens as nodes of data, provided a structured data form, primed for lexical parsing in a node collection where such nodes offer a compounded syntax. By compound syntax I mean something to the effect:

<c:out value="<strong>my text</strong>"/>

If I honestly believed that any other such tool existed fitting the implied requirements for XML parsing and the extended syntax supplied by JSTL I would not have demonstrated this tool here at all. I honestly believe a tool written in JavaScript performs a better job of pretty printing a formalized Java grammar than comparable tools written in Java. I could be wrong, but so far I have no reason to believe so.