
Ask HN: Is it dumb to line up your code eg. semi-colons - ge96
At this time this is the worst for me with CSS, I keep ligning up my colons so they&#x27;re all aligned (per group eg. a class)<p>I also do this with arrays&#x2F;general assignments (aligning equal signs) I think I understand this doesn&#x27;t matter for compiling, regarding minifying these spaces would be a waste.<p>I do feel the &quot;slow-ness&quot; when I&#x27;m sitting there banging away at the space key. I use 2-character spacing instead of 4.<p>I don&#x27;t know it looks good to me... I&#x27;m just wondering if I should get rid of the habit.<p>Example:<p>CSS<p>.square {<p><pre><code>  position         : relative;

  width            : 300px;

  height           : 150px;

  display          : flex;

  align-items      : center;

  justify-content  : center;

  background-color : white;

}</code></pre>
======
cpburns2009
While it seems nice and neat at first, it can easily become messy because
inevitably you'll end up with a long property name that messes up the style.
Say you want to round the top borders. You either end up with an additional 7
space wide alignment:

    
    
        .square {
          position                : relative;
          width                   : 300px;
          height                  : 150px;
          display                 : flex;
          align-items             : center;
          justify-content         : center;
          background-color        : white;
          border-top-left-radius  : 10px;
          border-top-right-radius : 10px;
        }
    

Or you end up with an inconsistent alignment:

    
    
        .square {
          position         : relative;
          width            : 300px;
          height           : 150px;
          display          : flex;
          align-items      : center;
          justify-content  : center;
          background-color : white;
          border-top-left-radius : 10px;
          border-top-right-radius : 10px;
        }
    

If you go for inconsistent alignment, where is the cutoff? I eventually broke
myself of the habit trying to align the right side. It's too much effort to
manage for something trivial.

~~~
ge96
Yeah that's the problem, you add a longer property and then oh no, gotta go
back and bang in the space key some more. Oh man...

Even variable declarations and JSON? I don't know...

The problem too is when you work on other people's code spaced differently and
no alignment at all. Damn.

