SlideShare a Scribd company logo
•  What	
  I	
  want	
  to	
  talk	
  is…	
  
	
            Thank	
  you	
  Tarek!
•  Expert	
  Python	
  Programming	
  is	
  a	
  
   super	
  cool	
  book!	
  
  – It	
  provides	
  very	
  pragma?c	
  knowledge	
  
   for	
  Python	
  programmers.	
  
  – It	
  provides	
  very	
  acute	
  insight	
  for	
  
   Other	
  language	
  programmer!
PyConJP	
  LT	
 (2011/08/27)	




              DeNA	
  Co.Ltd.,	
  Smartphone	
  SG	
  system	
  group.	
  
              Sphinx-­‐Users.jp	
  /	
  eXtreme	
  Programming	
  Users	
  Group	
  Japan	
  

                   	
  	
                       Shibukawa	
  Yoshiki
Twicer:	
  @shibukawa	
•  Job	
  
     –  Honda	
  R&D	
  →	
  DeNA	
  
     –  I’m	
  playing	
  Smartphone	
  everyday!	
  
•  Community	
  
     –  Sphinx-­‐Users.jp	
  Organizer	
  
     –  XPJUG	
  
     –  PySpa	
  
•  Books	
  
     –  Simple	
  and	
  Steady	
  Way	
  of	
  Learning	
  for	
  
        So`ware	
  Engineers(Gihyo)	
  
     –  Expert	
  Python	
  Programming	
  
        (ASCII-­‐MW)	
  
     –  Pomodoro	
  Technique	
  illustrated	
  
        (ASCII-­‐MW)	
  
     –  The	
  Art	
  of	
  Community	
  
        (O’reilly	
  Japan)	
  

                 :	
     web
 I’m	
  crea?ng	
  games	
  on	
  ngCore.	
  Please	
  download	
  it!
•  All	
  acendees	
  must	
  have	
  it,	
  aren’t	
  they?
•  So,	
  you	
  are	
  already	
  Python	
  expert!	




                              Python
•  I	
  don’t	
  have	
  to	
  describe	
  Python	
  at	
  all.	




           Python
•  I	
  will	
  describe	
  JavaScript	
  along	
  with	
  Expert	
  Python	
  
   Programming.	




              Py               JavaScript
•  I	
  will	
  describe	
  JavaScript	
  along	
  with	
  Expert	
  
   Python.	




              Py                JavaScript
•  Wri?ng	
  code	
  more	
  than	
  1000	
  lines.	
  
•  Program	
  runs	
  on	
  not	
  only	
  browser	
  but	
  also	
  
   desktop	
  and	
  server
29
•  node.js	
  (hcp://nodejs.org)	
  
   –  Good	
  interac?ve	
  shell	
  for	
  JavaScript	
  
       •  Windows	
  
            –  Use	
  binary	
  package	
  
       •  Linux	
  
            –  Use	
  apt-­‐get	
  or	
  emerge	
  or	
  anything	
  
       •  MacOSX	
  
            –  Use	
  MacPorts	
  or	
  Homebrew	
  

•  npm	
  (hcp://npmjs.org)	
  
   –  easy_install	
  for	
  nodejs	
  

   node.js
•  I’m	
  using	
  Emacs.	
  Sorry	
  Tarek.	
  
    –  js2-­‐mode	
  is	
  good!	
  
        •  hcp://code.google.com/p/js2-­‐mode	
  
        •  Download	
  source	
  and	
  M-­‐x	
  byte-­‐compile-­‐file	
  
        •  Add	
  following	
  line	
  following	
  lines:	
  
    (autoload 'js2-mode "js2" nil t)
       	
  
    (add-to-list 'auto-mode-alist '(".js$" . js2-mode))	

•  Other	
  DeNA	
  guys	
  are	
  using	
  Emacs,	
  Vim,	
  Eclipse,	
  
   WebStorm.	
  

                     Emacs             js2-­‐mode
57
•  Global	
  namespace	
  is	
  important	
  than	
  Python	
  
    –  JavaScript	
  has	
  only	
  one	
  global	
  area.	
  
•  1.	
  Self-­‐invoke	
  func?on	
  
    (function() {
        // This area is private!
    })();	
	
  
•  2.	
  Export	
  only	
  accessor	
  methods	
  
    var getter;
    (function() {
        var privateVar = 100;
        getter = function() {return privateVar;};
    })();
•  This	
  is	
  good	
  technique	
  for:	
  
    –  Inser?on	
  ini?alize	
  code.	
  
    –  Bridging	
  incompa?bility	
  between	
  browsers.	
  
    –  Crea?ng	
  unit	
  test	
  for	
  browser	
  on	
  node.js.	
  
    	
  	
        function a() {
            // initialize code or check compatibility
            a = function() {
                // function logic it is used always
            };
     };
93
•  JavaScript	
  has	
  descriptor	
  like	
  Python	
  
•  Call	
  func?on	
  during	
  access	
  object’s	
  property	
  
                 var obj = {};
                 var temp = null;
                 Object.defineProperty(obj,
                 "test", {
                   get: function() {
                       return temp;
                   },
                   set: function(val) {
                       temp = val;
                   }
                 });	


            JS
123
Of	
  course!!	
  	
  
•  Good	
  names	
  are	
  important	
  for	
  JavaScript	
  too!	




                   JavaScript
153
•  Original	
  JavaScript	
  doesn’t	
  have	
  “import”	
  
   mechanism.	
  
   –  It	
  is	
  important	
  for	
  crea?ng	
  large	
  so`ware.	
  
   –  CommonJS	
  proposes	
  good	
  design.	
  
       •  It	
  is	
  used	
  by	
  node.js	
  and	
  ngcore.	
  
