Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sequence and parenthesis terminators #3180

Closed
danschumann opened this issue Sep 25, 2013 · 2 comments
Closed

Sequence and parenthesis terminators #3180

danschumann opened this issue Sep 25, 2013 · 2 comments

Comments

@danschumann
Copy link

Alright, I'm not formally schooled, but I do code 12+ hours a day, some for work and some for pleasure, so I'm all about moving things forward. Those pretenses aside, I think there needs to be a parenthesis terminator so that when changing code that utilizes a space such as we change Math.max 2, parseFloat '123.456' to Math.max 2, parseFloat('123.456'), 999, we need not enter code into 2 places(one to replace the space and once more). Enter parenthesis terminator.

Math.max 2, parseFloat '123.456' ☻, 999

I'm up for debate on what character to use, but smiley face seems like a good ambassador. Having a character to end parenthesis means we can make a change involving closing parenthesis in 1 insertion. Constantly moving forward. Adding new code and refactoring old code are one in the same, but it seems redundant to have to go back to go forward in simple situations as this.

Changing $div = $ '<div>' to $div = $ '<div>' ☻.appendTo 'body' might be a better example. Ending parenthesis and then going on with a comma to another argument is arguably much less readable, but a single liner like this might be better.

Appending chained, indented methods are another example

$div = $ '<div>'  ☻
  .appendTo 'body' ☻
  .append 'my contents'

So going from the first line, adding the second line, and then adding the 3rd line becomes 3 insertions as oppose to 5.

Coding is all about saving time, right?

@vendethiel
Copy link
Collaborator

Alright, I'm not formally schooled, but I do code 12+ hours a day, some for work and some for pleasure, so I'm all about moving things forward.

Well, if being formally schooled in programming was needed to participate in coffee's discussion, I certainly wouldn't be here.


See #1407 #1431 and #1495 (and #1251 etc) for chaining syntax / space+dot closing implicit calls.


For a low-precedence operator (no ascii funk, please, so no smiley operator), see #1614 (your syntax indeed strikes me as unreadable too).

@jashkenas
Copy link
Owner

@Nami-Doc is a veritable CoffeeScript encyclopedia!

@jashkenas jashkenas reopened this Sep 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants