DIRTY JS CSS

The Dirty concept

Codes, codes in general, have to be perfect, to respect rules and structures in order to properly work.

But the majority of the codes can work even if they are badly written, if they are dirty.

Lazy, you said lazy ?

If it works, it works no matter how. Time is precious, don't waste it when you want to prototype something. Just write it.

You don't need to write perfect codes to see an experiment or a live test.

You just need to know some basics. If you are able to write a simple

alert(foo)
so you can write dirty codes.

Advantages ?

The only advantage I can see, is to make something work as fast as you can, no matter how.

Examples

Regular Js

$(document).ready(function(e){
           e.preventDefault();
           var el = $('#element');
           alert(el);
        });

Dirty Js

alert('#element')

Regular CSS

ul li{
    display:block;
    border:3px solid red;
    background:blue;
    }

Dirty CSS

ul li{
    display:block;
    border:1px solid;
    background:green;
    background:blue !important;
    }

Basically, the codes above returns the same result, but the first one respect rules, and the second is just Dirty Javascript or Dirty CSS, but works too.