•  jQuery	
  builder,	
  closure	
  compiler…	
  many	
  libraries	
  
   are	
  created	
  with	
  many	
  source	
  files.	
  
   –  Combine	
  all	
  needed	
  sources.	
  
•  It	
  supports	
  require	
  and	
  exports.	
  
•  ngCore	
  build	
  tool	
  treats	
  source	
  code	
  like	
  this:	


 var Button = require(‘./UI/Button’).Button;

 exports.MyWindow = function() {
     this.title = “hello world”;
     this.size = [100, 100, 400, 200];
 };
•  It	
  supports	
  require	
  and	
  exports.	
  
•  ngCore	
  build	
  tool	
  treats	
  source	
  code	
  like	
  this:	
 MODULES[“modulename”] = (function() {
 var exports = {};
 var require = function(file){ return MODULES[file]; };
 var Button = require(‘./UI/Button’).Button;

 exports.MyWindow = function() {
     this.title = “hello world”;
     this.size = [100, 100, 400, 200];
 };
 return exports;})();
179
•  I	
  don’t	
  know	
  what	
  you	
  want	
  to	
  create.	
  
•  There	
  are	
  many	
  different	
  environment	
  today.	
  
   –  My	
  recommend	
  environment	
  is	
  ngCore.	
  You	
  can	
  
      create	
  Android	
  and	
  iOS	
  games	
  from	
  same	
  source.	
  
      Future,	
  ngCore	
  will	
  support	
  HTML5.	
  




                                                ngCore
219
Of	
  course!!	
  	
  
•  SCM	
  is	
  important	
  for	
  JavaScript	
  too!	
  
•  I	
  love	
  mercurial.	
  During	
  using	
  git,	
  I	
  some?mes	
  got	
  
   error	
  because	
  I	
  type	
  hg	
  instead	
  of	
  git.	



                     JavaScript
247
Of	
  course!!	
  	
  
•  Managing	
  Life	
  Cycle	
  is	
  important	
  for	
  JavaScript	
  
   too!	
  




                    JavaScript
263
•  Famous	
  tool	
  in	
  JS	
  community	
  is	
  JSDoc	
  series.	
  
    –  JSDoc-­‐toolkit	
  2.4	
  is	
  the	
  latest	
  stable	
  version.	
  
    –  JSDoc	
  3	
  is	
  now	
  crea?ng.	
  
    –  node-­‐jsdoc-­‐toolkit	
  is	
  easy	
  to	
  use	
  and	
  fast!	
  
         •  hcps://github.com/p120ph37/node-­‐jsdoc-­‐toolkit	
  


•  Do	
  you	
  like	
  auto	
  generated	
  document?	
  I	
  don’t	
  
   like.	
  It	
  is	
  hard	
  to	
  write	
  good	
  document.	
  


             node-­‐jsdoc-­‐toolkit
•  Sphinx	
  is	
  good	
  tool	
  for	
  almost	
  all	
  programmers!	
  
    –  You	
  can	
  create	
  becer	
  document!	
  
    –  Easy	
  to	
  learn,	
  easy	
  to	
  write.	
  hard	
  to	
  write	
  Plugin…	
  


•  I’m	
  crea?ng	
  CommonJS-­‐domain	
  and	
  CommonJS-­‐
   autodoc	
  plugin	
  now.	
  Please	
  wait!	
  




    Sphinx                             CommonJS
295
•  I’m	
  using	
  Jasmine.	
  
•  If	
  your	
  code	
  run	
  in	
  browser	
  or	
  mobile	
  device,	
  you	
  
   can	
  run	
  logic	
  test	
  on	
  node.js.	
  
    –  Fast	
  feedback!	
  Fast	
  development	
  cycle.	
  
    –  You	
  can	
  install	
  node-jasmine	
  via	
  npm.	
  
    –  “Func?ons	
  that	
  rewrites	
  thyself”	
  technique	
  is	
  useful!
321
Of	
  course!!	
  	
  
•  Python’s	
  strategy	
  of	
  op?miza?on	
  is	
  as	
  same	
  as	
  
   JavaScript	
  too!	
  




                                    Python JS
•  Each	
  JavaScript	
  engines	
  have	
  different	
  character:	
  
    –  V8	
  
    –  V8	
  for	
  Android	
  
    –  Safari	
  
    –  Safari	
  for	
  iOS	
  
    –  WebView	
  for	
  iOS	
  
    –  Firefox	
  
    –  Internet	
  Explorer…	
  
•  You	
  have	
  to	
  profile	
  on	
  the	
  environments	
  you	
  use.	
  	
  	
       JS
371
•  Asynchronous	
  is	
  the	
  most	
  important	
  part	
  of	
  JS	
  
    –  It	
  is	
  a	
  pit	
  fall	
  Java	
  programmer	
  fall	
  
    –  Callback	
  hell!	
  
    –  Sequen?al	
  source	
  code	
  is	
  more	
  readable	
  and	
  easy	
  to	
  
       understand.	
  	
  
•  jsDeffered	
  
   –  hcp://cho45.stuawsc.com/jsdeferred/	
  
 next(function() { /* task 1 */ }).
 next(function() { /* task 2 */ });

 chain(
     function() { /* task 1 */ },
     function() { /* task 2 */ }
 );


   –  Sorry	
  I	
  have	
  never	
  used	
  it…	
  
   –  Maybe	
  twisted	
  programmers	
  familiar	
  with	
  this.
