https://slid.es/swatinem/anti
Arpad
viennajs regular
nsid (no shaving in december)
“recreational coder”
mainly for fun, but also for money :-(
https://github.com/Swatinem
a lot
Let me tell you a secret about myself
I have a sixth sense
And I see a LOT of wrong/ugly code :-(
but a lot worse
grunt.loadNpmTasks('grunt-contrib-jade');
"dependencies": {
"grunt-contrib-jade": "*",
"grunt": "*" },
jade: {
compile: {
files: {
'index.html': ['index.jade'],
}, options: {
} },
https://github.com/gruntjs/grunt-contrib-jade/blob/master/package.json
"dependencies": {
"jade": "~0.34.1",
"grunt-lib-contrib": "~0.6.1"
},
https://github.com/visionmedia/jade/blob/master/package.json "version": "0.35.0",
it just calls an executable
https://github.com/gruntjs/grunt-contrib-compass/blob/master/tasks/compass.js#L15
var child = grunt.util.spawn({
cmd: args.shift(),
args: args
}, function (err, result, code) {
just use `make`!
make sucks, right?
for large projects with 10k+ files
where files need to be processed individually
and have implicit dependencies
basically C projects
for js projects!
… grunt has `watch`
$ which watch
$ man watch
https://github.com/visionmedia/watch
This project is very similar to original watch(1) implemented in 1991, differences include:
* ansi escape sequences (colors etc)
* terminal is not cleared
* lower default interval of 1s
* millisecond interval resolution
on OSX 10.8: https://github.com/echaouchna/watch$ watch make -s
$ watch mocha --bail --reporter minimal
define([ "require", "jquery", "blade/object", "blade/fn", "rdapi",
"oauth", "blade/jig", "blade/url", "dispatch", "accounts",
"storage", "services", "widgets/AccountPanel", "widgets/TabButton",
"widgets/AddAccount", "less", "osTheme", "jquery-ui-1.8.7.min",
"jquery.textOverflow"],
function (require, $, object, fn, rdapi,
oauth, jig, url, dispatch, accounts,
storage, services, AccountPanel, TabButton,
AddAccount, less, osTheme) {
});
Anybody still following?(function (root, factory) {
'use strict';
// Universal Module Definition (UMD) to support AMD, CommonJS/Node.js,
// Rhino, and plain browser loading.
if (typeof define === 'function' && define.amd) {
define(['exports'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports);
} else {
factory((root.esprima = {}));
}
}(this, function (exports) {
}));
where the hell do i put my code?require.config({
paths: {
'jquery': 'libs/jquery/jquery.min',
'underscore': 'libs/underscore/underscore',
'backbone': 'libs/backbone/backbone',
'bootstrap': 'libs/bootstrap/bootstrap',
},
shim: {
jquery: {
exports: "$"
},
underscore: {
exports: "_"
},
backbone: {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
bootstrap: {
deps: ['jquery'],
exports: 'Bootstrap'
},
}
});
`component` https://github.com/component/component
or
`node-browserify`
but luckily, AMD already lost :-)
https://twitter.com/rakesh314/status/387336215290449920
So, AMD appears to have lost. CommonJS is the way to go. ComponentJS vs. Browserify, it seems. And I'm tending towards the latter.
more like a blast from the past
roll your own code
use lightweight models
and observer/mediator/event emitter pattern
use explicit and clear code
which one can understand and maintain
`component` :-)
use libraries
All or nothing
Stuck with it
Tries to do everything at once
Use what you want
Easily exchangable
(Usually) does one thing and does it right
it made DOM fun!
it was partly responsible for the webdev revolution
we have:
querySelector(All)
CSS transitions/animations
requestAnimationFrame
classList
ES5 (with stupid things like [].slice.call(ElementList) )
module system
use standards
small libraries just for the things you need
var request = window.indexedDB.open("toDoList", 4);
request.onerror = function(event) {
};
request.onsuccess = function(event) {
db = request.result;
};
Whats wrong with this code?window.indexedDB.open("toDoList", 4, function (err, db) {
if (err) {
…
return;
}
…
});
http://www.dict.cc/englisch-deutsch/to+challenge.html
etw. infrage stellen
etw. (kritisch) hinterfragen
most memorable thing:
“Can we do any better?”
Resonates deeply with who I am
`component`?