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
Programming for Chaos
Search
shapeshed
May 17, 2012
Technology
180
2
Share
Programming for Chaos
An introduction to Node.js
shapeshed
May 17, 2012
More Decks by shapeshed
See All by shapeshed
Humans Networks and Chaos
shapeshed
3
1.8k
Other Decks in Technology
See All in Technology
TSKaigi 2026 - enumよ、さようなら
teamlab
PRO
1
220
TypeScriptはどのようにどこまで推論できるのか ─ とにかく as は禁止で
ypresto
0
260
AsyncStreamでマルチブロードキャストを実装する
1mash0
1
180
AIコーディングエージェントの活用で、コードは静かに肥大化した
yosukeshinoda
0
120
論文紹介:Pixal3D (SIGGRAPH 2026)
tenten0727
0
640
Gaussian Splattingの実用化 - 映像制作への展開
gpuunite_official
0
210
【関西製造業祭り2026春】現場を変える技術はここまで来た〜世界最大の製造業見本市から持って帰ってきたもの〜
tanakaseiya
0
190
Purview 勉強会報告 Microsoft Purview 入門しようとしてみた
masakichixo
1
470
[4] Power BI Deep Dive [2026-05]
ohata_bi
0
110
Claude Code で使える DuckDB Skills を試してみた / DuckDB Skills and Claude Code
masahirokawahara
1
1.8k
[続・営業向け 誰でも話せるOCI セールストーク] セールストーク総集編(2026年5月15日開催)
oracle4engineer
PRO
1
110
【禁断】Obsidianの第二の脳に「知の巨人」と呼ばれた師匠の脳をロードしてみた
nagatsu
0
1.9k
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
First, design no harm
axbom
PRO
2
1.2k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
200
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
140
エンジニアに許された特別な時間の終わり
watany
106
240k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.8k
The SEO identity crisis: Don't let AI make you average
varn
0
460
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
400
Transcript
Node.js Programming for Chaos
Who is this bloke? London-based Ruby and JavaScript developer at
pebble {code} Currently authoring Sam's Teach Yourself Node.js in 24 Hours. @shapeshed in the usual places
Don't Believe The Hype <3 <3 ZOMG THE New Railsz
!!!! Make Startup with Node.js === Profit I AM Node.js I AM HIPSTER!!!
Let's Chat! http://192.168.3.1
The Web Started Simple HTML Browsers http://
Then Became Dynamic cDatabases c Scripting Languages
It is different now
I'm easily excited
I'm cheap Galaxy Apollo £30 (refurb) • Clients are capable
• Clients can be servers
Learning from gaming 10 PRINT "HELLO LONDON WEB!" 20 GOTO
10
Your are in a large empty room There are exits
to the left or right. Left or right?
Input / Output Logic Left Princess!
This is predictable • Map scenarios • Write Code •
Easy!
We even write tests for this Scenario: Player Turns Right
Given I am asked to turn left or right When I choose to turn right Then I should see “Eaten by a dragon” Scenario: Player Turns Right Given I am asked to turn left or right When I choose to turn left Then I should see “You found the Princess”
Stop playing with yourself More difficult
Atari Joystick Joystick Output Logic Input(s)
Xbox Controller Internet 8 million controllers Game Servers Databases Chat
Servers Voice Servers Load Balancers Message Queues More..
A little language called JavaScript var perception = "Toy browser
language"; var reality = "The language of the web";
Browser wars V8 JavaScript Engine • Super fast • Highly
performant • Open source
A love-child is born var http = require('http'); http.createServer(function (req,
res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/');
Why JavaScript? Callbacks $("p").hide(1000); alert("This paragraph is hidden"); $("p").hide(1000, function(){
alert("This paragraph is hidden"); });
Why JavaScript? The Event Loop • Single Threaded • Return
fast • Don't Block
Blocking var fs = require('fs'); var data = fs.readFileSync(__dirname +
'/example.file','utf8'); console.log(data);
Non-blocking var fs = require('fs'); fs.readFile(__dirname + '/example.file', 'utf8', function
(err, data) { if (err) { return console.log(err); } console.log(data); });
You talk a lot. Show me something!
Node.js is a platform for • Network programming • Real-time
• High data throughput • Many concurrent users (It is one approach to concurrency)
When to use Node.js • Single page applications • Real-time
games • Network Mashups • Data streaming (file uploads) • JSON APIs
When not to use Node.js • CPU intensive applications •
CRUD apps on relational databases • Simple HTML sites • Just because 'IT IS SO HOT RIGHT NOW!'
Where next? • Express • https://github.com/visionmedia/express • Socket.IO • http://socket.io/
• dnode • https://github.com/substack/dnode • UK Training • http://leftlogic.com/training#node
Thanks! @shapeshed Slides: http://bit.ly/J9Qvbh