Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Win at live with JavaScript Patterns
Search
Pascal Precht
September 26, 2011
Programming
240
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
More Decks by Pascal Precht
See All by Pascal Precht
Introduction to HTML5 Filesystem API
pascalprecht
3
370
Version Control With Git
pascalprecht
8
600
An introduction to Git
pascalprecht
6
440
Making your JavaScript faster
pascalprecht
3
500
Other Decks in Programming
See All in Programming
sbt 2.0: takeoff
eed3si9n
0
190
SODA - FACT BOOK(EN)
sodainc
1
200
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
100
Web3Dライブラリを作ってVue Custom Rendererの仕組みを理解しよう / lets learn vue custom renderer by making 3d library
drumath2237
1
120
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
2
410
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
3
1.4k
GraphQL の onError と Nullability のこれから
quramy
0
200
Inertia Rails: The One-Person Framework with React & Friends
skryukov
0
210
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
320
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
220
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
1.2k
AI時代のIaC入門 〜なぜインフラをコードで管理したいのか?〜 / Introduction to IaC in the AI Era
akihisaikeda
6
1.3k
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Marketing to machines
jonoalderson
1
6k
Faster Mobile Websites
deanohume
310
32k
Thoughts on Productivity
jonyablonski
76
5.4k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
Un-Boring Meetings
codingconduct
0
480
Automating Front-end Workflow
addyosmani
1370
210k
The browser strikes back
jonoalderson
0
1.9k
Exploring anti-patterns in Rails
aemeredith
4
560
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
350
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