If you follow me on twitter or have heard one of my talks you’ll probably know I despise spaces for indentation with a passion. However, I’ve never gone into the details of my opinion on stage, and twitter isn’t really the right medium for advocacy. I always wanted to write a blog post about my take on this old debate, so here it is.

### Tabs take up less space

Yes, this might be an insignificant difference after gzipping and a nonexistent one after minification. But it means you need these processes to keep your code size reasonable. You depend on them, for no reason. Comments for example are useful, and it’s worth having them even if you knew you couldn’t minify or gzip your code. Tabs could do the same thing as spaces, so you’re just bloating your code for no reason.

### Tabs can be personalized

The width of a tab character can be adjusted per editor. This is not a disadvantage of tabs as commonly evangelized, but a major advantage. **People can view your code in the way they feel comfortable with, not in the way *you* prefer. **Tabs decouple the code’s presentation from its logic, just like CSS decouples presentation from HTML. They give more power to the reader rather than letting the author control everything. Basically, using spaces is like saying “I don’t give a rat’s ass about how you feel more comfortable reading code. I will force you to use *my* preferences because it’s *my* code”.

### Tabs are better for collaboration

Personalization is incredibly valuable when a team is collaborating, as different coders can have different opinions. Some coders prefer their indents to be 2 spaces wide, some coders prefer them to be 4 spaces wide. Rather than manually or automatically converting the code post-pull, and then back pre-commit, it would be adjusted automatically, depending on the editor’s tab-width setting, so every coder could start editing right away, with their favorite type of indent.

### You don’t depend on certain tools

When using spaces, you depend on your editor to hide the fact that an indent is actually N characters instead of one. You depend on your editor to insert N spaces every time you press the Tab key and to delete N characters every time you press backspace or delete near an indent. When you have to use something that’s not your editor (for example when writing a snippet of code on a webapp that embeds something like codemirror) you will have to face the ugliness of your decision. Especially with codemirror, everyone else will have to face the ugliness of spaces too, as it converts tabs to spaces 🙁

### Tabs are easy to select

Assume for some reason you want to select all indents and double them or convert them to spaces. This is very easy with tabs, because that’s their sole meaning. Tabs were invented for this sort of thing. Spaces on the other hand, have many meanings, so you can’t just find & replace space characters. And how do we usually call the practice of using things for a different purpose than they were made for? Yup, that’s right, **using spaces for indentation is a hack**.

### Code indented with tabs is easier to copy & paste

As pointed out by Norbert Süle in the comments, when you copy and paste code that’s indented with spaces, you have to manually adjust the indentation afterwards, unless the other person also *happens* to prefer the same width indents as you. With tabs, there is no such issue, as it’s always tabs so it will fit in with your (tabbed) code seamlessly. The world would be a better place if everyone used tabs.

### But what about the web? Tabs are super wide there!

This used to be a big problem, and even the enlightened coders that prefer tabs usually convert them to spaces before posting code online. However, CSS3 solves this problem, with the tab-size property. It’s supported by Opera, Firefox and very soon by WebKit too. It also degrades gracefully: The code is less pretty, but still perfectly readable.

### Are spaces always evil?

Spaces are the best choice for aligning, rather than indenting. For example, in the following code snippet:

var x = 10, y = 0;

you need 4 spaces to make the variables line up. If you used tabs, they would only line up when the tab width is 4 and the formatting would look messed up in every other case. However, if this code snippet was also indented, the indents could (and should) still be tabs.

Another example is aligning CSS3 properties with different vendor prefixes. The indent should be done with tabs, but the aligning with spaces, like so:

```
div {
-webkit-transition: 1s;
-moz-transition: 1s;
-ms-transition: 1s;
-o-transition: 1s;
transition: 1s;
}
```

### It’s just a pointless detail, are you seriously that obsessed?

Um, ok I am exaggerating a bit when I say how spaces suck. I do think they suck, although I admit the world has much bigger problems than coders who use spaces for indentation.

