CodeCademy Platform Issue - Code Formatting

Hello Codecademy Community,

I’ve encountered a peculiar behavior in the Codecademy code editor that I wanted to share and discuss. When using the “Format Code” feature, which is supposed to automatically tidy up the code, I’ve noticed that it changes string literals from using single quotes 'string' to double quotes "string". This caught my attention because the platform’s learning materials and best practices advocate for the use of single quotes for string literals.

This inconsistency could potentially confuse learners, especially beginners who rely on the platform’s guidance to form their coding habits. To better illustrate the issue, I’ve attached a screenshot displaying the inconsistency.

I’m curious to hear your thoughts on this and whether others have experienced the same. Also, if there’s a rationale behind this behavior that I’m missing, I’d appreciate any insights.

Thanks!

I guess it tidied it up(?).

Aren’t double quotes easier to read than single quotes (which could be confused with backticks)?

Here’s a discussion from S.O. from 15 years ago that I think is still relevant:

They might be easier to read. But this fix goes directly against what they recommend during the course. It’s not a matter of opinion, but rather a matter of consistency.

You asked for peoples’ thoughts. I gave you my opinion. :woman_shrugging:t2:

Maybe different developers worked on the course and Workspaces(?)
I think it has to do with personal preference.

I use double quotes in Python and make sure I stick with that. I know it’s different depending on the programming language.

1 Like

Yes, for sure. In the end, it’s a matter of personal preference.

It’s just that as someone who’s learning JavaScript (and to code) for the first time, these little things can make the learning process more complex.

Thanks for your input!

1 Like