3 ms·
Do you indent your code when you use braces? this { foo: bar; } If so - how is scanning for {} any different than scanning for indentation lev
by Nadya 10y ago
Do you indent your code when you use braces?
this {
foo: bar;
}
If so - how is scanning for {} any different than scanning for indentation level?
this
foo: bar;
You'd have a valid point if you wrote code as thus:
this {
foo: bar;
}
or
this
{
foo: bar;
}
If you're using indentation and curly braces - one of the two isn't necessary. In my opinion, indentation alone is more scannable for code blocks than curly braces alone. If I were to drop one - it would be curly braces.
I don't find Python all that difficult to read - and I primarily deal with Javascript and C#.
- Boothroid 10y agoI prefer the last. Partly it's not being able to just drop a brace in the right place to make something compile when hacking that bothers me - ohh no, in Python you have to make sure every damn block is aligned correctly.. For a quick and dirty scripting language it sure is pedantic!