For example, coders that don’t name their variables properly. Or the ones that prefer Emacs over Vim 😉

### Further reading

- Indentation With Spaces Considered Harmful
- Tabs vs spaces for code indentation
- Why I love having tabs in source code
- Tabs vs spaces
- Relevant: Elastic tabstops

Pingback: Why tabs are clearly superior | Lea Verou « Grailbox()

Pingback: PAYcast 39 » PAYcast()

Pingback: Indentation: tabs or spaces?()

Pingback: My Coding Style and Guidelines | @drublic()

Pingback: Tabs or spaces? I use both. | JHH's blog()

Pingback: Convertir facilement les espaces en tabulations avec Sublime Text | feub.net()

Pingback: 阅读 为什么我选择用 tab 而不是 space 来缩 进 | 麦客工场()

Pingback: universal - Which code indentation style is the de facto standard? - indentation()

Pingback: Google()

Pingback: kona coffee()

Pingback: dent removal schools()

Pingback: coffee beans()

Pingback: kona coffee()

Pingback: kona coffee()

Pingback: verizon small business()

Pingback: kona coffee()

Pingback: kona coffee()

Pingback: led light aquarium()

Pingback: porn()

Pingback: coffee beans()

Pingback: coffee beans()

Pingback: coffee beans()

Pingback: coffee beans()

Pingback: coffee beans()

Pingback: Google()

Pingback: coffee beans()

Pingback: royal blue html color codes()

Pingback: motorcycle service in Jacksonville fl()

Pingback: cargo van shelving()

Pingback: Pop Up Banners()

Pingback: have a peek at this site()

Pingback: school for dent repair class course()

Pingback: Apparel and Footwear()

Pingback: kemal facebook()

Pingback: bbw porn videos()

Pingback: 폰섹()

Pingback: sohbet hatları()

Pingback: trechos de filmes para retrospectiva infantil()

Pingback: мъжки тениски()

Pingback: great hotels()

Pingback: work from home ideas()

Pingback: clothing store()

Pingback: Movies Drama()

Pingback: bad judge hawaii()

Pingback: West Album()

Pingback: john barban chest workout()

Pingback: t20 world cup live score()

Pingback: boom lift rental Miami()

Pingback: garmin tracker()

Pingback: Buy Facebook Likes for fan page()

Pingback: Apple deals()

Pingback: hualalai estate coffee()

Pingback: Opciones Binarias()

Pingback: doral()

Pingback: chanel brille()

Pingback: automotive education()

Pingback: site()

Pingback: pdr training()

Pingback: seo services company()

Pingback: this content()

Pingback: slinky lingerie()

Pingback: Latest gadget news()

Pingback: read()

Pingback: Car GPS Tracker()

Pingback: Luxury Watch Exchange()

Pingback: Wristwatches()

Pingback: Watch Auctions()

Pingback: play free slots games()

Pingback: look at this web-site()

Pingback: fishing paddle board()

Pingback: buy 5000 facebook likes()

Pingback: pdr training course()

Pingback: AG Dental plus Thailand()

Pingback: how to do background check()

Pingback: woodworkers store()

Pingback: custom logo grommet()

Pingback: customized logo rivet()

Pingback: ring snaps()

Pingback: jeans button()

Pingback: bespoke order snaps()

Pingback: pearl snaps for babies()

Pingback: gripper snap fastener tool()

Pingback: colored snaps baby clothes()

Pingback: race car quick change gears()

Pingback: convert youtube to mp3 high quality()

Pingback: donate your car to charity()

Pingback: find a local dentist()

Pingback: Buy Followers Facebook()

Pingback: During Production Inspection(DUPRO)()

Pingback: bantningspiller()

Pingback: Portable Counter()

Pingback: Banner Stand Supplier()

Pingback: Demonstration Counter()

Pingback: Shell Scheme Graphics()

Pingback: Top Bluetooth speakers()

