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

Some people are very fond of their C style strings (single quotes)... #20

Open
Garren opened this issue May 7, 2011 · 1 comment
Open

Comments

@Garren
Copy link

Garren commented May 7, 2011

"Strings should always use double quotes. Some people are very fond of their C style strings (single quotes), but this leads to conflicting styles within a script."

Maybe I've read this statement incorrectly, but:

C strings are double quoted not single quoted.

     char *s = "hello world";

C characters are single quoted.

     char c = 'c';

This is also the case with C++ (naturally), Java and C#. In fact Javascript is the only vaguely C'ish language which comes to mind that doesn't follow this convention.

@taitems taitems closed this as completed Jun 11, 2011
@taitems taitems reopened this Jun 11, 2011
@taitems
Copy link
Owner

taitems commented Jun 11, 2011

Woah, I hit "e" accidentally and it closed the issue. Apologies.

JavaScript is not able to differentiate between a phrase and a single character, as both are considered strings. I did not know that other languages could, so if the passage is vague then I hope you understand. I'm not a native C coder.

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

No branches or pull requests

2 participants