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

Consider using single quotes ' in JavaScript instead of double quotes " #45

Closed
erikeckhardt opened this issue Feb 25, 2016 · 2 comments
Closed

Comments

@erikeckhardt
Copy link

Consider using single quotes consistently in JavaScript, because this makes it much easier, as a matter of habit, to include Html that uses double quotes. I understand that in general, especially when using something like angular that is in essence a templating mechanism, that we would usually not put html in strings in JavaScript. However, it does occur at times (and consider jQuery selectors such as $('div[data-flag="true"]').

I honestly don't know if this recommendation is truly a global one in the community, but I for one find JavaScript single quotes easier on the eyes, and enjoy the difference from the more "bulky" double quotes that are used in HTML.

@erikeckhardt erikeckhardt changed the title Consider using single quote ' in JavaScript Consider using single quotes ' in JavaScript instead of double quotes " Feb 25, 2016
@steveambielli
Copy link

I thought the same thing and would prefer single quotes. When going through the tutorial I was using single quotes instead.

@levibotelho
Copy link
Owner

@erikeckhardt In regards to all of your comments/issues, I really appreciate the time and effort you put into creating them. It's great to see that there's community engagement around the site and that there are people out there who want to help make it better.

I'm going to close this issue because it brings little to no benefit to the end user while having a number of drawbacks:

  • It reflects a coding style. Single quotes are indeed popular, but it's a tabs vs. spaces argument when you boil it all down.
  • Some people prefer double quotes and we could have just as easily gotten a "move to double quotes" issue had we written this with single quotes.
  • It risks creating bugs in the lessons.
  • We would need to change the quote style in the application as well in order to remain consistent, which would risk creating bugs there as well.
  • Users are free to go with single quotes when they write their test code. If this isn't the case then this specific detail needs its own issue. Users should be free to use any legal coding style when going through the lessons.
  • There are work items in the queue (like your Add "next" and "previous" buttons #43) that need work but benefit the user much more. This is especially important as I'm currently busy with other projects. Should anybody be able to spend a bit of time and want to contribute to make the site better, I'd rather them pick up a work item that improves the application in a more meaningful way.

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

3 participants