Pingback: plantas purificadoras()

Pingback: buy facebook page likes cheap()

Pingback: filme noi()

Pingback: top news of world()

Pingback: check my source()

Pingback: homegoods()

Pingback: kona coffee()

Pingback: kona coffee()

Pingback: kona coffee()

Pingback: kona coffee()

Pingback: biaxin()

Pingback: Homepage()

Pingback: cool woodworking projects()

Pingback: kona coffee()

Pingback: 폰섹()

Pingback: insta likes()

Pingback: How to promote business on facebook()

Pingback: Buy and sell classifieds()

Pingback: free music downloads at Miraclepianist.com/free-music-downloads-mp3()

Pingback: how to make money()

Pingback: canlı sohbet hattı()

Pingback: options strategy()

Pingback: kumpulan lagu terpopuler terupdate()

Pingback: blotter art()

Pingback: elektronik sigara()

Pingback: pdr training()

Pingback: dent tools()

Pingback: Headphones()

Pingback: geodesic dome kit()

Pingback: Full Article()

Pingback: gourmet coffee()

Pingback: 출장마사지()

Pingback: rimless glasses()

Pingback: KASINO LIVE Indonesia()

Pingback: filme hd online()

Pingback: daily fantasy rankings()

Pingback: orologi da polso in legno()

Pingback: babagroup.it()

Pingback: プラセンタ()

Pingback: プラセンタ注射()

Pingback: electronic components()

Pingback: limousine()

Pingback: visit this site right here()

Pingback: purificadoras de agua()

Pingback: hop over to here()

Pingback: plantas purificadoras()

Pingback: Click This Link()

Pingback: try here()

Pingback: her explanation()

Pingback: 7 piece patio set()

Pingback: see page()

Pingback: read what he said()

Pingback: visite site()

Pingback: corso web marketing()

Pingback: Jueza Berdión de Crudo()

Pingback: colored pill binder()

Pingback: aeroponics tower garden systems()

Pingback: hawaiian beans()

Pingback: natural health()

Pingback: classic kona coffee single-serve()

Pingback: kauai-coffee/coconut-caramel-crunch-coffee-kauai-12-single-serve()

Pingback: mac nut coffee kcups()

Pingback: sansei french coffee()

Pingback: kona coffee()

Pingback: Muslim Art()

Pingback: ground coffee()

Pingback: Pittsburgh Web Design Firm()

Pingback: hawaiian-isles-coffee/chocolate-macadamia-nut-coffee-ground-10-oz()

Pingback: ??? ??????()

Pingback: hawaiian-isles-coffee/100-pure-kona-coast-coffee-ground-7-oz()

Pingback: coffee beans()

Pingback: acheter des likes()

Pingback: ground coffee()

Pingback: party tents()

Pingback: keyword Uber Promotion()

Pingback: spiro michals attorney()

Pingback: iptv()

Pingback: best work from home companies()

Pingback: Miami, Ohio()

Pingback: goldenseal extract()

Pingback: butt plugs()

Pingback: look what i found()

Pingback: kona coffee()

Pingback: click resources()

Pingback: The MLS Listings()

Pingback: kona coffee()

Pingback: free apps for android()

Pingback: compact sleeping bag()

Pingback: Family lawyer()

Pingback: how to build an app()

Pingback: Miniclip.com()

Pingback: The MLS Homes For Sale()

Pingback: make your own app()

Pingback: perusahaan anti rayap()

Pingback: backlinks()

Pingback: kwatery nad morzem()

Pingback: free slots no download or registration()

Pingback: More hints()

Pingback: urgent dental()

Pingback: Compacting()

Pingback: new movies()

Pingback: hd wallpapers()

Pingback: rialudi()

Pingback: international news online()

Pingback: acheter followers twitter()

Pingback: знакомства с Украинскими девушками()

Pingback: zootopia 2016()

Pingback: film online 2016 free ua ru kz()

