Reply to post: Tabs?

Cryptocurrencies kill people and may kill again, says Bill Gates

hellwig

Tabs?

When I code I use tabs because you want the columns to line up,

What does that even mean? Even Microsoft's IDEs can line-up code based on context. It can align your variables in a multi-line declaration, align values in a table, etc...

A Tab is just a variable-width space (but a constant width across the document). So what's the difference between inserting one tab or 2/3/4 spaces? If you don't keep the white-space at the beginning of lines consistent, it doesn't matter which you use. So consistency is key. I like spaces because they DON'T get f-ed up when you open them in a different editor. If you use 2-space tabs and a coworker uses 8-space tabs, after a couple levels in indentation, your co-worker's gonna need an ultra-wide display to view your code.

So I guess if you're writing code in Wordpad (I had a professor in high school that did that), keep using tabs.

Otherwise, if an IDE is smart enough to figure out Python, it will easily insert spaces into more-sensically laid-out languages.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2022