•  Try	
  to	
  write	
  following	
  “Counter”	
  class.	
  
 var counter = new Counter();

 fs.writeFile(“METADATA”, data1, counter.newTask());
 fs.writeFile(“REQUEST”, data2, counter.newTask());

 counter.wait(function() {
     // All task is finished.
	
  
 });

•  It	
  works	
  similar	
  to	
  sleep	
  sort.	
  Run	
  all	
  tasks	
  at	
  the	
  
     same	
  ?me	
  and	
  check	
  only	
  the	
  task	
  end.
•  All	
  func?ons	
  which	
  uses	
  Async	
  call	
  must	
  receive	
  
   callback	
  func?on.	
  
    –  If	
  not,	
  caller	
  can’t	
  know	
  whether	
  all	
  tasks	
  are	
  finished	
  
       or	
  not	
  

        Func?on	
  caller	
 Callback	
  func?on	


                     Pass	


                                                    Async
•  What	
  I	
  want	
  to	
  talk	
  is…	
  
	
            Thank	
  you	
  Tarek!
•  Expert	
  Python	
  Programming	
  is	
  
   super	
  cool	
  book!	
  
  – It	
  provides	
  very	
  pragma?c	
  knowledge	
  
   for	
  Python	
  programmers.	
  
  – It	
  provides	
  very	
  acute	
  insight	
  for	
  
   Other	
  language	
  programmer!
Expert JavaScript Programming

More Related Content

What's hot (20)

JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for Dummies
Charles Nutter
 
The State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila SzegediThe State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila Szegedi
ZeroTurnaround
 
Charles nutter star techconf 2011 - jvm languages
Charles nutter   star techconf 2011 - jvm languagesCharles nutter   star techconf 2011 - jvm languages
Charles nutter star techconf 2011 - jvm languages
StarTech Conference
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
Hiroshi SHIBATA
 
How to test code with mruby
How to test code with mrubyHow to test code with mruby
How to test code with mruby
Hiroshi SHIBATA
 
The details of CI/CD environment for Ruby
The details of CI/CD environment for RubyThe details of CI/CD environment for Ruby
The details of CI/CD environment for Ruby
Hiroshi SHIBATA
 
Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaJruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-java
Keith Bennett
 
Invokedynamic in 45 Minutes
Invokedynamic in 45 MinutesInvokedynamic in 45 Minutes
Invokedynamic in 45 Minutes
Charles Nutter
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
Hiroshi SHIBATA
 
Test
TestTest
Test
PaulMWatson
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0
Hiroshi SHIBATA
 
Hybrid concurrency patterns
Hybrid concurrency patternsHybrid concurrency patterns
Hybrid concurrency patterns
Kyle Drake
 
Ruby in office time reboot
Ruby in office time rebootRuby in office time reboot
Ruby in office time reboot
Kentaro Goto
 
How to develop Jenkins plugin using to ruby and Jenkins.rb
How to develop Jenkins plugin using to ruby and Jenkins.rbHow to develop Jenkins plugin using to ruby and Jenkins.rb
How to develop Jenkins plugin using to ruby and Jenkins.rb
Hiroshi SHIBATA
 
An introduction and future of Ruby coverage library
An introduction and future of Ruby coverage libraryAn introduction and future of Ruby coverage library
An introduction and future of Ruby coverage library
mametter
 
Testing nodejs apps
Testing nodejs appsTesting nodejs apps
Testing nodejs apps
felipefsilva
 
How to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machineHow to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machine
Chun-Yu Wang
 
The secret of programming language development and future
The secret of programming  language development and futureThe secret of programming  language development and future
The secret of programming language development and future
Hiroshi SHIBATA
 
Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)
SATOSHI TAGOMORI
 
Gpgpu intro
Gpgpu introGpgpu intro
Gpgpu intro
Dominik Seifert
 
JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for Dummies
Charles Nutter
 
The State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila SzegediThe State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila Szegedi
ZeroTurnaround
 
Charles nutter star techconf 2011 - jvm languages
Charles nutter   star techconf 2011 - jvm languagesCharles nutter   star techconf 2011 - jvm languages
Charles nutter star techconf 2011 - jvm languages
StarTech Conference
 
How to test code with mruby
How to test code with mrubyHow to test code with mruby
How to test code with mruby
Hiroshi SHIBATA
 
The details of CI/CD environment for Ruby
The details of CI/CD environment for RubyThe details of CI/CD environment for Ruby
The details of CI/CD environment for Ruby
Hiroshi SHIBATA
 
Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaJruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-java
Keith Bennett
 
Invokedynamic in 45 Minutes
Invokedynamic in 45 MinutesInvokedynamic in 45 Minutes
Invokedynamic in 45 Minutes
Charles Nutter
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
Hiroshi SHIBATA
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0
Hiroshi SHIBATA
 
Hybrid concurrency patterns
Hybrid concurrency patternsHybrid concurrency patterns
Hybrid concurrency patterns
Kyle Drake
 
Ruby in office time reboot
Ruby in office time rebootRuby in office time reboot
Ruby in office time reboot
Kentaro Goto
 
How to develop Jenkins plugin using to ruby and Jenkins.rb
How to develop Jenkins plugin using to ruby and Jenkins.rbHow to develop Jenkins plugin using to ruby and Jenkins.rb
How to develop Jenkins plugin using to ruby and Jenkins.rb
Hiroshi SHIBATA
 
An introduction and future of Ruby coverage library
An introduction and future of Ruby coverage libraryAn introduction and future of Ruby coverage library
An introduction and future of Ruby coverage library
mametter
 
Testing nodejs apps
Testing nodejs appsTesting nodejs apps
Testing nodejs apps
felipefsilva
 
How to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machineHow to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machine
Chun-Yu Wang
 
