SlideShare une entreprise Scribd logo
1  sur  47
Télécharger pour lire hors ligne
•  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

Contenu connexe

Tendances

JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesCharles 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 SzegediZeroTurnaround
 
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 languagesStarTech Conference
 
How to test code with mruby
How to test code with mrubyHow to test code with mruby
How to test code with mrubyHiroshi 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 RubyHiroshi SHIBATA
 
Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaJruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaKeith Bennett
 
Invokedynamic in 45 Minutes
Invokedynamic in 45 MinutesInvokedynamic in 45 Minutes
Invokedynamic in 45 MinutesCharles Nutter
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mrubyHiroshi 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.0Hiroshi SHIBATA
 
Hybrid concurrency patterns
Hybrid concurrency patternsHybrid concurrency patterns
Hybrid concurrency patternsKyle Drake
 
Ruby in office time reboot
Ruby in office time rebootRuby in office time reboot
Ruby in office time rebootKentaro 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.rbHiroshi 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 librarymametter
 
Testing nodejs apps
Testing nodejs appsTesting nodejs apps
Testing nodejs appsfelipefsilva
 
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 machineChun-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 futureHiroshi 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
 

Tendances (20)

JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for Dummies
 
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
 
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
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
How to test code with mruby
How to test code with mrubyHow to test code with mruby
How to test code with mruby
 
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
 
Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaJruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-java
 
Invokedynamic in 45 Minutes
Invokedynamic in 45 MinutesInvokedynamic in 45 Minutes
Invokedynamic in 45 Minutes
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
 
Test
TestTest
Test
 
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
 
Hybrid concurrency patterns
Hybrid concurrency patternsHybrid concurrency patterns
Hybrid concurrency patterns
 
Ruby in office time reboot
Ruby in office time rebootRuby in office time reboot
Ruby in office time reboot
 
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
 
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
 
Testing nodejs apps
Testing nodejs appsTesting nodejs apps
Testing nodejs apps
 
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
 
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
 
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)
 
Gpgpu intro
Gpgpu introGpgpu intro
Gpgpu intro
 

Similaire à Expert JavaScript Programming

Functional Programming in Clojure
Functional Programming in ClojureFunctional Programming in Clojure
Functional Programming in ClojureTroy Miles
 
Everything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPLEverything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPLMario-Leander Reimer
 
Everything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventureEverything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventureQAware GmbH
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsFabian Jakobs
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Martijn Verburg
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-wayRobert Lujo
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.jsorkaplan
 
T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJSTim Sommer
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to javaattiqrocket
 
Getting Started with PureScript
Getting Started with PureScriptGetting Started with PureScript
Getting Started with PureScriptJohn De Goes
 
Posladkajmo si JavaScript z uporabo TypeScript a
Posladkajmo si JavaScript z uporabo TypeScript aPosladkajmo si JavaScript z uporabo TypeScript a
Posladkajmo si JavaScript z uporabo TypeScript aPeter A. Pirc
 
1 java programming- introduction
1  java programming- introduction1  java programming- introduction
1 java programming- introductionjyoti_lakhani
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updatesVinay H G
 
Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overviewJesse Warden
 
Rails development environment talk
Rails development environment talkRails development environment talk
Rails development environment talkReuven Lerner
 
JSLab.Руслан Шевченко."JavaScript как платформа компиляции"
JSLab.Руслан Шевченко."JavaScript как платформа компиляции"JSLab.Руслан Шевченко."JavaScript как платформа компиляции"
JSLab.Руслан Шевченко."JavaScript как платформа компиляции"GeeksLab Odessa
 

Similaire à Expert JavaScript Programming (20)

Functional Programming in Clojure
Functional Programming in ClojureFunctional Programming in Clojure
Functional Programming in Clojure
 
Everything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPLEverything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPL
 
Everything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventureEverything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventure
 
From Web to Mobile with Stage 3D
From Web to Mobile with Stage 3DFrom Web to Mobile with Stage 3D
From Web to Mobile with Stage 3D
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script Applications
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-way
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJS
 
Lesson1 intro
Lesson1 introLesson1 intro
Lesson1 intro
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Lesson1 intro
Lesson1 introLesson1 intro
Lesson1 intro
 
Getting Started with PureScript
Getting Started with PureScriptGetting Started with PureScript
Getting Started with PureScript
 
Posladkajmo si JavaScript z uporabo TypeScript a
Posladkajmo si JavaScript z uporabo TypeScript aPosladkajmo si JavaScript z uporabo TypeScript a
Posladkajmo si JavaScript z uporabo TypeScript a
 
1 java programming- introduction
1  java programming- introduction1  java programming- introduction
1 java programming- introduction
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updates
 
Coffeescript
CoffeescriptCoffeescript
Coffeescript
 
Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overview
 
Rails development environment talk
Rails development environment talkRails development environment talk
Rails development environment talk
 