Pingback: acheter des likes facebook()

Pingback: undiscovered talents()

Pingback: Дивергент, глава 3: За стеной / Allegiant, Высотка / High-Rise,()

Pingback: earn money from home()

Pingback: gem residences floor plan()

Pingback: agence web montpellier()

Pingback: acheter des fans()

Pingback: try here()

Pingback: hawaiian coffee()

Pingback: kona coffee()

Pingback: kona coffee()

Pingback: coffee beans()

Pingback: coffee beans()

Pingback: Denver web designer()

Pingback: container homes()

Pingback: micro gps tracker()

Pingback: лучшие фильмы 2016 2016 года список новые фильмы()

Pingback: girne üniversite()

Pingback: gourmet coffee()

Pingback: kona coffee()

Pingback: kona coffee beans()

Pingback: farmers choice kona coffee()

Pingback: ground kona coffee()

Pingback: kona coffee k cups()

Pingback: earn money online()

Pingback: hualalai coffee()

Pingback: royal kona coffee()

Pingback: royal kona coffee()

Pingback: kona coffee()

Pingback: kona coffee()

Pingback: kona coffee()

Pingback: http://aftonbladet.se()

Pingback: kona coffee()

Pingback: Sell used hard drives()

Pingback: Florida Judgment Collection()

Pingback: Chicago Waste Management()

Pingback: Steel Mold for cement tile()

Pingback: лучшие фильмы года 2016()

Pingback: http://expressen.se()

Pingback: jykfqy abkmvs cvjnhtnm ,tp htubcnhfwbb()

Pingback: Garantiedividende()

Pingback: Strom()

Pingback: Colored Pill Binder()

Pingback: cheap huawei p9()

Pingback: lima()

Pingback: mypsychicadvice.com()

Pingback: http://gp.se()

Pingback: Free Train Games()

Pingback: Credit repair solutions()

Pingback: Free Alien?Games()

Pingback: Tarot()

Pingback: iPhone Wallpapers()

Pingback: coffee()

Pingback: http://www.coffeefromkona.com()

Pingback: http://www.konacoffeeinc.com()

Pingback: Find Out More()

Pingback: fuck google()

Pingback: fuck google()

Pingback: Ruksis780()

Pingback: fuck google()

Pingback: fuck google()

Pingback: fuck google()

Pingback: fuck google()

Pingback: http://vlt.se/()

Pingback: fuck google()

Pingback: porno izle()

Pingback: fuck google()

Pingback: fake taxi()

Pingback: porno izle()

Pingback: porno izle()

Pingback: 他媽的谷歌()

Pingback: 他妈的谷歌()

Pingback: http://imdb.com()

Pingback: porno()

Pingback: mobil porn()

Pingback: porno()

Pingback: floor lamination()

Pingback: Metering pumps for plastic industry()

Pingback: 他妈的谷歌()

Pingback: 他妈的谷歌()

Pingback: car detail san diego()

Pingback: Android()

Pingback: coffee from kona()

Pingback: more()

Pingback: 他妈的谷歌()

Pingback: 他妈的谷歌()

Pingback: 手錶手機色情()

Pingback: myprotein()

Pingback: لایسنس ویندوز سرور()

Pingback: peaberry coffee()

Pingback: film()

Pingback: check my blog()

Pingback: 我他媽的谷歌()

Pingback: Web Wealth System Scam()

Pingback: my company()

Pingback: check my blog()

Pingback: agen shobet()

Pingback: mls homes()

Pingback: ukraine girl kiev lviv()

Pingback: beylikdüzü escort()

Pingback: Fire Sale()

Pingback: ukraine girl kiev lviv 2016()

Pingback: how to make money()

Pingback: beylikdüzü escort()

Pingback: beylikdüzü escort()

Pingback: beylikdüzü escort()

Pingback: beylikdüzü escort()

Pingback: helou zis me()

Pingback: helou zis me()

Pingback: Web developers in new york()

