Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Drawing the line between 3rd party and custom code

Drawing the line between 3rd party and custom code

Glenn Reyes

October 11, 2019
Tweet

More Decks by Glenn Reyes

Other Decks in Programming

Transcript

  1. Vincent van Gogh “Great things are done by a series

    of small things brought together.” @glnnrys
  2. // $(el).toggleClass(className) function toggleClass(el, className) { if (el.classList) { el.classList.toggle(className);

    } else { var classes = el.className.split(' '); var existingIndex = classes.indexOf(className); if (existingIndex >= 0) classes.splice(existingIndex, 1); else classes.push(className); el.className = classes.join(' '); } } youmightnotneedjquery.com @glnnrys
  3. // $(el).toggleClass(className) var classes = el.className.split(' '); var existingIndex =

    classes.indexOf(className); if (existingIndex >= 0) classes.splice(existingIndex, 1); else classes.push(className); el.className = classes.join(' '); } @glnnrys
  4. // $(el).toggleClass(className) var classes = el.className.split(' '); var existingIndex =

    classes.indexOf(className); if (existingIndex >= 0) classes.splice(existingIndex, 1); else classes.push(className); el.className = classes.join(' '); } 🧐 @glnnrys
  5. // $(el).toggleClass(className) function toggleClass(el, className) { if (el.classList) { el.classList.toggle(className);

    } else { var classes = el.className.split(' '); var existingIndex = classes.indexOf(className); if (existingIndex >= 0) classes.splice(existingIndex, 1); else classes.push(className); el.className = classes.join(' '); } } @glnnrys
  6. Make good decisions Make clean decisions Make right decisions Make

    smart decisions Make reasonable decisions @glnnrys
  7. Everytime we add more code into our library we increase

    the spectrum for new bugs @glnnrys
  8. One day old code becomes legacy. And if they are

    great, we'll enjoy using older code even more. @glnnrys
  9. “ ” Kent C. Dodds We should be mindful of

    the fact that we don't really know what requirements will be placed upon our code in the future. @glnnrys