5 ms·
Unsure if trolling or not. It's quite easy to have your editor represent a tab character as "n spaces" - where n is the number of spaces you find pleasing. In f
by josegonzalez 12y ago
Unsure if trolling or not. It's quite easy to have your editor represent a tab character as "n spaces" - where n is the number of spaces you find pleasing. In fact, I can't recall a serious editor where this isn't the case.
What issues have you seen with regards to using tabs?
- angersock 12y agoOften different editors on a project (hell, even between computers for the same user) may display the same file different ways, and you almost always end up with weird mixes of spaces/tabs when indenting things (especially if you're super picky like I can be and really, really care about things lining up). Simply having the editor expand tabs (to whatever people agreed on, usually 4 for C/C++ that I've seen) and save spaces, always, makes life simpler. EDIT: See Grandpa Zawinski's post on same: http://www.jwz.org/doc/tabs-vs-spaces.html http://www.jwz.org/doc/tabs-vs-spaces.html
- dTal 12y agoI hate that Zawinsky post. At the top, he says "I'm trying to avoid espousing my personal religion here, I just thought it would be good to try and explain the various sects." At the bottom, after thoroughly missing the point about semantic indentation, he says "So go forth and untabify!"
- Glyptodon 12y agoI'm not sure if there's an "issue" with tabs, but I have to agree that I pretty much never come across tabs in any of the languages I use regularly and find it jarring when I do so despite the obvious theoretical benefit of flexible tab widths enabling user preference. I can't come up with a particularly good reason for it, but I'm so used to spaces at this point that tabs feel very wrong. If anyone else has a good explanation I'd love to hear it.
- MBlume 12y agoGrabbing some Clojure code because it's nearest to hand. Look here: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L226 https://github.com/clojure/clojure/blob/master/src/clj/cloju... I want the bindings being declared within that let to line up with one another. the first one immediately follows "(let [" so I need the rest to be indented six characters past where the let was originally indented. Six, not N times whatever the tab width happens to be in whichever editor someone's looking at the code in. This is the problem with tabs.
- gmjosack 12y agoThe way people solve that is tabs for indentation and spaces for alignment. In my opinion this is a terrible compromise as mixing tabs and spaces is sacrilegious.
- msutherl 12y agoThere is nothing wrong with mixing tabs and spaces. It works great.
- jsmthrowaway 12y agoUntil Python. Then it doesn't.
- markrages 12y agotabs for indent, spaces for alignment works great with Python.
- oelmekki 12y agoProvided everyone use the same tab width :)
- peteretep 12y agoWhat's a compromise about it? Alignment and indentation are different semantic things, so it makes perfect sense to mix them.
- subsection1h 12y ago> What issues have you seen with regards to using tabs? How does a team adopt a standard regarding line length if their code base uses tabs and the team members specify different tab widths in their editors? In my experience, devs that prefer tabs over spaces have a tendency to be unconcerned about line lengths, and their lines of code can become annoyingly long. For example, the most popular Go project at GitHub[1] is Docker. Docker's code base contains Go files with lines of code that are hundreds of columns wide.[2] Gross. ;-) [1] https://github.com/search?l=Go&q=stars%3A%3E0&type=Repositories https://github.com/search?l=Go&q=stars%3A%3E0&type=Repositor... [2] https://github.com/dotcloud/docker/blob/master/api/client/commands.go#L1483 https://github.com/dotcloud/docker/blob/master/api/client/co...