O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.
Javascript
for multi disciplinary teams

101
Francisco M.S. Ferreira
Software Engineer at eBay

I present my own opinion and point of view, not the one of my employer.
Why use Java?

•
•
•
•
•

Used everywhere (allegedly)
Strongly typed language

Compiled language
Object Oriented

Tons of ...
Why use JavaScript?

•
•
•
•
•

Used everywhere (allegedly)
Strongly typed language

Compiled language
Object Oriented

To...
Why use JavaScript?

•
•
•
•
•
•

Used everywhere (allegedly)
Strongly typed language

Compiled language
Object Oriented

...
Typical team
Typical team

Front End

Back End
What to expect

• An intro to JavaScript
o Simulate Object-Oriented JavaScript

• Packaging / Folder structure
• Known wal...
Java class
Flexibility
Flexibility
My favorite
Fool proof

Private variables

Public functions
Tastes like Java
Step by step
Private variables
Public variables
Private functions
Public functions
Static variables
Static functions
Feels object oriented

No private statics
What about extensions?
What about extensions?
If JS was java…
Let’s apply
What happened there

• When calling apply or call:
o
o
o
o

The this scope is shared between functions
Allows multiple inh...
What happened there

• When calling apply or call:
o
o
o
o

The this scope is shared between functions
Allows multiple inh...
What happened there

• When calling apply or call:
o
o
o
o

The this scope is shared between functions
Allows multiple inh...
Folder naming
Java packages
Folder naming
Java packages

JavaScript folders
The three big walls of JS

•JavaScript is not type safe!

•JavaScript is single threaded!
•Lot’s of callbacks with closure...
Javascript !== TypeSafe
If you use:
===
!==
All these
would be
false
Equality of objects is deep
•

Recursively compare all elements

•

If order is guaranteed:
o JSON.stringify && compare JS...
Single Threaded!
setTimeout
someOtherCode
moreCode
...

aCallback
Mountain of Doom

• Hard to read
o And maintain

• Callback hell
• Issues
o
o
o
o

Memory Leaks
Error prone
Hard to debug
...
Q&A
Próximos SlideShares
Carregando em…5
×

de

JS for multidisciplinary teams Slide 1 JS for multidisciplinary teams Slide 2 JS for multidisciplinary teams Slide 3 JS for multidisciplinary teams Slide 4 JS for multidisciplinary teams Slide 5 JS for multidisciplinary teams Slide 6 JS for multidisciplinary teams Slide 7 JS for multidisciplinary teams Slide 8 JS for multidisciplinary teams Slide 9 JS for multidisciplinary teams Slide 10 JS for multidisciplinary teams Slide 11 JS for multidisciplinary teams Slide 12 JS for multidisciplinary teams Slide 13 JS for multidisciplinary teams Slide 14 JS for multidisciplinary teams Slide 15 JS for multidisciplinary teams Slide 16 JS for multidisciplinary teams Slide 17 JS for multidisciplinary teams Slide 18 JS for multidisciplinary teams Slide 19 JS for multidisciplinary teams Slide 20 JS for multidisciplinary teams Slide 21 JS for multidisciplinary teams Slide 22 JS for multidisciplinary teams Slide 23 JS for multidisciplinary teams Slide 24 JS for multidisciplinary teams Slide 25 JS for multidisciplinary teams Slide 26 JS for multidisciplinary teams Slide 27 JS for multidisciplinary teams Slide 28 JS for multidisciplinary teams Slide 29 JS for multidisciplinary teams Slide 30 JS for multidisciplinary teams Slide 31 JS for multidisciplinary teams Slide 32 JS for multidisciplinary teams Slide 33 JS for multidisciplinary teams Slide 34 JS for multidisciplinary teams Slide 35 JS for multidisciplinary teams Slide 36
Próximos SlideShares
<dc:title>Metadata, identifiers and linking content</dc:title>
Avançar
Transfira para ler offline e ver em ecrã inteiro.

1 gostou

Compartilhar

Baixar para ler offline

JS for multidisciplinary teams

Baixar para ler offline

jDays.se presentation

JS for multidisciplinary teams

  1. 1. Javascript for multi disciplinary teams 101
  2. 2. Francisco M.S. Ferreira Software Engineer at eBay I present my own opinion and point of view, not the one of my employer.
  3. 3. Why use Java? • • • • • Used everywhere (allegedly) Strongly typed language Compiled language Object Oriented Tons of available frameworks
  4. 4. Why use JavaScript? • • • • • Used everywhere (allegedly) Strongly typed language Compiled language Object Oriented Tons of available frameworks
  5. 5. Why use JavaScript? • • • • • • Used everywhere (allegedly) Strongly typed language Compiled language Object Oriented Tons of available frameworks Extremely flexible
  6. 6. Typical team
  7. 7. Typical team Front End Back End
  8. 8. What to expect • An intro to JavaScript o Simulate Object-Oriented JavaScript • Packaging / Folder structure • Known walls new developers hit o Type safety o Single threaded system o Mountain/Piramid of doom.
  9. 9. Java class
  10. 10. Flexibility
  11. 11. Flexibility
  12. 12. My favorite Fool proof Private variables Public functions
  13. 13. Tastes like Java
  14. 14. Step by step
  15. 15. Private variables
  16. 16. Public variables
  17. 17. Private functions
  18. 18. Public functions
  19. 19. Static variables
  20. 20. Static functions
  21. 21. Feels object oriented No private statics
  22. 22. What about extensions?
  23. 23. What about extensions?
  24. 24. If JS was java…
  25. 25. Let’s apply
  26. 26. What happened there • When calling apply or call: o o o o The this scope is shared between functions Allows multiple inheritances Allows order of execution in inheritances Directly inherits!
  27. 27. What happened there • When calling apply or call: o o o o The this scope is shared between functions Allows multiple inheritances Allows order of execution in inheritances Directly inherits! • It only shares: o ‘public’ functions and variables
  28. 28. What happened there • When calling apply or call: o o o o The this scope is shared between functions Allows multiple inheritances Allows order of execution in inheritances Directly inherits! • It only shares: o ‘public’ functions and variables • It may overwrite methods or get overwritten
  29. 29. Folder naming Java packages
  30. 30. Folder naming Java packages JavaScript folders
  31. 31. The three big walls of JS •JavaScript is not type safe! •JavaScript is single threaded! •Lot’s of callbacks with closures!
  32. 32. Javascript !== TypeSafe If you use: === !== All these would be false
  33. 33. Equality of objects is deep • Recursively compare all elements • If order is guaranteed: o JSON.stringify && compare JSONs • Use deep compare function ≈ 120 lines of code o http://stackoverflow.com/questions/1068834/object-comparison-in-javascript
  34. 34. Single Threaded! setTimeout someOtherCode moreCode ... aCallback
  35. 35. Mountain of Doom • Hard to read o And maintain • Callback hell • Issues o o o o Memory Leaks Error prone Hard to debug Hard to test
  36. 36. Q&A
  • DominikDary

    Dec. 12, 2013

jDays.se presentation

Vistos

Vistos totais

1.833

No Slideshare

0

De incorporações

0

Número de incorporações

1.098

Ações

Baixados

2

Compartilhados

0

Comentários

0

Curtir

1

×