Pingback: clic here()

Pingback: smartphone repair()

Pingback: pop over to these guys()

Pingback: Google()

Pingback: investigate this site()

Pingback: go to my blog()

Pingback: free slot games with bonus rounds()

Pingback: fukuidatumou()

Pingback: fukuidatumou()

Pingback: greek iptv()

Pingback: 他妈的谷歌()

Pingback: 色情管()

Pingback: clic()

Pingback: IM 体育()

Pingback: gourmet-hawaiian-coffee()

Pingback: www.best-coffee-inc.com()

Pingback: Google()

Pingback: beylikdüzü escort()

Pingback: www.coffee-beans-inc.com()

Pingback: my review here()

Pingback: saltwater fish()

Pingback: elder care richmond va()

Pingback: program indir()

Pingback: hop over to this website()

Pingback: e cig juice()

Pingback: SEO Norway()

Pingback: www.escortsinorlando.com()

Pingback: Buy Instagram Likes()

Pingback: indir ücretsiz()

Pingback: multilingual seo()

Pingback: http kmakehitz com()

Pingback: earning money()

Pingback: the beats store()

Pingback: 他妈的谷歌()

Pingback: عروض الموبايلات()

Pingback: hawaiian coffee company()

Pingback: gourmet coffee()

Pingback: hawaiian kona coffee()

Pingback: wholesale jackets()

Pingback: descargar programs()

Pingback: kitchen()

Pingback: descargar programs()

Pingback: illuziaobmana()

Pingback: Fidelity exams()

Pingback: earn money from home()

Pingback: free app maker()

Pingback: stainless steel coffee cup()

Pingback: beylikdüzü escort()

Pingback: IPhone screen repair 32127()

Pingback: Coquitlam condo()

Pingback: matures porn videos()

Pingback: Tablet Binder()

Pingback: interracial porn videos()

Pingback: Commercial Bakery Service()

Pingback: wildlife removal()

Pingback: izmir escort()

Pingback: Handyreparatur Bremen()

Pingback: zip lookup()

Pingback: escort kadıköy()

Pingback: HDKINOONLINE()

Pingback: fakir selim()

Pingback: 色情()

Pingback: Firmenaktien()

Pingback: Bayern()

Pingback: Soft Tip Darts()

Pingback: Boat Transport()

Pingback: Sac papier luxe()

Pingback: 7 color shower()

Pingback: porno izle()

Pingback: Queen Hair Company()

Pingback: farms for sale()

Pingback: anani siktim()

Pingback: anani siktim()

Pingback: why not try these out()

Pingback: CV()

Pingback: for sale by owner()

Pingback: find a boyfriend()

Pingback: brazzers porno()

Pingback: porno izle()

Pingback: fire pit table()

Pingback: Impacted Canines Ormond beach()

Pingback: refrigerated containers()

Pingback: Used cars()

Pingback: 他妈的谷歌()

Pingback: 牛混蛋()

Pingback: 黃牛()

Pingback: fotografía publicitaria()

Pingback: digital nomad job()

Pingback: Star Trek()

Pingback: supplies()

Pingback: Politics()

Pingback: vacation()

Pingback: friv()

Pingback: mattress for side sleepers()

Pingback: porn video tube, hard porn, streaming porn, hq porn()

Pingback: hqporn2016()

Pingback: mountain coffee classics()

Pingback: viagra pills()

Pingback: legitimate work from home jobs()

Pingback: tower garden companies()

Pingback: Piece Of Heaven()

Pingback: Лучшие фильмы()

Pingback: pornocu pic()

Pingback: Лучшие фильмы2()

Pingback: ТелефоновСамсунг2016()

Pingback: hot videos()

Pingback: finance()

Pingback: Precious Metals()

Pingback: siktir git()

Pingback: como instalar complementos en kodi()

Pingback: sunnyleone()

Pingback: sunnyleonelatest()

Pingback: toilehtml()