JSLab.Руслан Шевченко."JavaScript как платформа компиляции"
JSLab.Руслан Шевченко."JavaScript как платформа компиляции"JSLab.Руслан Шевченко."JavaScript как платформа компиляции"
JSLab.Руслан Шевченко."JavaScript как платформа компиляции"
 

Plus de 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 ErrorsYoshiki Shibukawa
 
FINAL FANTASY Record Keeperを支えたGolang
FINAL FANTASY Record Keeperを支えたGolangFINAL FANTASY Record Keeperを支えたGolang
FINAL FANTASY Record Keeperを支えたGolangYoshiki Shibukawa
 
東京Node学園 今できる通信高速化にトライしてみた
東京Node学園 今できる通信高速化にトライしてみた東京Node学園 今できる通信高速化にトライしてみた
東京Node学園 今できる通信高速化にトライしてみたYoshiki Shibukawa
 
Oktavia全文検索エンジン - SphinxCon JP 2014
Oktavia全文検索エンジン - SphinxCon JP 2014Oktavia全文検索エンジン - SphinxCon JP 2014
Oktavia全文検索エンジン - SphinxCon JP 2014Yoshiki Shibukawa
 
Oktavia Search Engine - pyconjp2014
Oktavia Search Engine - pyconjp2014Oktavia Search Engine - pyconjp2014
Oktavia Search Engine - pyconjp2014Yoshiki Shibukawa
 
JavaScriptゲーム制作勉強会
JavaScriptゲーム制作勉強会JavaScriptゲーム制作勉強会
JavaScriptゲーム制作勉強会Yoshiki Shibukawa
 
ドキュメントを作りたくなってしまう魔法のツール「Sphinx」
ドキュメントを作りたくなってしまう魔法のツール「Sphinx」ドキュメントを作りたくなってしまう魔法のツール「Sphinx」
ドキュメントを作りたくなってしまう魔法のツール「Sphinx」Yoshiki Shibukawa
 
つまみぐい勉強法。その後。
つまみぐい勉強法。その後。つまみぐい勉強法。その後。
つまみぐい勉強法。その後。Yoshiki Shibukawa
 

Plus de Yoshiki Shibukawa (20)

技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料
技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料
技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料
 
GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料
GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料
GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料
 
Golang tokyo #7 qtpm
Golang tokyo #7 qtpmGolang tokyo #7 qtpm
Golang tokyo #7 qtpm
 
Chunked encoding を使った高速化の考察
Chunked encoding を使った高速化の考察Chunked encoding を使った高速化の考察
Chunked encoding を使った高速化の考察
 
Mithril
MithrilMithril
Mithril
 
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
 
Excelの話
Excelの話Excelの話
Excelの話
 
FINAL FANTASY Record Keeperを支えたGolang
FINAL FANTASY Record Keeperを支えたGolangFINAL FANTASY Record Keeperを支えたGolang
FINAL FANTASY Record Keeperを支えたGolang
 
アンラーニング
アンラーニングアンラーニング
アンラーニング
 
東京Node学園 今できる通信高速化にトライしてみた
東京Node学園 今できる通信高速化にトライしてみた東京Node学園 今できる通信高速化にトライしてみた
東京Node学園 今できる通信高速化にトライしてみた
 
Oktavia全文検索エンジン - SphinxCon JP 2014
Oktavia全文検索エンジン - SphinxCon JP 2014Oktavia全文検索エンジン - SphinxCon JP 2014
Oktavia全文検索エンジン - SphinxCon JP 2014
 
Oktavia Search Engine - pyconjp2014
Oktavia Search Engine - pyconjp2014Oktavia Search Engine - pyconjp2014
Oktavia Search Engine - pyconjp2014
 
大規模JavaScript開発
大規模JavaScript開発大規模JavaScript開発
大規模JavaScript開発
 
Xpjug基調lt2011
Xpjug基調lt2011Xpjug基調lt2011
Xpjug基調lt2011
 
JavaScriptゲーム制作勉強会
JavaScriptゲーム制作勉強会JavaScriptゲーム制作勉強会
JavaScriptゲーム制作勉強会
 
Pomodoro technique
Pomodoro techniquePomodoro technique
Pomodoro technique
 
ドキュメントを作りたくなってしまう魔法のツール「Sphinx」
ドキュメントを作りたくなってしまう魔法のツール「Sphinx」ドキュメントを作りたくなってしまう魔法のツール「Sphinx」
ドキュメントを作りたくなってしまう魔法のツール「Sphinx」
 
Bitbucket&mercurial
Bitbucket&mercurialBitbucket&mercurial
Bitbucket&mercurial
 
つまみぐい勉強法。その後。
つまみぐい勉強法。その後。つまみぐい勉強法。その後。
つまみぐい勉強法。その後。
 
Erlang and I and Sphinx.
Erlang and I and Sphinx.Erlang and I and Sphinx.
Erlang and I and Sphinx.
 

Dernier

Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 

Dernier (20)

Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

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!