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
320
Node.js Development in 2022
galkin
0
860
Cloud Native Approach for Node.js Developers
galkin
0
110
Deep Dive Into NestJS at FWDays
galkin
0
540
Node.js Recipes: Road to Production.
galkin
0
220
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
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
4
1.9k
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
160
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
4
380
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
590
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
450
仕様書を書く前にハーネスを作る - Agent Native開発は「探索を速く、判定を固く」
gotalab555
4
1.5k
【やさしく解説 設計編・中級 #4】ルールの寿命と、システムの年輪
panda728
PRO
2
180
freee が目指す データ マネジメント戦略 AI-Ready 時代を支える 攻めのガバナンスとは
freee
PRO
0
280
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
560
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
300
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
290
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
3
760
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Context Engineering - Making Every Token Count
addyosmani
9
1k
GitHub's CSS Performance
jonrohan
1033
470k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
240
Crafting Experiences
bethany
1
240
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
330
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6k
The Curious Case for Waylosing
cassininazir
1
450
Everyday Curiosity
cassininazir
0
270
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Visualization
eitanlees
152
17k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
400
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