Braces or indentation ? | SoloLearn: Learn to code for FREE!

+14

Braces or indentation ?

Do you prefer to use braces or indentation and which one do you think is cleaner ?

4/4/2018 11:45:01 AM

Amine Trabelsi

39 Answers

New Answer

+20

Braces enforced, with proper indentation encouraged. Actually, either one is fine for me, just not both braces and indentations enforced together as a part of the syntax.

+21

When I started to write in Python, I thought: 'I want to use braces!', now I fell good with indentation. I prefer this because braces can create confusion with other braces that you use for functions, lists, sets, ecc.

+17

Indentation. Its is hard to find missing braces. Also indentation makes the program look alot more clean. Python❤

+16

I prefer braces with auto-indent or beautifier. That makes it easy to identify matching braces. "Newer" editors also highlight matching braces when near one of them and the whole section can be collapsed.

+7

You should always indent, no matter if you have braces or not. As for braces, I don't care a lot. I like the cleanliness of Python, but missing braces are a lot easier to find than wrong indentation. I guess I like them.

+6

I find braces more easy and less error prone.

+4

+4

Braces are most cleaner than indentations.Braces represent blocks and are more easier yo understand than indentations.Some people just use only one space as indention and It is very annoying to check the scope of variables in the blocks.So in my opinion,braces are more cleaner than indentations.

+4

indentation is mandatory in both cases . . . . as every code has to be clean

+3

proper indentation

+3

Indent .

+3

I think that indentation is a good practice in every language, and I also suggest the use of braces, but it is a language dependent concept

+3

Either works if you care about the code clarity. Neither will help if you don't.

+3

Braces might just clutter up your code, making it hard to read. So proper indentation is very useful

+3

+3

I believe that braces are better but a code with no indentation at all wouldn't be very clear so they work nicely together

+2

A combination, braces allow you to easily see what code belongs to what function whilst indentation helps you to see how embedded it is in oher things.

+2

Braces + indentation. That's the way we can read and work easily on a block of code.

+2

Braces, though I'm fine with both. Basically like Hatsy.

+2

Braces but conventionally one can opt both