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

Code like a #FashionVictim

Code like a #FashionVictim

Beautiful code with CoffeeScript, Jade, LESS

53d87cec9fec3602638fafeaf79b9c96?s=128

David Nowinsky

April 18, 2014
Tweet

Transcript

  1. Code like a #FashionVictim Beautiful code with CoffeeScript, Jade, LESS

    Atelier technique #3 18 avril 2014
  2. Hello David Nowinsky @davinov

  3. Browers are like old trees...

  4. Browers are like old trees... New things HTML5 CSS3 Old

    roots JavaScript HTML CSS
  5. HTML, JavaScript & CSS are cool

  6. HTML, JavaScript & CSS are cool but...

  7. HTML, JavaScript & CSS are cool but... #FashionPolice

  8. fs.readdir(source, function(err, files) { if (err) { console. log('Error finding

    files: ' + err) } else { files.forEach(function(filename, fileIndex) { console. log(filename) gm(source + filename).size( function(err, values) { if (err) { console. log('Error identifying file size: ' + err) } else { console. log(filename + ' : ' + values) aspect = (values.width / values.height) widths. forEach(function(width, widthIndex) { height = Math.round(width / aspect) console. log('resizing ' + filename + 'to ' + height + 'x' + height) this.resize(width, height).write(destination + 'w' + width + '_' + filename, function(err) { if (err) console. log('Error writing file: ' + err) }) }.bind( this)) } }) }) } }) HTML, JavaScript & CSS are cool but... #WTF
  9. HTML, JavaScript & CSS are cool but... #PleaseDont

  10. This is beautiful code def complex_function (a, b, c): if

    not a: return None # Raising an exception might be better if not b: return None # Raising an exception might be better if not x: # Some Plan-B computation of x return x # One single exit point short clean use indentation
  11. But bowsers don’t run it :-(

  12. Welcome your saviors

  13. JavaScript without the mess

  14. HTML clean and readable

  15. What CSS should be

  16. Make up with the browser ? ?

  17. Make up with the browser or or

  18. Real life examples

  19. Merci David Nowinsky @davinov Code like a #FashionVictim