Getting over Frameworks

Getting over Frameworks without making an ass of yourself

Getting over Frameworks
without making an ass of yourself

  1. Setting the mood
  2. Benefit
  3. Getting it right
  4. Moving on

1. Setting the mood

1. Setting the mood: Your workflow soundtrack

If your tools were songs

My Love

What's Going On?

Satan sez kill

Imagination – Just An Illusion

Love / Hate?

A relation.

♣︎
Intermission
♣︎

What do you mean by “frameworks” anyway?

What do you mean by “frameworks” anyway?

jQuery, Bootstrap, React, Foundation…

What do you mean by “frameworks” anyway?

jQuery, Bootstrap, React, Foundation, SASS, Less, Coffeescript, PostCSS, COMPASS, BEM, OCSS, ITCSS, SMACSS,
Laravel, Symphony, Django, Drupal, Wordpress?
Deployment Workflows?

What do you mean by “frameworks” anyway?

Simple!

What do you mean by “frameworks” anyway?

Simple!
We're talking Libraries, Software, IDEs, Platforms, Methodologies, Philosophies, Tools

What do you mean by “frameworks” anyway?

Simple!
We're talking Libraries, Software, IDEs, Platforms, Methodologies, Philosophies, Tools
– sort of.

What do you mean by “frameworks” anyway?

“I know it when I see it.”

— Potter Stuart

2. Benefits

2. Benefit: Using frameworks

  • usually comes with documented functionality + components
  • unifies developer approaches
  • takes away platform philosophy
  • enforces codes styles / best practice
  • enforces an extension system
  • shims over edge cases
  • sometimes shims over several platforms
  • eases learning curve on platform

2. Who benefits?

  • Designers and Concepters
  • Project Managers
  • System Developers
  • Platform newcomers
  • Prototyping Devs
  • Lazy Devs

Yet

2. Benefit: Dump jQuery!

  • Lea Verou:
    jQuery considered harmful
  • Eric Wastl: Vanilla JS
  • Patrick Kunka:
    A Year Without jQuery
  • You might not need jQuery
  • Ray Nicholus:
    You don’t need jQuery!

2. Benefit: Dump Bootstrap!

  • Marta Sztybor:
    Why you misuse Bootstrap and why you should stop doing this
  • Belén Albeza:
    You might not need a CSS framework

2. Benefit: Dump React!

  • Alex Sharp:
    Please, Please Don’t Use “CSS in JS”
  • Krasimir Tsonev:
    In search of the perfect JavaScript framework
  • Jean-Jacques Dubray:
    https://www.infoq.com/articles/no-more-mvc-frameworks
  • You (probably) don't need a JavaScript framework

2. Benefit: Dump your CMS!

  • Phil Hawksworth:
    I can smell your CMS
  • Bud Parr:
    The No-DB Landscape
  • Jerod Santo:
    Trello as a CMS
  • Andy Robinson:
    An Incremental Approach to Content Management Using Git

2. Benefit: Dump all frameworks!

  • Ben Northrop:
    Reflections of an "Old" Programmer
  • Peteris Krumins:
    Frameworks don't make much sense
  • Mike Perham:
    Kill Your Dependencies
  • tef:
    Write code that is easy to delete, not easy to extend.

Dont´t forget:

“In the end it´s all about what works for you. […] For me personally, I found that I get faster and better, the more I know about the tools I am using.”

— Bastian Allgeier

3. Getting it right

3. Getting it right

Moving on is easier if you had a good start

3. Getting it right: That Stackoverflow response

“Just use jQuery”

“Just use Bootstrap”

“Just use React”

That Stackoverflow response last season

“Just use mooTools”

“Just use 960.gs”

“Just use Angular”

That Stackoverflow response the season before

“Just use prototype.js”

“Just use YAML”

“Just use backbone.js”

3. Getting it right: Using it right

That gut feeling.

3. Getting it right: Using it right

Gut feeling > Stackoverflow*

* Ok-ok – for the uneducated answers anyway

3. Getting it right: Using it right

  • How does the framework describe itself?

  • Is it called Boilerplate, Kickstarter, Foundation, Bootstrap, hackable?

  • Then it's may not be a good idea to make it a deep dependency

  • Does it come with the features you need? Or are you bending the system from the start on?

3. Not getting it right

3. Not getting it right

Ok, so it´s a mess

3. Ok, so it´s a mess

Starting from scratch:
A failure* recipe**.

* Dirk Gadsden ** Joel Spolsky

3. Ok, so it´s a mess

The long goodbye:
Refactoring*.

* Joel Spolsky

3. Ok, so it´s a mess: Refactoring

  • remove framework components
    (base styles, unused modules)
  • kill dependencies
  • Don't reinvent the markup
  • “strangle” unused code
  • remove elaborate shims
  • use straw puppet code to replace unnecessary steps (eg. for Compass or legacy build tools)
  • keep built/static copies for
    tests and research
  • diff against original code

4. Moving on

4. Moving on

“I´d rather be lonely than happy with somebody else”

— Gus Kahn

4. Moving on

Your´re not lonely, though.

4. Moving on

Every relation leaves marks.

4. Moving on: Leaving a mark

1. Good ideas stick.

2. Good tools ease transition.

4. Good ideas stick

4. Good ideas stick: jQuery in a nutshell

window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
    this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = NodeList.prototype.addEventListener = function (name, fn) {
  this.forEach(function (elem, i) {
      elem.on(name, fn);
  });
}

— Paul Irish

4. Good ideas stick: Building your own grid

4. Good ideas stick: Your next CMS

  • Grasp abstractions that are applicable in many other systems.
  • Use the same UX wording for easier transition
  • Organize your templates in a way that they don't depend on system plugins.

4. Good ideas stick: Copying the interface

  <?php
    $years = page('projects')->children()->groupBy('year');
    foreach($years as $year => $items): ?>
        <h2><?php echo $year ?><h2>
        <ul>
          <?php foreach($items as $item) : ?>
          <li><?php echo $item->title() ?></li>
          <?php endforeach; ?>
        </ul>
    <?php endforeach ?>

It'll be alright.

jobs@compuccino.com

Thank You!

Questions?
feedback@stolzenhain.net

Check out the slides at
www.stolzenhain.net/slides/getting-over-frameworks