I think 4 spaces is the number the universe intended us to use. Is there any way for me to select the indentation in the code editor? It seems to be hardcoded to 2 spaces.
Although I agree it should be an option, I’ve been using 2 (or tabs FTW) for the past decade and I think a lot of developers are used to the tighter format now.
There are a class of text editor settings and conventions that our approach is to be more opinionated on. We’re not saying these options aren’t without merit - most of us have certainly had battles or discussions about them.
We’re designing Gomix with an assumption that if people aren’t confronted with low level choices like this. Ideally, this approach will have a couple benefits to their life:
- they’ll instead focus on issues around their actual code, or on the problem they’re trying to solve
- we can help people avoid a deep, dark internet rabbit hole
- no one should feel like they’re doing it wrong, or that they have to understand and make the “right” choice before coding
- consistent conventions make browsing other people’s code easier - especially helpful in a remix or collaboration scenario
I certainly see your point @pketh, thank you.
Someone copying over my example to a proper Python codebase would have to use four spaces anyway, to not go against the grain.
Therefore, if the spacing is fixed it should probably be configured on a per-language basis. Though you basically enter the same rabbit hole again.
Language specific defaults makes sense to me. We’re still discussing internally whether multi language support is something we’ll want to focus on right now though
Add ability to change font size in the editor
I would like to throw out the suggestion to allow Glitch to support .editorconfig settings. That way every project can define how their code should appear. Default the project to 2 spaces and let authors change.
This also allows authors to set preferences on a per-file type basis. CSS can have a different coding style than JS or whatever.
.editorconfig support makes sense, it requires some editor plumbing updates on our end but nothing too crazy hopefully, I’ll add it to our todo list