25

Converting spaces to tabs made my file 10% smaller (5050 characters to 4500).

Either good argument against spaces or my code with compulsive indentation disorder.

Comments
  • 8
    If you're working with windows line endings (CR/LF) you could change to Mac (CR) or unix style endings (LF), that will save you another percent.

    And depending on the language you use, you may get rid of nearly all linefeeds to reduce file sizes even more.

    Next step would be naming everything with just one or two letters. There you are, next 30-40%.
  • 1
    @ddephor yeah there was a blog post on freecodecamp about those two characters variables.

    https://medium.freecodecamp.org/red...
  • 0
    If it's JS project then it doesn't matter after you minify.
  • 1
    @ddephor so...minification?
  • 1
    Some call it obfuscation.
  • 4
    @ddephor Don't use CR, that's deprecated even on Mac now. Mac and *nix all use LF now. Windows is the only oddball.
  • 0
    @ddephor All variable, class and method names should be as few characters as possible, alphabetically. a, b, ... z, A, B, ... Z, aa, ab, ... aA, aB, ...
  • 1
    @ddephor Obfuscation is different. It means making the code hard to understand or figure out—hiding it for intellectual property reasons usually.
  • 0
    If it's JS use Closure Compiler. It's so great.
  • 1
    Richard Kendricks will not dump you for sure #siliconvalley
  • 0
    @devios1 'twas only a joke
  • 0
    @devios1 Good to know that Apple has left the dark side of line endings.

    But I suppose Microsoft will never change, Notepad only supports CR/LF
  • 0
    @620hun What makes Closure Compiler better than other minifiers?
  • 1
    @SpectralKH it can do some really advanced things. By default it minfies and simplifies, but it can also remove dead code, or merge functions.
  • 0
    Tabs sucks my eyes since the beginning....
Add Comment