[sugar] Python coding conventions

Marco Pesenti Gritti mpg
Mon Oct 2 08:15:42 EDT 2006


>> When we decided for tabs I remember Dan had a discussion with David 
>> about this and he was feeling strongly for tabs. Dan?
>>     
>
> (obviously activities can do what they want)
>
> Yeah, I'm a tabs guy.  But a lot of the python bindings code for GNOME
> that we were using also used tabs, and we felt consistency there too was
> worth something.  Maybe not.
>
> People who prefer spaces either (a) like hitting arrow keys a lot, or
> (b) have an editor that skips spaces automatically.  Not every editor
> does that, or does it consistently.  Presumably Python started using
> 4-space-width tabs because they couldn't agree on how big a tab was
> supposed to be and decided to make the question irrelevant. 
>   
To me the pro of spaces are:

- You can read the code on every editor and it will always look the same.
- Even if you don't setup your editor and there are no editor hints you 
can still submit small patches with the right style by just using spaces.
- Maybe it's slightly less likely to get patches with the wrong style, 
since using spaces is the natural fallback if using tabs things doesn't 
look right.

Is (b) really an issue? Both vim and emacs should handle this fine. And 
gedit has an option for it (not sure how well it works, we should make 
sure of that since it's the editor both we are using).

If we want to do this we should do it now, because history doesn't 
matter much yet.

Marco


More information about the Sugar-devel mailing list