3 ms·
> Also, did you think about the above remark? If you change the meaning of tabs in the editor, there's no easy way to let the language know what you decided. Th
by hboon 14y ago
> Also, did you think about the above remark? If you change the meaning of tabs in the editor, there's no easy way to let the language know what you decided. The outcome is that the editor operates under one assumption, and the language operates under another.
If I use tabs, then Python will just consider a line that starts with 2 tabs to be indented one more level than the previous line with 1 tab, and so on. What I set my editor to display the tab as shouldn't affect how the interpreter reads it (unless I mix spaces and tabs, which while I don't think it's likely or common, I do agree you have a point there).
Or did I misunderstand you?
- jabbernotty 14y agoThe problem is that different people use different editors that have different settings. One person uses four spaces, another used 8 spaces, and a third uses tabs. Suddenly, your python code doesn't work well anymore, commits/diffs become very confusing and web services that have source viewers produce messy views.
- lutusp 14y ago> If I use tabs, then Python will just consider a line that starts with 2 tabs to be indented one more level than the previous line with 1 tab, and so on. Yes, but that's at odds with how the code looks to a human when both tabs and spaces are used. Remember that I qualified my remark by saying it was about a mixture of tabs and spaces.