The secret of programming language development and future
The secret of programming  language development and futureThe secret of programming  language development and future
The secret of programming language development and future
Hiroshi SHIBATA
 
Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)
SATOSHI TAGOMORI
 

Similar to Expert JavaScript Programming (20)

Evolving js
Evolving jsEvolving js
Evolving js
shavien
 
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane EcosystemDownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
FITC
 
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane EcosystemDownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
FITC
 
Choosing Javascript Libraries to Adopt for Development
Choosing Javascript Libraries to Adopt for DevelopmentChoosing Javascript Libraries to Adopt for Development
Choosing Javascript Libraries to Adopt for Development
Edward Apostol
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
Jonathan Fine
 
Node.js #digpen presentation
Node.js #digpen presentationNode.js #digpen presentation
Node.js #digpen presentation
GOSS Interactive
 
Node.JS briefly introduced
Node.JS briefly introducedNode.JS briefly introduced
Node.JS briefly introduced
Alexandre Lachèze
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
elliando dias
 
JavaScript Intro
JavaScript IntroJavaScript Intro
JavaScript Intro
Eric Brown
 
Dcjq node.js presentation
Dcjq node.js presentationDcjq node.js presentation
Dcjq node.js presentation
async_io
 
High quality Front-End
High quality Front-EndHigh quality Front-End
High quality Front-End
David Simons
 
JS & NodeJS - An Introduction
JS & NodeJS - An IntroductionJS & NodeJS - An Introduction
JS & NodeJS - An Introduction
Nirvanic Labs
 
Node.js vs. python which one is better for your project
Node.js vs. python  which one is better for your project Node.js vs. python  which one is better for your project
Node.js vs. python which one is better for your project
Moon Technolabs Pvt. Ltd.
 
NodeJS vs Python 2024: Which is better for backend development?
NodeJS vs Python 2024: Which is better for backend development?NodeJS vs Python 2024: Which is better for backend development?
NodeJS vs Python 2024: Which is better for backend development?
Agile Infoways LLC
 
JavaScript on the server - Node.js
JavaScript on the server - Node.jsJavaScript on the server - Node.js
JavaScript on the server - Node.js
Rody Middelkoop
 
Meetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech PeopleMeetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech People
IT Arena
 
Introduction to mean and mern || Event by DSC UNIDEB
Introduction to mean and mern || Event by DSC UNIDEBIntroduction to mean and mern || Event by DSC UNIDEB
Introduction to mean and mern || Event by DSC UNIDEB
Muhammad Raza
 
Javascript Update May 2013
Javascript Update May 2013Javascript Update May 2013
Javascript Update May 2013
RameshNair6
 
NodeJS VS Python
NodeJS VS PythonNodeJS VS Python
NodeJS VS Python
Krishang Technolab
 
Evolving js
Evolving jsEvolving js
Evolving js
shavien
 
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane EcosystemDownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
FITC
 
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane EcosystemDownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
FITC
 
Choosing Javascript Libraries to Adopt for Development
Choosing Javascript Libraries to Adopt for DevelopmentChoosing Javascript Libraries to Adopt for Development
Choosing Javascript Libraries to Adopt for Development
Edward Apostol
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
Jonathan Fine
 
Node.js #digpen presentation
Node.js #digpen presentationNode.js #digpen presentation
Node.js #digpen presentation
GOSS Interactive
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
elliando dias
 
JavaScript Intro
JavaScript IntroJavaScript Intro
JavaScript Intro
Eric Brown
 
Dcjq node.js presentation
Dcjq node.js presentationDcjq node.js presentation
Dcjq node.js presentation
async_io
 
High quality Front-End
High quality Front-EndHigh quality Front-End
High quality Front-End
David Simons
 
JS & NodeJS - An Introduction
JS & NodeJS - An IntroductionJS & NodeJS - An Introduction
JS & NodeJS - An Introduction
Nirvanic Labs
 
Node.js vs. python which one is better for your project
Node.js vs. python  which one is better for your project Node.js vs. python  which one is better for your project
Node.js vs. python which one is better for your project
Moon Technolabs Pvt. Ltd.
 
NodeJS vs Python 2024: Which is better for backend development?
NodeJS vs Python 2024: Which is better for backend development?NodeJS vs Python 2024: Which is better for backend development?
NodeJS vs Python 2024: Which is better for backend development?
Agile Infoways LLC
 
JavaScript on the server - Node.js
JavaScript on the server - Node.jsJavaScript on the server - Node.js
JavaScript on the server - Node.js
Rody Middelkoop
 
Meetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech PeopleMeetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech People
IT Arena
 
Introduction to mean and mern || Event by DSC UNIDEB
Introduction to mean and mern || Event by DSC UNIDEBIntroduction to mean and mern || Event by DSC UNIDEB
Introduction to mean and mern || Event by DSC UNIDEB
Muhammad Raza
 
Javascript Update May 2013
Javascript Update May 2013Javascript Update May 2013
Javascript Update May 2013
RameshNair6
 
Ad

More from Yoshiki Shibukawa (20)

多すぎるユニットテストは却ってよくない?私が実践しているテストコードのリファクタリング
多すぎるユニットテストは却ってよくない?私が実践しているテストコードのリファクタリング多すぎるユニットテストは却ってよくない?私が実践しているテストコードのリファクタリング
多すぎるユニットテストは却ってよくない?私が実践しているテストコードのリファクタリング
Yoshiki Shibukawa
 
