5 ms·
On tabs vs. spaces, read the old classic: http://www.jwz.org/doc/tabs-vs-spaces.html http://www.jwz.org/doc/tabs-vs-spaces.html tldr; don't use tabs. I read t
by olau 13y ago
On tabs vs. spaces, read the old classic: http://www.jwz.org/doc/tabs-vs-spaces.html http://www.jwz.org/doc/tabs-vs-spaces.html
tldr; don't use tabs.
I read that piece many years ago and thought who cares, but I've later changed my editor to never use tabs. He's right.
Tabs are nice in theory, but in practice you end up with garbled code. It's better to train yourself to get used to seeing code bases formatted slightly differently, just one of the things you have to get over, IMHO. Like camel notation version underscores versus dashes.
- fhd2 13y ago> It's better to train yourself to get used to seeing code bases formatted slightly differently, just one of the things you have to get over, IMHO. Like camel notation version underscores versus dashes. That's a pretty good point. Indentation is indeed just one small aspect of the overall code style - why would you want to have that configurable and nothing else?
- Shorel 13y agoThanks for posting the original s-expr based, tab bashing article! It has always been my own argument in favour of tabs: - The original argument against tabs was based on Lisp indentation rules. - Languages with very complex indentation rules like Lisp should use spaces. There's no exception to this rule. - Languages from the C family should use Tabs, as Lisp indentation rules don't apply to them. - Nowadays almost all popular languages can be considered to be part of the C syntax family. Python and Lua are notable exceptions. PHP and Objective C files should use tabs.
- lispm 13y agoNever let get facts in your way. http://trac.common-lisp.net/mit-cadr/browser/trunk/lisp/zwei/indent.lisp http://trac.common-lisp.net/mit-cadr/browser/trunk/lisp/zwei... MIT's Zmacs, the editor of the Lisp Machine indents with tabs.
- Shorel 13y agoGood find, thanks. However, one very old editor using tabs doesn't mean Lisp programmers actually prefer them. It may even be the cause of tabs hate.
- lispm 13y agoIf the editor of the Lisp Machine, which was used by people like Steele, Stallman, Pitman had no problems using tabs, it can't be that Lisp has a technical requirement not to use tabs. Steele wrote a book about C. Stallman wrote a Lisp in C and a C compiler... Basically your arguments are from a strange parallel world.
- zobzu 13y agoit's also been rebutted to death.