• Like
  • Save
How to stop writing spaghetti code - JSConf.eu 2010
Upcoming SlideShare
Loading in...5
×
 

How to stop writing spaghetti code - JSConf.eu 2010

on

  • 4,780 views

 

Statistics

Views

Total Views
4,780
Views on SlideShare
4,644
Embed Views
136

Actions

Likes
5
Downloads
54
Comments
0

6 Embeds 136

http://lanyrd.com 59
http://speakerrate.com 38
http://developer.yahoo.com 34
http://static.slidesharecdn.com 3
http://paper.li 1
https://developer.yahoo.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />

How to stop writing spaghetti code - JSConf.eu 2010 How to stop writing spaghetti code - JSConf.eu 2010 Presentation Transcript

  • EE = require('events').EventEmitter; ee = new EE(); die = false; ee.on('die', function() { die = true; }); setTimeout(function() { ee.emit('die'); }, 100); while(!die) { } console.log('done');
  • var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Worldn'); }).listen(8124, "127.0.0.1"); console.log('Server running at http://127.0.0.1:8124/'
  • http.createServer(function (req, res) { })
  • var server = Server.createServer(server.createReq(req, res));