Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Win at live with JavaScript Patterns
Search
Pascal Precht
September 26, 2011
Programming
2
210
Win at live with JavaScript Patterns
German slides about JavaScript Coding Patterns for the first Hannover.js Meetup in Germany
Pascal Precht
September 26, 2011
Tweet
Share
More Decks by Pascal Precht
See All by Pascal Precht
Introduction to HTML5 Filesystem API
pascalprecht
3
340
Version Control With Git
pascalprecht
8
500
An introduction to Git
pascalprecht
6
410
Making your JavaScript faster
pascalprecht
3
430
Other Decks in Programming
See All in Programming
Three ways to use AI on Android: The Good, the Bad and the Ugly
marxallski
0
110
Git Lint
bkuhlmann
4
760
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
280
スキーマ駆動開発による品質とスピードの両立 - 私達は何故、スキーマを書くのか
kentaroutakeda
0
180
Elm 0.19.0 Changes
bkuhlmann
0
510
Milestoner
bkuhlmann
1
410
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
380
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
6
1.2k
Scalable Customer Journey Orchestration (CJO)
lewuathe
0
420
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
250
業務ツールとして使うPostman
msys75
0
110
Goのエラースタックトレースの歴史と今後
sonatard
10
1.8k
Featured
See All Featured
Fireside Chat
paigeccino
22
2.6k
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
34
6k
jQuery: Nuts, Bolts and Bling
dougneiner
60
7.2k
Art, The Web, and Tiny UX
lynnandtonic
290
19k
Ruby is Unlike a Banana
tanoku
96
10k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
22
1.6k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
188
16k
Writing Fast Ruby
sferik
622
60k
The Invisible Customer
myddelton
114
12k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
26
2.3k
Principles of Awesome APIs and How to Build Them.
keavy
121
16k
Transcript
Win at live with JavaScript Patterns By Pascal Precht HannoverJS
08/11
I am not a Guru!
None
Gutes Software- Design
„Kaum etwas ist so schnellen Veränderungen unterworfen wie Software.“
„Software muss erweiterbar sein.“
Patterns
Was ist ein Pattern?
Eine Lösung für ein häufig auftretendes Problem.
... Eine bewährte Vorgehensweise, eine nützliche Abstraktion und eine Vorlage
für das Lösen ganzer Problem- Kategorien.
Welche Vorteile bieten Patterns?
Vorteile von Patterns v Besserer Code / Vermeidung von Redundanzen
v Abstraktion v Bessere Kommunikation im Team
Arten der Patterns
Arten der Patterns v Design-Patterns // Entwurfsmuster v Coding-Patterns //
Spezifische Muster v Anti-Patterns // „Negative Assoziation“
JavaScript Patterns
None
Das funktioniert.
None
Aber Vorsicht!
None
None
None
None
Hoisting
None
None
None
Das Single-var-Pattern
None
Vorteile des Single-var- Pattern
Vorteile des Single-var- Pattern v Zentrale Deklaration/Initialisierung v Code ist
leichter zu lesen v Vermeidung logischer Fehler
The better way!
Objekte und Literale
None
Very bad!
None
Achtung!
None
None
Das Object-Literal- Pattern
None
Vorteile des Object- Literal-Pattern v Weniger Code v Objects sind
„nur“ Hashes v Keine Object-Constructor-Überraschungen
But I need a constructor!
None
Sh*t! I forgot the new!
Ohne new zeigt this auf das globale Objekt!
None
Muster zum erzwingen von new
None
Funktionen
Das Callback-Pattern
None
None
None
None
Immediate-Function- Pattern
None
None
Vorteile des Immediate- Function-Pattern
Vorteile des Immediate- Function-Pattern v Kapselung von Aufgaben v Keine
globale Variabeln v Modulares Verhalten
Das Immediate-Object- Pattern
None
Vorteile des Immediate- Object-Pattern
Vorteile des Immediate- Object-Pattern v Globaler Namesraum wird frei gehalten
v Modulares Verhalten v Private Hilfs-Funktionen sind deutlich erkennbar
None
None
Das Configuration- Object-Pattern
None
None
None
Vorteile des Object- Configuration-Pattern
Flexibilität.
None
None
None
Thank you!
Stay tuned! Twitter: @PascalPrecht Blog: HopelessArt.com
None