Pingback: tubepatrolporn()

Pingback: sikerler()

Pingback: Taxi Airport Innsbruck St. Anton()

Pingback: 오나홀릭()

Pingback: online virtual number buy for verification()

Pingback: Jaydani()

Pingback: embroidery thread()

Pingback: BSM20GP60()

Pingback: Ugoos UT4()

Pingback: life insurance lawyer()

Pingback: London ballet()

Pingback: how to make money()

Pingback: tampa bay magazine()

Pingback: افلام جديدة()

Pingback: oakley shop()

Pingback: rechargeable flashlight()

Pingback: virtual card online shopping()

Pingback: free virtual number()

Pingback: matka()

Pingback: Fenster()

Pingback: 可憐的私生()

Pingback: picccc()

Pingback: skypepsyxologmoskvakiev()

Pingback: gourmet kona coffee()

Pingback: silicone containers()

Pingback: Detention()

Pingback: jouer de la guitare()

Pingback: pittsburgh web design()

Pingback: gourmet hawaiian coffee()

Pingback: gourmet hawaiian coffee()

Pingback: gourmet hawaiian coffee()

Pingback: gourmet hawaiian coffee()

Pingback: custom paint()

Pingback: Home Automation Florida()

Pingback: viagra()

Pingback: saleforiphone()

Pingback: Home Security()

Pingback: education()

Pingback: poweful taweez for love()

Pingback: http://www.pinui-dira.co.il/()

Pingback: more info()

Pingback: details()

Pingback: baltic siker()

Pingback: baltic sikerr()

Pingback: baltic siker oç()

Pingback: Sexy buttons()

Pingback: baltic siker o.ç()

Pingback: Cheap Printed Legging Online()

Pingback: live auction info()

Pingback: VIIAINTERNATIONAL.COM()

Pingback: vispoets.com()

Pingback: ski resorts()

Pingback: how to make money on the internet()

Pingback: регистрация ооо в Киеве()

Pingback: Photography()

Pingback: mypsychicadvice()

Pingback: funny pictures()

Pingback: black magic()

Pingback: 注管理システム()

Pingback: kala jadu()

Pingback: home decor()

Pingback: Latex Inks distributor()

Pingback: skin beauty()

Pingback: satta matka()

Pingback: SATTA MATKA()

Pingback: panel doors()

Pingback: East Hartford Taxes()

Pingback: woodworking machinery()

Pingback: Download PC Games()

Pingback: Play games online()

Pingback: questa pagina()

Pingback: http://www.autoprotectionoptions.com/autoprotection-homepage()

Pingback: consultant()

Pingback: tablet repair()

Pingback: SEO services in Lahore()

Pingback: More information()

Pingback: more information()

Pingback: download()

Pingback: SEO services in Lahore()

Pingback: Download PC Games()

Pingback: Free download pc games()

Pingback: Mens Divorce Law Firm()

Pingback: satta matka()

Pingback: robert()

Pingback: how to fix garage door()

Pingback: visit site()

Pingback: hawaii volcano lava rock()

Pingback: retirement benefits cut by congress()

Pingback: light deprivation greenhouse()

Pingback: fuck googlee()

Pingback: Our Work-AtlantaPiano()

Pingback: Pinganillo()

Pingback: áîëüøå èíôîðìàöèè()

Pingback: kinoklub()

Pingback: Videos for The Miracle Pianist()

Pingback: SEO services in Lahore()

Pingback: T-Shirts bedrucken lassen()

Pingback: paper fans()

Pingback: cork coasters()

Pingback: JUAL Pompa Air Tenaga Surya paket lengkap LORENTZ()

Pingback: Wood fired pizza oven Pizza Party()

Pingback: Denver office space()

Pingback: injection diet()

Pingback: Cash for car melbourne()

Pingback: more()

Pingback: Business reading()

Pingback: Visit Website()

Pingback: drama2016()

Pingback: Fenster und Turen()