SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Javascript
DEVELOPER’S LIFE
Who am I?


•   Ramkumar Murugadoss
•   @rampicos
•   facebook.com/raamkumar.m
•   Code
What is JavaScript


• Javascript is the Programming language, first emerged to
  make dynamic scripts for Web pages
• What do you think about Javascript?
Why Javascript




• What we use for: Programming Language for Web Pages
• How it was in current: Programming Language for Server-side too
• In near future: It is most wanted huge Programming Language for all
Best Practices


• All we know Javascript
• Everyone can code in Javascript
• All we want to know, how efficiently we will write JS
About GC


• GC is automatic
• Objects are collected there is no references longer
• Javascript Uses Mark and Sweep GC method
Avoid the global scope


• In the Global scope the Object never null, so never garbage
  collected
• It’s time taking and trivial process to get the reference of
  global scope
• If need to use global scope assign yourself null after the use
Use var


• Don’t forget to use var for all your variables
• The Variables without var may considered to global
• You are making javascript to struggle for finding the scope of
  your variable
Get Use of Self-Calling Functions


• Have any one noticied jQuery using self calling functions
What will be the result?
Make your loops more efficient
Conditional Branching
Creating Arrays and Objects


• Use [] instead of Array
   • Use arrayVariable[length] = value instead of
     arrayVariable.push(value)
• Use {} instead of Object
Closures


• A closure is a special kind of object that combines two
  things: a function, and the environment in which that function
  was created
• The environment consists of any local variables that were in-
  scope at the time that the closure was created
Closures Cond…
Closures Cond…
Namespaces


 • this prevent the global scope pollution
 • this protect your code from colliding with other code or libraries
Building String in Loops
Small Intro to OOPs




• Everything in Javascript is Object based, (note there is no keyword called class in
  JS)
• Now the question is then how can I create the Objects and its functions?
OOPs cond


• Creating functions in JS is considered to the Object, using prototypes you can
  define methods for that
Any Guess




• What is the difference between this two codes
Don’t D.R.Y




• Make the reusability
• Make use of Namespace
Cross Platform Mobile Applications



• What are Cross Platform Mobile Applications ?

•   Why build Cross Platform ?

•   What are the most popular development framework available ?

•   Which framework should I use?
Why Titanium


• Code Once Build Everywhere
• Native look and feel
• Has more than 5,500+ device level APIs for iOS and Android
• Object based Javascript only
• In build Analytics
• In build Cloud integration support (ACS)
• Much more
What to do to start with Titanium today?



Signup and download http://my.appcelerator.com




Follow the “Quick Start” https://wiki.appcelerator.org/display/guides/home




You’re ready to be a Titanium      developer!
CommonJS



• The Biggest feature introduced from Node.js for reusability is CommonJS
• Make your functions as unique namespaced modules and get to use of that
• We have exports.yourfunction and module.exports as 2 ways to create
  CommonJS modules
• Woow now browsers support CommonJS with some libraries
exports.your function
module.exports
Javascript Best Practices and Intro to Titanium

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Metaprogramming JavaScript
Metaprogramming  JavaScriptMetaprogramming  JavaScript
Metaprogramming JavaScript
 
The Gist of React Native
The Gist of React NativeThe Gist of React Native
The Gist of React Native
 
Javascript
JavascriptJavascript
Javascript
 
Survive JavaScript - Strategies and Tricks
Survive JavaScript - Strategies and TricksSurvive JavaScript - Strategies and Tricks
Survive JavaScript - Strategies and Tricks
 
JavaScript : A trending scripting language
JavaScript : A trending scripting languageJavaScript : A trending scripting language
JavaScript : A trending scripting language
 
An Intro to Angular 2
An Intro to Angular 2An Intro to Angular 2
An Intro to Angular 2
 
Developing Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJSDeveloping Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJS
 
JavaScript Good Practices
JavaScript Good PracticesJavaScript Good Practices
JavaScript Good Practices
 
Integrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationIntegrating React.js Into a PHP Application
Integrating React.js Into a PHP Application
 
The Road to Native Web Components
The Road to Native Web ComponentsThe Road to Native Web Components
The Road to Native Web Components
 
Single Page Applications with AngularJS 2.0
Single Page Applications with AngularJS 2.0 Single Page Applications with AngularJS 2.0
Single Page Applications with AngularJS 2.0
 
Type script for_java_dev_jul_2020
Type script for_java_dev_jul_2020Type script for_java_dev_jul_2020
Type script for_java_dev_jul_2020
 
Dart for Java Developers
Dart for Java DevelopersDart for Java Developers
Dart for Java Developers
 
A tour of React Native
A tour of React NativeA tour of React Native
A tour of React Native
 
Aligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsAligning Ember.js with Web Standards
Aligning Ember.js with Web Standards
 
AngularJS Introduction
AngularJS IntroductionAngularJS Introduction
AngularJS Introduction
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
 
OSGi and Spring Data for simple (Web) Application Development
OSGi and Spring Data  for simple (Web) Application DevelopmentOSGi and Spring Data  for simple (Web) Application Development
OSGi and Spring Data for simple (Web) Application Development
 
Object Oriented Javascript
Object Oriented JavascriptObject Oriented Javascript
Object Oriented Javascript
 
