Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Even Rubber Duck knows JS better than you!
Search
Nikita Galkin
September 08, 2018
Programming
130
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Even Rubber Duck knows JS better than you!
Nikita Galkin
September 08, 2018
More Decks by Nikita Galkin
See All by Nikita Galkin
React applications Failures
galkin
0
310
Node.js Development in 2022
galkin
0
860
Cloud Native Approach for Node.js Developers
galkin
0
100
Deep Dive Into NestJS at FWDays
galkin
0
540
Node.js Recipes: Road to Production.
galkin
0
210
Auth for React.js App
galkin
1
170
Web Developer Toolbox at 2020
galkin
1
250
Node.js Development in 2020: trends and techniques
galkin
0
580
Backend For Frontend: The Missing Manual at Devoxx Ukraine
galkin
1
180
Other Decks in Programming
See All in Programming
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
7.2k
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
260
20260623_Loop Engineeringで自分の分身の問い合わせBotを作る
ryugen04
0
110
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
ローカルLLMでどこまでコードが書けるか -縮小版 / How much code can be written on a local LLM Shortened
kishida
2
170
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
150
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
4
960
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
290
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
17
8.4k
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
240
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.7k
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
230
Featured
See All Featured
Balancing Empowerment & Direction
lara
6
1.2k
Practical Orchestrator
shlominoach
191
11k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
500
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
320
The Cult of Friendly URLs
andyhume
79
6.9k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.4k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Claude Code のすすめ
schroneko
67
230k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
1k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Transcript
Even Rubber Duck knows JavaScript better than you! by Nikita
Galkin Sep 8, 2018
Bug on line 7 Quack Quack
Your code is sucks Quack Quack
None
class Employee { constructor(role) { this.role = role; } get
mainResponsibility() { switch (this.role) { case 'Developer': return 'Write Code'; ...
Turn and Write Code
7 Hiring process 1. HR-interview 2. CV-screening 3. Technical interview
4. Interview with the client Dev Team
Upgraded Hiring process 1. HR-interview 2. CV-screening 3. Live coding
as fail fast check 4. Technical interview 5. Test task as second chance 6. Interview with the client 8
Live coding • 20 minutes only • Remote via skype
with screen-sharing • Without bla-bla bullshit • 4-6 trivial JS tasks at JSfiddle • Easy to see does the code work or not • Googling or Asking is okey 9
Expectations Reality VS
None
You lost context Quack
const obj = { fullname: 'Yellow Duck', getFullname: function() {
return this.fullname; } }; const nameGetter = obj.getFullname; // @todo fix this line document.getElementById('name').innerHTML = nameGetter();
const obj = { fullname: 'Yellow Duck', getFullname: function() {
return this.fullname; } }; const nameGetter = obj.getFullname; // @todo fix this line document.getElementById('name').innerHTML = obj.fullname;
const fullname = 'Yellow Duck'; const obj = { getFullname:
function() { return fullname; } }; const nameGetter = obj.getFullname; // @todo fix this line document.getElementById('name').innerHTML = nameGetter();
const obj = { fullname: 'Yellow Duck', getFullname: function() {
return this.fullname; } }; const nameGetter = obj.getFullname.bind(obj); document.getElementById('name').innerHTML = nameGetter();
17
Just return new promise Quack Quack
function wait(timeout) { // @todo implement } wait(1000) .then(() =>
{ document.getElementById('answer').innerHTML = 'Done!'; });
function wait(timeout) { return { then: function(callback) { callback(); }
} } wait(1000) .then(() => { document.getElementById('answer').innerHTML = 'Done!'; });
function wait(timeout) { setTimeout(function() {}, timeout); } wait(1000) .then(() =>
{ document.getElementById('answer').innerHTML = 'Done!'; });
function wait(timeout) { setTimeout(function() { return Promise(); }, timeout); }
wait(1000) .then(() => { document.getElementById('answer').innerHTML = 'Done!'; });
Release the Quacken!
function wait(timeout) { return new Promise(r => setTimeout(r, timeout)); }
wait(1000) .then(() => { document.getElementById('answer').innerHTML = 'Done!'; });
Use data structure Quack Quack
const unfiltered = [1, 2, 3, 5, 1, 5, 9,
1, 2, 8]; const filtered = removeDuplicates(unfiltered); // filtered should be equal [1, 2, 3, 5, 9, 8] document.getElementById('answer').innerHTML = filtered; function removeDuplicates(arr) { // @todo implement }
const unfiltered = [1, 2, 3, 5, 1, 5, 9,
1, 2, 8]; const filtered = removeDuplicates(unfiltered); // filtered should be equal [1, 2, 3, 5, 9, 8] document.getElementById('answer').innerHTML = filtered; function removeDuplicates(arr) { return arr.filter(...) }
Ducks win!
const unfiltered = [1, 2, 3, 5, 1, 5, 9,
1, 2, 8]; const filtered = removeDuplicates(unfiltered); // should be [1, 2, 3, 5, 9, 8] document.getElementById('answer').innerHTML = filtered; function removeDuplicates(arr) { const obj = {}; for (const el of arr) { obj[el] = true; } return Object.keys(obj); }
30 Googling is better, than learning JS
const unfiltered = [1, 2, 3, 5, 1, 5, 9,
1, 2, 8]; const filtered = removeDuplicates(unfiltered); // filtered should be equal [1, 2, 3, 5, 9, 8] document.getElementById('answer').innerHTML = filtered; function removeDuplicates(arr) { return Array.from(new Set(arr)); }
32 HAPPY CODING WITH JAVASCRIPT! You can find me at
twitter as @galk_in Slides are available at speakerdeck.com/galkin or at my site galk.in