ITコンサルが改善するのはビジネスだけじゃない! サークル的活動で業界貢献 技育祭2024秋
ITコンサルが改善するのはビジネスだけじゃない! サークル的活動で業界貢献 技育祭2024秋ITコンサルが改善するのはビジネスだけじゃない! サークル的活動で業界貢献 技育祭2024秋
ITコンサルが改善するのはビジネスだけじゃない! サークル的活動で業界貢献 技育祭2024秋
Yoshiki Shibukawa
 
技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料
技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料
技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料
Yoshiki Shibukawa
 
GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料
GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料
GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料
Yoshiki Shibukawa
 
Golang tokyo #7 qtpm
Golang tokyo #7 qtpmGolang tokyo #7 qtpm
Golang tokyo #7 qtpm
Yoshiki Shibukawa
 
Chunked encoding を使った高速化の考察
Chunked encoding を使った高速化の考察Chunked encoding を使った高速化の考察
Chunked encoding を使った高速化の考察
Yoshiki Shibukawa
 
Mithril
MithrilMithril
Mithril
Yoshiki Shibukawa
 
Go & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and ErrorsGo & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and Errors
Yoshiki Shibukawa
 
Excelの話
Excelの話Excelの話
Excelの話
Yoshiki Shibukawa
 
FINAL FANTASY Record Keeperを支えたGolang
FINAL FANTASY Record Keeperを支えたGolangFINAL FANTASY Record Keeperを支えたGolang
FINAL FANTASY Record Keeperを支えたGolang
Yoshiki Shibukawa
 
アンラーニング
アンラーニングアンラーニング
アンラーニング
Yoshiki Shibukawa
 
東京Node学園 今できる通信高速化にトライしてみた
東京Node学園 今できる通信高速化にトライしてみた東京Node学園 今できる通信高速化にトライしてみた
東京Node学園 今できる通信高速化にトライしてみた
Yoshiki Shibukawa
 
Oktavia全文検索エンジン - SphinxCon JP 2014
Oktavia全文検索エンジン - SphinxCon JP 2014Oktavia全文検索エンジン - SphinxCon JP 2014
Oktavia全文検索エンジン - SphinxCon JP 2014
Yoshiki Shibukawa
 
Oktavia Search Engine - pyconjp2014
Oktavia Search Engine - pyconjp2014Oktavia Search Engine - pyconjp2014
Oktavia Search Engine - pyconjp2014
Yoshiki Shibukawa
 
大規模JavaScript開発
大規模JavaScript開発大規模JavaScript開発
大規模JavaScript開発
Yoshiki Shibukawa
 
Xpjug基調lt2011
Xpjug基調lt2011Xpjug基調lt2011
Xpjug基調lt2011
Yoshiki Shibukawa
 
JavaScriptゲーム制作勉強会
JavaScriptゲーム制作勉強会JavaScriptゲーム制作勉強会
JavaScriptゲーム制作勉強会
Yoshiki Shibukawa
 
Pomodoro technique
Pomodoro techniquePomodoro technique
Pomodoro technique
Yoshiki Shibukawa
 
ドキュメントを作りたくなってしまう魔法のツール「Sphinx」
ドキュメントを作りたくなってしまう魔法のツール「Sphinx」ドキュメントを作りたくなってしまう魔法のツール「Sphinx」
ドキュメントを作りたくなってしまう魔法のツール「Sphinx」
Yoshiki Shibukawa
 
Bitbucket&mercurial
Bitbucket&mercurialBitbucket&mercurial
Bitbucket&mercurial
Yoshiki Shibukawa
 
多すぎるユニットテストは却ってよくない?私が実践しているテストコードのリファクタリング
多すぎるユニットテストは却ってよくない?私が実践しているテストコードのリファクタリング多すぎるユニットテストは却ってよくない?私が実践しているテストコードのリファクタリング
多すぎるユニットテストは却ってよくない?私が実践しているテストコードのリファクタリング
Yoshiki Shibukawa
 
ITコンサルが改善するのはビジネスだけじゃない! サークル的活動で業界貢献 技育祭2024秋
ITコンサルが改善するのはビジネスだけじゃない! サークル的活動で業界貢献 技育祭2024秋ITコンサルが改善するのはビジネスだけじゃない! サークル的活動で業界貢献 技育祭2024秋
ITコンサルが改善するのはビジネスだけじゃない! サークル的活動で業界貢献 技育祭2024秋
Yoshiki Shibukawa
 
技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料
技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料
技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料
Yoshiki Shibukawa
 
GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料
GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料
GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料
Yoshiki Shibukawa
 
Chunked encoding を使った高速化の考察
Chunked encoding を使った高速化の考察Chunked encoding を使った高速化の考察
Chunked encoding を使った高速化の考察
Yoshiki Shibukawa
 
Go & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and ErrorsGo & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and Errors
Yoshiki Shibukawa
 
FINAL FANTASY Record Keeperを支えたGolang
FINAL FANTASY Record Keeperを支えたGolangFINAL FANTASY Record Keeperを支えたGolang
FINAL FANTASY Record Keeperを支えたGolang
Yoshiki Shibukawa
 
東京Node学園 今できる通信高速化にトライしてみた
東京Node学園 今できる通信高速化にトライしてみた東京Node学園 今できる通信高速化にトライしてみた
東京Node学園 今できる通信高速化にトライしてみた
Yoshiki Shibukawa
 
Oktavia全文検索エンジン - SphinxCon JP 2014
Oktavia全文検索エンジン - SphinxCon JP 2014Oktavia全文検索エンジン - SphinxCon JP 2014
Oktavia全文検索エンジン - SphinxCon JP 2014
Yoshiki Shibukawa
 
