ME FIRST GAMES
Menu

games for me and you

Tabs vs Spaces

6/17/2020

0 Comments

 
Picture
Yes, this is a thing. Hold onto your butts and welcome to Tabs vs Spaces. The contrived but important argument.
📌 The thing to stress here is consistency and you should adhere to the standard for whatever project you're working on.
📌 For new projects, you should define a clear standard of whether tabs or spaces will be used. Alignment issues can be caused when you mix the two, just ask Python.
📌 Tabs can easily be customized by programmers, setting them to two, four, or please don't, eight space width. If you're not careful with your coding style, changing this setting may break text alignment in your codebase. e.g. function parameters being aligned with tabs and spaces.
📌 A programmer with poor eyesight may use larger font sizes and a smaller tab width to save screen space. This kind of adjustment can't be done using spaces.
📌 Spaces set a visual standard that will be consistent among all editors and external tools. You don't have to worry about 8 space tabs in your diff tool or Github.
📌 Tabs saving disk-space is negligible in 2020.
📌 Smart tabs can be used in may IDE's, allowing you to hit tab and automatically insert x amount of spaces for you.
⭐️ I've used both in different projects for many years and didn't find any real productivity boost from either.
⭐️ I've grown to really dislike alignment coding styles that you can use with spaces. I prefer indentation.
⭐️Many legacy projects and third party libraries have text alignment and use spaces. Dive into external code and it may appear incorrectly if you a different tab-width.
⭐️ Headaches come from people using different tab space width. Even with a style guide, alignment issues and spaces will slip through the cracks with many devs working on the same project over time.
⭐️ After 15 years of programming, my preference is smart tabs, tab-width 2. However, I'm flexible on the matter. Use the best tool for the job.

0 Comments



Leave a Reply.

    Picture
    Me First Games is an independent game studio dedicated to creating unique and bizarre video games.
    GAMES HERE

    Red Matter

    Star Impact is an upcoming adventure platformer coming to PC, Mac, and Linux.

    Archives

    April 2021
    February 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    June 2020
    May 2020
    April 2019
    March 2019
    December 2018
    April 2018

    Categories

    All

    RSS Feed

Copyright (c) 2020 Me First LLC
  • STU the First AI
  • Blog
  • Contact
  • Unity Tools
    • Hierarchy Comments
  • STU the First AI
  • Blog
  • Contact
  • Unity Tools
    • Hierarchy Comments