Scal`a`ngular - Scala and Angular
Scal`a`ngular - Scala and AngularScal`a`ngular - Scala and Angular
Scal`a`ngular - Scala and Angular
 

Ähnlich wie Javascript Best Practices and Intro to Titanium

End to End Testing with nightwatchjs
End to End  Testing with nightwatchjsEnd to End  Testing with nightwatchjs
End to End Testing with nightwatchjs
Srikanth Madduri
 

Ähnlich wie Javascript Best Practices and Intro to Titanium (20)

Using Javascript in today's world
Using Javascript in today's worldUsing Javascript in today's world
Using Javascript in today's world
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Swagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlierSwagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlier
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
 
Building mobile apps with PhoneGap and Backbone
Building mobile apps with PhoneGap and BackboneBuilding mobile apps with PhoneGap and Backbone
Building mobile apps with PhoneGap and Backbone
 
Enterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScriptEnterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScript
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
 
Mvvm knockout vs angular
Mvvm knockout vs angularMvvm knockout vs angular
Mvvm knockout vs angular
 
Presentation
PresentationPresentation
Presentation
 
Using type script to build better apps
Using type script to build better appsUsing type script to build better apps
Using type script to build better apps
 
Using type script to build better apps
Using type script to build better appsUsing type script to build better apps
Using type script to build better apps
 
Kevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScriptKevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScript
 
Edy Dawson Notes on SF HTML5 Dev Conf
Edy Dawson Notes on SF HTML5 Dev ConfEdy Dawson Notes on SF HTML5 Dev Conf
Edy Dawson Notes on SF HTML5 Dev Conf
 
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript FrameworksBuilding Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
 
MEAN Stack Warm-up
MEAN Stack Warm-upMEAN Stack Warm-up
MEAN Stack Warm-up
 
Introduction to React native
Introduction to React nativeIntroduction to React native
Introduction to React native
 
Mastering react with redux
Mastering react with reduxMastering react with redux
Mastering react with redux
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
 
Javascript best practices
Javascript best practicesJavascript best practices
Javascript best practices
 
End to End Testing with nightwatchjs
End to End  Testing with nightwatchjsEnd to End  Testing with nightwatchjs
End to End Testing with nightwatchjs
 

Kürzlich hochgeladen

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Kürzlich hochgeladen (20)

On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 

Javascript Best Practices and Intro to Titanium

  • 2. Who am I? • Ramkumar Murugadoss • @rampicos • facebook.com/raamkumar.m • Code
  • 3. What is JavaScript • Javascript is the Programming language, first emerged to make dynamic scripts for Web pages • What do you think about Javascript?
  • 4. Why Javascript • What we use for: Programming Language for Web Pages • How it was in current: Programming Language for Server-side too • In near future: It is most wanted huge Programming Language for all
  • 5. Best Practices • All we know Javascript • Everyone can code in Javascript • All we want to know, how efficiently we will write JS
  • 6. About GC • GC is automatic • Objects are collected there is no references longer • Javascript Uses Mark and Sweep GC method
  • 7. Avoid the global scope • In the Global scope the Object never null, so never garbage collected • It’s time taking and trivial process to get the reference of global scope • If need to use global scope assign yourself null after the use
  • 8. Use var • Don’t forget to use var for all your variables • The Variables without var may considered to global • You are making javascript to struggle for finding the scope of your variable
  • 9. Get Use of Self-Calling Functions • Have any one noticied jQuery using self calling functions
  • 10. What will be the result?
  • 11. Make your loops more efficient
  • 13. Creating Arrays and Objects • Use [] instead of Array • Use arrayVariable[length] = value instead of arrayVariable.push(value) • Use {} instead of Object
  • 14. Closures • A closure is a special kind of object that combines two things: a function, and the environment in which that function was created • The environment consists of any local variables that were in- scope at the time that the closure was created
  • 17. Namespaces • this prevent the global scope pollution • this protect your code from colliding with other code or libraries
  • 19. Small Intro to OOPs • Everything in Javascript is Object based, (note there is no keyword called class in JS) • Now the question is then how can I create the Objects and its functions?
  • 20. OOPs cond • Creating functions in JS is considered to the Object, using prototypes you can define methods for that
  • 21. Any Guess • What is the difference between this two codes
  • 22. Don’t D.R.Y • Make the reusability • Make use of Namespace
  • 23.
  • 24. Cross Platform Mobile Applications • What are Cross Platform Mobile Applications ? • Why build Cross Platform ? • What are the most popular development framework available ? • Which framework should I use?
  • 25. Why Titanium • Code Once Build Everywhere • Native look and feel • Has more than 5,500+ device level APIs for iOS and Android • Object based Javascript only • In build Analytics • In build Cloud integration support (ACS) • Much more
  • 26. What to do to start with Titanium today? Signup and download http://my.appcelerator.com Follow the “Quick Start” https://wiki.appcelerator.org/display/guides/home You’re ready to be a Titanium developer!
  • 27. CommonJS • The Biggest feature introduced from Node.js for reusability is CommonJS • Make your functions as unique namespaced modules and get to use of that • We have exports.yourfunction and module.exports as 2 ways to create CommonJS modules • Woow now browsers support CommonJS with some libraries