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

promote the use of interpolation in the documentation #1426

Merged
merged 1 commit into from Jul 7, 2011

Conversation

michaelficarra
Copy link
Collaborator

This one's mostly for @jashkenas. We should be promoting the use of interpolation by including it throughout the documentation.

@jashkenas
Copy link
Owner

I was trying to introduce one concept at a time, and avoid relying on things introduced further down the page, if possible. ... to make it easier to read through. What do you think?

@michaelficarra
Copy link
Collaborator Author

That's kind of a question of whether it's a fundamental part of the language (like function literals, string concatenation, array literals, regular expressions, etc.) or a more gratuitous or uncommon feature like the various pieces of syntactic sugar we have. I think it belongs in the first group, as the "de facto" way of building strings, hence the pull request. If you're still worried about it being unfamiliar or something, maybe move the interpolations up toward the top? Sting building is a fundamental feature of a programming language like this one, just like function application.

@itay
Copy link

itay commented Jun 9, 2011

I agree with Michael - I also think it's definitely one of the strong features of CoffeeScript, and I always dread regular Javascript due to it.

I'd like to see the explanation moved to the top - maybe even with some more examples to show the power and expressiveness.

@michaelficarra
Copy link
Collaborator Author

Also, it would be very helpful to mention @satyr's recommended solution to #1406 so people can easily construct strings without null/undefined values.

@TrevorBurnham
Copy link
Collaborator

I think this is a sensible change. Many of the most common questions/complaints we get are along the lines of "Why do a + "b" and a +"b" mean different things?" And the most satisfactory answer is always "Well, just use string interpolations so it's not an issue." The syntax is pretty self-documenting anyway when the JS output is next to it.

@ghost ghost assigned jashkenas Jun 27, 2011
@michaelficarra
Copy link
Collaborator Author

I think we came to a fair enough consensus here. @jashkenas: ready to merge?

@jashkenas
Copy link
Owner

Sounds good.

jashkenas added a commit that referenced this pull request Jul 7, 2011
promote the use of interpolation in the documentation
@jashkenas jashkenas merged commit 5ab892d into master Jul 7, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants