You’re doing it wrong: Javascript, CSS, UI & UX Lessons Learned

Short and sweet: You’re doing it wrong. Your Javascript is too “clever”, and will be a maintenance nightmare. Read the docs. No really, read them. You’ve been adding inline padding styles to ‘fix’ your elements because you didn’t read the docs. Worse yet, you simply didn’t take the time to do a couple searches before you vomited code all over the branch.

Technical debt, you are thy muse. 

Understand, nobody memorizes documentation before starting to code. They do, however, keep them open and search there first. Using Bootstrap? You should have a tab with GetBootstrap.com open constantly. Using AngularJS? Search on.

Here you will find every core resource (as in links, yo) I use daily designing Javascript & CSS, UI & UX. You might find the occasional C#/.Net tip as well.  But, at its core, this post will serve as a repository of things not to do.

I mean it. Don’t do them.

Each section will start by pointing out your deceit, your lies, and your damn lies. If I feel generous I may explain the right way. However it’s most likely you’ll get a link to the part of the documentation I used to determine the right way. And, yes, there is a right way.

 

 

Bootstrap

Want proof I know you didn’t read the documentation? You put a column inside another column without a row. Don’t do that.

  • Learn to use col-*-12 and quit making margin/padding classes.
  • If it’s complicated you’re doing it wrong.
  • Quit screwing up forms. Copy, paste, imitate. It’s not a science.
  • Use bootlint, save me the hassle.

AngularJS

$http’s .success() & .error() taught you how to avoid Promises. Don’t use them as proof you understand Angular. You’re doing it wrong

  • Nice 2000 line controller you have there. Abstract much?
  • You said you understood MVC. You lied.
  • HTTP has all the error codes we need. Quit making up bullshit.
  • Router resolves… yeah I figured. Go learn.

Kendo UI

Why did you extend the grid with jQuery? No, not an Angular directive either. Go look up their events your damn self. Did you even look at their documentation?

  • DataSources can do that. Problem is you keep researching the Grid. Read
  • Unsupported means ‘Don’t do that.’… Don’t do that.
  • By all means, bring in some other control to extend Kendo’s widgets. It’s not like they haven’t abstracted everything and thoroughly tested the pieces for exactly this sort of situation or anything. We pay for the commercial version purely as a legality….  </sarcasm>

As soon as I’m done balming this peak up I’ll have more.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s