Oktavia Search Engine - pyconjp2014
Oktavia Search Engine - pyconjp2014Oktavia Search Engine - pyconjp2014
Oktavia Search Engine - pyconjp2014
Yoshiki Shibukawa
 
JavaScriptゲーム制作勉強会
JavaScriptゲーム制作勉強会JavaScriptゲーム制作勉強会
JavaScriptゲーム制作勉強会
Yoshiki Shibukawa
 
ドキュメントを作りたくなってしまう魔法のツール「Sphinx」
ドキュメントを作りたくなってしまう魔法のツール「Sphinx」ドキュメントを作りたくなってしまう魔法のツール「Sphinx」
ドキュメントを作りたくなってしまう魔法のツール「Sphinx」
Yoshiki Shibukawa
 
Ad

Recently uploaded (20)

SDG 9000 Series: Unleashing multigigabit everywhere
SDG 9000 Series: Unleashing multigigabit everywhereSDG 9000 Series: Unleashing multigigabit everywhere
SDG 9000 Series: Unleashing multigigabit everywhere
Adtran
 
Microsoft Build 2025 takeaways in one presentation
Microsoft Build 2025 takeaways in one presentationMicrosoft Build 2025 takeaways in one presentation
Microsoft Build 2025 takeaways in one presentation
Digitalmara
 
TrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy ContractingTrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy Contracting
TrustArc
 
Fortinet Certified Associate in Cybersecurity
Fortinet Certified Associate in CybersecurityFortinet Certified Associate in Cybersecurity
Fortinet Certified Associate in Cybersecurity
VICTOR MAESTRE RAMIREZ
 
Measuring Microsoft 365 Copilot and Gen AI Success
Measuring Microsoft 365 Copilot and Gen AI SuccessMeasuring Microsoft 365 Copilot and Gen AI Success
Measuring Microsoft 365 Copilot and Gen AI Success
Nikki Chapple
 
Dev Dives: System-to-system integration with UiPath API Workflows
Dev Dives: System-to-system integration with UiPath API WorkflowsDev Dives: System-to-system integration with UiPath API Workflows
Dev Dives: System-to-system integration with UiPath API Workflows
UiPathCommunity
 
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
Jasper Oosterveld
 
New Ways to Reduce Database Costs with ScyllaDB
New Ways to Reduce Database Costs with ScyllaDBNew Ways to Reduce Database Costs with ScyllaDB
New Ways to Reduce Database Costs with ScyllaDB
ScyllaDB
 
The case for on-premises AI
The case for on-premises AIThe case for on-premises AI
The case for on-premises AI
Principled Technologies
 
Palo Alto Networks Cybersecurity Foundation
Palo Alto Networks Cybersecurity FoundationPalo Alto Networks Cybersecurity Foundation
Palo Alto Networks Cybersecurity Foundation
VICTOR MAESTRE RAMIREZ
 
Evaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical ContentEvaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical Content
Paul Groth
 
Cyber Security Legal Framework in Nepal.pptx
Cyber Security Legal Framework in Nepal.pptxCyber Security Legal Framework in Nepal.pptx
Cyber Security Legal Framework in Nepal.pptx
Ghimire B.R.
 
Cybersecurity Fundamentals: Apprentice - Palo Alto Certificate
Cybersecurity Fundamentals: Apprentice - Palo Alto CertificateCybersecurity Fundamentals: Apprentice - Palo Alto Certificate
Cybersecurity Fundamentals: Apprentice - Palo Alto Certificate
VICTOR MAESTRE RAMIREZ
 
6th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 20256th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 2025
DanBrown980551
 
UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath InsightsUiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPathCommunity
 
Introducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and ARIntroducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and AR
Safe Software
 
Co-Constructing Explanations for AI Systems using Provenance
Co-Constructing Explanations for AI Systems using ProvenanceCo-Constructing Explanations for AI Systems using Provenance
Co-Constructing Explanations for AI Systems using Provenance
Paul Groth
 
Grannie’s Journey to Using Healthcare AI Experiences
Grannie’s Journey to Using Healthcare AI ExperiencesGrannie’s Journey to Using Healthcare AI Experiences
Grannie’s Journey to Using Healthcare AI Experiences
Lauren Parr
 
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
James Anderson
 
Nix(OS) for Python Developers - PyCon 25 (Bologna, Italia)
Nix(OS) for Python Developers - PyCon 25 (Bologna, Italia)Nix(OS) for Python Developers - PyCon 25 (Bologna, Italia)
Nix(OS) for Python Developers - PyCon 25 (Bologna, Italia)
Peter Bittner
 
SDG 9000 Series: Unleashing multigigabit everywhere
SDG 9000 Series: Unleashing multigigabit everywhereSDG 9000 Series: Unleashing multigigabit everywhere
SDG 9000 Series: Unleashing multigigabit everywhere
Adtran
 
Microsoft Build 2025 takeaways in one presentation
Microsoft Build 2025 takeaways in one presentationMicrosoft Build 2025 takeaways in one presentation
Microsoft Build 2025 takeaways in one presentation
Digitalmara
 
TrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy ContractingTrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy Contracting
TrustArc
 
Fortinet Certified Associate in Cybersecurity
Fortinet Certified Associate in CybersecurityFortinet Certified Associate in Cybersecurity
Fortinet Certified Associate in Cybersecurity
VICTOR MAESTRE RAMIREZ
 
Measuring Microsoft 365 Copilot and Gen AI Success
Measuring Microsoft 365 Copilot and Gen AI SuccessMeasuring Microsoft 365 Copilot and Gen AI Success
Measuring Microsoft 365 Copilot and Gen AI Success
Nikki Chapple
 
