Le 04/10/2011 15:43, Kyle Simpson a écrit :
I'm sorry David, I just have to express a dissenting opinion here.
There is no reason to be sorry. As I said at the end, we are different within the same community. We have different need and views and consequently, sometimes disagree. That's fine, let's debate!

While I could see that "better tooling!" would be a positive side-effect of some syntax suggestions, I think it's a overreaching idea to consider such a main argument for adding new syntax.

You make a compelling argument of how tooling *could* benefit from the new syntax, sure. But it misses a few things:

1. The readability of the language in environments where such tooling doesn't or can't really exist. 2. Syntax highlighting of 1-2 char operators is far less visually helpful than syntax highlighting of method names, etc. 3. Not all developers use a unified toolset for JavaScript (compared to say .NET where the vast majority use VS)

For #1, I personally think |> looks awful. I hate it. I wouldn't use it. And I'm less than entranced by the idea that I might have to read others' code with such confusing looking operators in it. Only if all the tools I was using to read & write JS were capable of somehow making that syntax useful/beautiful instead of ugly would your argument hold much water for me. But that's just opinion and preference.

For #2, which kinda goes with #1, I'm concerned that the readability (even with syntax highlighting) of the language as a whole will take a dip for several years as developers re-adjust to the new syntax. Syntax highlighting is often seen as a way to help the readability of a language, but syntax highlighting for new weird unfamiliar operators isn't going to help much at all.
By "syntax", I meant "things that provides guarantees program-wise". I didn't take program readibility in consideration. For instance, I do not think that addition of only 1-2 char operators is the best idea. Using keywords like "extends" sounds like a good idea and maybe a good alternative to <| (that apparently a lof of people are reluctant to) My point was positive about the addition of things that offer guarantees on the program. I talked about syntax without opinion of which syntax is good and which isn't. Readability is a different concern. Which should be addressed, I agree, but which is different from my need (having a language that can be more easily analysed). As far as I'm concerned, anything unambiguous will be enough.

Also, in all honesty, I think that it's hard to tell now things about readability. We are all highly influenced by current syntax and no one knows what newcomers to the language will find beautiful and ugly in 5 years (am I too optimistic?) when browsers will have implemented the new syntax features.


Will it eventually get better? Sure, if we don't keep adding new syntax every edition, it'll eventually stabilize. But I don't look forward to the dip in readability for the short-term, for my own code and for everyone else's code that I read.

For #3, I don't use fancy IDE's at all. I use text editors at best. I use notepad, PSPad, and Sublime on windows. And on linux I use vi. I doubt any of those text editors are ever going to care to pick up on the syntactic nuances you suggest. Which is my bigger point. Just because tooling *CAN* benefit from new syntax, doesn't mean all (or even most) tooling *WILL* benefit. What we'll end up with is a broad range of support from none all the way up to super-awesome-happy-unicorns. So both the good and bad side of this is YMMV.
I agree. As you emphasis, my point was about potential and for sure there will be a transition period. JavaScript is not the first language which has syntax changes throughtout its history and tools adapted. Maybe the core tools or plugins, but tools adapted.


Factoring all those things in, I can't see how "new syntax==better tooling" is anything more than an auxiliary supporting argument.
New syntax could allow more accurate analysis of JavaScript. Better tools is (only) one potential consequence of this better analysis. Better performance is another.


And yeah, I concur with the "99 problems..." statement. Working with JavaScript every day for the better part of a decade, I can't say that JavaScript's syntax issues have ever really tripped me up. Poor API's trip me up all the time. Poor handling of async (which can be considered a syntax issue!) definitely trips me up regularly.
I heard [1] that "yield" will be of some help for this.

David

[1] http://blog.mozilla.com/dherman/2011/03/11/who-says-javascript-io-has-to-be-ugly/
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to