Message from JavaScript discussions

May 2017

— 

http.Server((req, res) =>
fs.createReadStream('.' + req.url)
.on('error', err => console.error(err.name + ': ' + err.message))
.pipe(res))
.on('error', err => console.error(err.name + ': ' + err.message))
.listen(1778)

Message permanent page

— 

As it often goes in unsegmented functional programming, you need some OOP and encapsulation eventually to reduce complexity

— An event bus and scheduler, specifically

— 

const safe = (e) => (e.on('error', err => console.error(err.name + ': ' + err.message)), e);

safe(http.Server((req, res) =>
safe(fs.createReadStream('.' + req.url))
.pipe(res)))
.listen(1778)

Message permanent page

— Very lispy

— Sexy

— I kind of like sequences in JS

— It's how you get shit done

— (a, b, c)
as opposed to

a;
b;
c;

— That right there is already leagues ahead of most JS developers imo

— Heh

— Imperative vs functional