Dev Dives: System-to-system integration with UiPath API Workflows
Dev Dives: System-to-system integration with UiPath API WorkflowsDev Dives: System-to-system integration with UiPath API Workflows
Dev Dives: System-to-system integration with UiPath API Workflows
UiPathCommunity
 
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
Jasper Oosterveld
 
New Ways to Reduce Database Costs with ScyllaDB
New Ways to Reduce Database Costs with ScyllaDBNew Ways to Reduce Database Costs with ScyllaDB
New Ways to Reduce Database Costs with ScyllaDB
ScyllaDB
 
Palo Alto Networks Cybersecurity Foundation
Palo Alto Networks Cybersecurity FoundationPalo Alto Networks Cybersecurity Foundation
Palo Alto Networks Cybersecurity Foundation
VICTOR MAESTRE RAMIREZ
 
Evaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical ContentEvaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical Content
Paul Groth
 
Cyber Security Legal Framework in Nepal.pptx
Cyber Security Legal Framework in Nepal.pptxCyber Security Legal Framework in Nepal.pptx
Cyber Security Legal Framework in Nepal.pptx
Ghimire B.R.
 
Cybersecurity Fundamentals: Apprentice - Palo Alto Certificate
Cybersecurity Fundamentals: Apprentice - Palo Alto CertificateCybersecurity Fundamentals: Apprentice - Palo Alto Certificate
Cybersecurity Fundamentals: Apprentice - Palo Alto Certificate
VICTOR MAESTRE RAMIREZ
 
6th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 20256th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 2025
DanBrown980551
 
UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath InsightsUiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPathCommunity
 
Introducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and ARIntroducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and AR
Safe Software
 
Co-Constructing Explanations for AI Systems using Provenance
Co-Constructing Explanations for AI Systems using ProvenanceCo-Constructing Explanations for AI Systems using Provenance
Co-Constructing Explanations for AI Systems using Provenance
Paul Groth
 
Grannie’s Journey to Using Healthcare AI Experiences
Grannie’s Journey to Using Healthcare AI ExperiencesGrannie’s Journey to Using Healthcare AI Experiences
Grannie’s Journey to Using Healthcare AI Experiences
Lauren Parr
 
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
James Anderson
 
Nix(OS) for Python Developers - PyCon 25 (Bologna, Italia)
Nix(OS) for Python Developers - PyCon 25 (Bologna, Italia)Nix(OS) for Python Developers - PyCon 25 (Bologna, Italia)
Nix(OS) for Python Developers - PyCon 25 (Bologna, Italia)
Peter Bittner
 

