Amsterdam JSNation takes us to JavaScript church and we are believers

A couple of Phusioneers attended Amsterdam JSNation last weekend (May 31 - Jun 1), hosted in the breathtaking Zuiderkerk church. What follows is an utterly subjective collection of favorite and/or memorable talks and anecdotes.

JavaScript workshops: Testing apps and debugging Vue.js

Day 1 of the JavaScript conference was all workshops and pre-party. While coworker Luuk attended 'Testing JavaScript Applications' by Ivan Jovanovic, I enrolled in the 'Vue.js HackJam Workshop', put together by the Hackages team. The concept was as simple as it was brilliant. They gave us a broken application with the assignment to fix it (and learn more about Vue while you're digging through the docs).


Vue.js HackJam Workshop

I'm only just getting back into to JavaScript after having used it for the bare minimum only. It was all quite tricky still, but Vue's error messages prove to be an exceptional guide.

Paradigms, Pinterest & Best Practices

Day 2 started with the opening keynote by the Douglas Crockford, the man that popularized JSON and gave us JSLint and other beautiful things. Senior JavaScript Architect at PayPal, Douglas reminisced about the good and the bad bits of old paradigms and casually mentioned the Seif Project - GitHub | http://seif.place/ (ironically not https) - and Parseq (JavaScript's library for managing asynchronicity in server apps) as part of the 'new paradigm'.

Douglas: "The universe is completely asynchronous, fully distributed, and highly parallel. Our programming model should embrace this truth. 'Nested callbacks' and 'promises' have been terrible means to the end (of managing asynchronicity)."


Douglas Crockford

In 'Bringing Mobile Web back to Life', Imad Elyafi, previously with Facebook, talked us through the rebuilding of the Pinterest mobile web experience for authenticated users. Most important take-aways for me were his "metrics do not measure sentiment" and "beware of legacy assumptions". For Pinterest's case, reasons to fork for mobile outweighed making the app responsive.

Touching on PWA and Service Workers briefly, Imad goes on to talk about the several wins of the new code base, including navigation transitions no longer being blocked on the network, touch optimizations (navigation bar items give visual feedback) and 'dominant color placeholders', taking the dominant color of the image and displaying that while it loads. Imad even got to show some benchmarks to prove loading time (also for repeat loads) is way down.

Fatih Acet went on to share 'Vue JS Best Practices'. At GitLab they've been using Vue.js in production for over a year. While refactoring Fatih learnt a thing or two about state management, reactivity and tooling and now advocates single file components and scoped CSS. He also makes a good case for v-show instead of v-if for conditional rendering, which has a higher initial render cost but "will pay off in the long run".

Logging the brain and sorting socks

What if you could log your brain to the console, typing with your brain signals? In his talk Armagan Amcalar, sporting a wireless EEG headset, shows how to read signals from the brain - the 'ultimate hack'. Armagan's talk is best experienced live, but thankfully he has recorded his work, proving that JavaScript is powerful enough to read and parse your brain's API, here and here (and other places too).

Formatting for machine learning Armagan says he uses 'JavaScript all the way up', Native C add-ons for the headset, Node.js for processing, Electron as the wrapper, Vue.js for front-end, brain.js for neural networks and MATLAB as the server for the eig function.

Claudia Hernández in her talk, benchmarks the Array#sort method against sorting algorithms implemented by engines used by Node such as Chrome's V8, for functionality and performance. Claudia wonders why nobody ever seems to wonder which sorting algorithm is used in JavaScript's native sort function. Spidermonkey uses insertion sort, there's merge sort for nitro, both stable1 by nature, and Quick sort for v8. Turns out Array#sort (JavaScript's native sorting function) is slower than insertion and merge sort, with quick sort being the fastest when dealing with a lot of elements (think 100.000 and up). For a small number of elements insertion sort outperforms the other algorithms in Claudia's benchmark.

Scaling to callback heaven (not hell)

"Programming with callbacks has been every JavaScript programmer's struggle since... always", says Andre Staltz. 'Callback hell' is the reason why we came up with promises, observables and other tools to avoid using callbacks directly. Instead Andre embraces callbacks in a pattern fondly named 'Callbags'. A natural born entertainer, Andre takes us all on an exhilarating live coding adventure. I particularly enjoyed the Callbag wiki, an ever-increasing list of callbag utilities by the community, for the community.

Asim Hussain's talk was advertised to be about scaling a SPA (single page app) and started out fun with a podcast recommendation (NPR Planet Money) and trading Twitterbot BOTUS. But it quickly digressed into lot of mentions of Azure and Microsoft's serverless architecture Azure Functions, which is the case all too often with a Microsoft employee on stage (Asim is a Cloud Developer Advocate at Microsoft).

Amsterdam JSNation celebrates open source software and hosted an award show just after lunch. And the winners are...

Breakthrough of the year: TensorFlow.js
Most exciting use of technology: isomorphic-git
Productivity booster: lint-staged
Most impactful community contribution: Storybook
Side project of the year: WarriorJS

We had a ton of fun at Amsterdam JSNation and the above certainly does not do the conference justice. Make sure to check out the talks for yourself. Videos from the Priests Hall track are already up on the Amsterdam JSNation YouTube channel.

1. A sorting algorithm is said to be stable one in which equivalent elements retain their relative positions after sorting.