Expert JavaScript Programming

  • 1. •  What  I  want  to  talk  is…   Thank  you  Tarek!
  • 2. •  Expert  Python  Programming  is  a   super  cool  book!   – It  provides  very  pragma?c  knowledge   for  Python  programmers.   – It  provides  very  acute  insight  for   Other  language  programmer!
  • 3. PyConJP  LT (2011/08/27) DeNA  Co.Ltd.,  Smartphone  SG  system  group.   Sphinx-­‐Users.jp  /  eXtreme  Programming  Users  Group  Japan     Shibukawa  Yoshiki
  • 4. Twicer:  @shibukawa •  Job   –  Honda  R&D  →  DeNA   –  I’m  playing  Smartphone  everyday!   •  Community   –  Sphinx-­‐Users.jp  Organizer   –  XPJUG   –  PySpa   •  Books   –  Simple  and  Steady  Way  of  Learning  for   So`ware  Engineers(Gihyo)   –  Expert  Python  Programming   (ASCII-­‐MW)   –  Pomodoro  Technique  illustrated   (ASCII-­‐MW)   –  The  Art  of  Community   (O’reilly  Japan)   :   web
  • 5.  I’m  crea?ng  games  on  ngCore.  Please  download  it!
  • 6. •  All  acendees  must  have  it,  aren’t  they?
  • 7. •  So,  you  are  already  Python  expert! Python
  • 8. •  I  don’t  have  to  describe  Python  at  all. Python
  • 9. •  I  will  describe  JavaScript  along  with  Expert  Python   Programming. Py JavaScript
  • 10. •  I  will  describe  JavaScript  along  with  Expert   Python. Py JavaScript
  • 11. •  Wri?ng  code  more  than  1000  lines.   •  Program  runs  on  not  only  browser  but  also   desktop  and  server
  • 12. 29
  • 13. •  node.js  (hcp://nodejs.org)   –  Good  interac?ve  shell  for  JavaScript   •  Windows   –  Use  binary  package   •  Linux   –  Use  apt-­‐get  or  emerge  or  anything   •  MacOSX   –  Use  MacPorts  or  Homebrew   •  npm  (hcp://npmjs.org)   –  easy_install  for  nodejs   node.js
  • 14. •  I’m  using  Emacs.  Sorry  Tarek.   –  js2-­‐mode  is  good!   •  hcp://code.google.com/p/js2-­‐mode   •  Download  source  and  M-­‐x  byte-­‐compile-­‐file   •  Add  following  line  following  lines:   (autoload 'js2-mode "js2" nil t)   (add-to-list 'auto-mode-alist '(".js$" . js2-mode)) •  Other  DeNA  guys  are  using  Emacs,  Vim,  Eclipse,   WebStorm.   Emacs js2-­‐mode
  • 15. 57
  • 16. •  Global  namespace  is  important  than  Python   –  JavaScript  has  only  one  global  area.   •  1.  Self-­‐invoke  func?on   (function() { // This area is private! })();   •  2.  Export  only  accessor  methods   var getter; (function() { var privateVar = 100; getter = function() {return privateVar;}; })();
  • 17. •  This  is  good  technique  for:   –  Inser?on  ini?alize  code.   –  Bridging  incompa?bility  between  browsers.   –  Crea?ng  unit  test  for  browser  on  node.js.     function a() { // initialize code or check compatibility a = function() { // function logic it is used always }; };
  • 18. 93
  • 19. •  JavaScript  has  descriptor  like  Python   •  Call  func?on  during  access  object’s  property   var obj = {}; var temp = null; Object.defineProperty(obj, "test", { get: function() { return temp; }, set: function(val) { temp = val; } }); JS
  • 20. 123
  • 21. Of  course!!     •  Good  names  are  important  for  JavaScript  too! JavaScript
  • 22. 153
  • 23. •  Original  JavaScript  doesn’t  have  “import”   mechanism.   –  It  is  important  for  crea?ng  large  so`ware.   –  CommonJS  proposes  good  design.   •  It  is  used  by  node.js  and  ngcore.   •  jQuery  builder,  closure  compiler…  many  libraries   are  created  with  many  source  files.   –  Combine  all  needed  sources.  
  • 24. •  It  supports  require  and  exports.   •  ngCore  build  tool  treats  source  code  like  this: var Button = require(‘./UI/Button’).Button; exports.MyWindow = function() { this.title = “hello world”; this.size = [100, 100, 400, 200]; };
  • 25. •  It  supports  require  and  exports.   •  ngCore  build  tool  treats  source  code  like  this: MODULES[“modulename”] = (function() { var exports = {}; var require = function(file){ return MODULES[file]; }; var Button = require(‘./UI/Button’).Button; exports.MyWindow = function() { this.title = “hello world”; this.size = [100, 100, 400, 200]; }; return exports;})();
  • 26. 179
  • 27. •  I  don’t  know  what  you  want  to  create.   •  There  are  many  different  environment  today.   –  My  recommend  environment  is  ngCore.  You  can   create  Android  and  iOS  games  from  same  source.   Future,  ngCore  will  support  HTML5.   ngCore
  • 28. 219
  • 29. Of  course!!     •  SCM  is  important  for  JavaScript  too!   •  I  love  mercurial.  During  using  git,  I  some?mes  got   error  because  I  type  hg  instead  of  git. JavaScript
  • 30. 247
  • 31. Of  course!!     •  Managing  Life  Cycle  is  important  for  JavaScript   too!   JavaScript
  • 32. 263
  • 33. •  Famous  tool  in  JS  community  is  JSDoc  series.   –  JSDoc-­‐toolkit  2.4  is  the  latest  stable  version.   –  JSDoc  3  is  now  crea?ng.   –  node-­‐jsdoc-­‐toolkit  is  easy  to  use  and  fast!   •  hcps://github.com/p120ph37/node-­‐jsdoc-­‐toolkit   •  Do  you  like  auto  generated  document?  I  don’t   like.  It  is  hard  to  write  good  document.   node-­‐jsdoc-­‐toolkit
  • 34. •  Sphinx  is  good  tool  for  almost  all  programmers!   –  You  can  create  becer  document!   –  Easy  to  learn,  easy  to  write.  hard  to  write  Plugin…   •  I’m  crea?ng  CommonJS-­‐domain  and  CommonJS-­‐ autodoc  plugin  now.  Please  wait!   Sphinx CommonJS
  • 35. 295
  • 36. •  I’m  using  Jasmine.   •  If  your  code  run  in  browser  or  mobile  device,  you   can  run  logic  test  on  node.js.   –  Fast  feedback!  Fast  development  cycle.   –  You  can  install  node-jasmine  via  npm.   –  “Func?ons  that  rewrites  thyself”  technique  is  useful!
  • 37. 321
  • 38. Of  course!!     •  Python’s  strategy  of  op?miza?on  is  as  same  as   JavaScript  too!   Python JS
  • 39. •  Each  JavaScript  engines  have  different  character:   –  V8   –  V8  for  Android   –  Safari   –  Safari  for  iOS   –  WebView  for  iOS   –  Firefox   –  Internet  Explorer…   •  You  have  to  profile  on  the  environments  you  use.     JS
  • 40. 371
  • 41. •  Asynchronous  is  the  most  important  part  of  JS   –  It  is  a  pit  fall  Java  programmer  fall   –  Callback  hell!   –  Sequen?al  source  code  is  more  readable  and  easy  to   understand.    
  • 42. •  jsDeffered   –  hcp://cho45.stuawsc.com/jsdeferred/   next(function() { /* task 1 */ }). next(function() { /* task 2 */ }); chain( function() { /* task 1 */ }, function() { /* task 2 */ } ); –  Sorry  I  have  never  used  it…   –  Maybe  twisted  programmers  familiar  with  this.
  • 43. •  Try  to  write  following  “Counter”  class.   var counter = new Counter(); fs.writeFile(“METADATA”, data1, counter.newTask()); fs.writeFile(“REQUEST”, data2, counter.newTask()); counter.wait(function() { // All task is finished.   }); •  It  works  similar  to  sleep  sort.  Run  all  tasks  at  the   same  ?me  and  check  only  the  task  end.
  • 44. •  All  func?ons  which  uses  Async  call  must  receive   callback  func?on.   –  If  not,  caller  can’t  know  whether  all  tasks  are  finished   or  not   Func?on  caller Callback  func?on Pass Async
  • 45. •  What  I  want  to  talk  is…   Thank  you  Tarek!
  • 46. •  Expert  Python  Programming  is   super  cool  book!   – It  provides  very  pragma?c  knowledge   for  Python  programmers.   – It  provides  very  acute  insight  for   Other  language  programmer!