Rsyslog deutsche Qualitätsarbeit für Linux Roman Gächter
Coffee Backone Introduction
1. 17.09.12 Workshop-Intro
Programmiersprache: CoffeeScript [24]
Kleine Programmiersprache, die zu JavaScript kompiliert wird
Einflüsse: Ruby, Python
Features: Bereinigte Syntax, Klassensystem, viele kleine Sprachfeatures
Vorteil: Lässt viele Probleme von JS verschwinden, mittlerweile recht populär [25]
Nachteil: Geschmacksfrage, Code schwerer zu debuggen
[24] http://coffeescript.org/
[25] https://github.com/languages
localhost/~peter/OpenSource/Pik6/presentations/Workshop 5 Tage/index_is24.html#print 29/94
2. 17.09.12 Workshop-Intro
Warum kein JavaScript?
/ a om irru?
/Wskmthe as
4.otig)
2tSrn(;
/ reoe as?
/Tu drfle
nwBoenfle =tu;
e ola(as)= re
/ reoe as?
/Tu drfle
{ =1
}= ;
/ a asethe?
/Wspsir ir
i(re{
ftu)
fnto o({
ucinfo)
rtr wf;
eun"t"
}
}
fo)
o(;
localhost/~peter/OpenSource/Pik6/presentations/Workshop 5 Tage/index_is24.html#print 30/94
3. 17.09.12 Workshop-Intro
JS == WTF
/ a om irru?
/Wskmthe as
4.otig) /SnaErr nxetdtknILGL
2tSrn(;/ ytxro:Uepce oe LEA
/ reoe as?
/Tu drfle
nwBoenfle =tu;/ re
e ola(as)= re /tu
/ reoe as?
/Tu drfle
{ =1 /Wdrnc!SnaErr nxetdtkn=
}= ;/ ee oh ytxro:Uepce oe =
/ a asethe?
/Wspsir ir
i(re{
ftu)
fnto o({
ucinfo)
rtr wf;
eun"t"
}
}
fo) /Ahni o e SEgn vroe nE5
o(;/ bäggvndrJnie(ebtni S)
localhost/~peter/OpenSource/Pik6/presentations/Workshop 5 Tage/index_is24.html#print 31/94
4. 17.09.12 Workshop-Intro
Kein Problem in CoffeeScript
#Wskmthe as
a om irru?
4.otig)#Srn 4"
2tSrn( tig"2
#Tu drfle
reoe as?
{ =1#fle
}= as
#Tu drfle
reoe as?
nwBoenfle= re#fleVrlihmt==
e ola as =tu as egec i =
#Wspsir ir
a asethe?
i re
ftu
fo=
o >
rtr wf
eun"t"
fo) tig"t"
o( #Srn wf
localhost/~peter/OpenSource/Pik6/presentations/Workshop 5 Tage/index_is24.html#print 32/94
8. 17.09.12 Workshop-Intro
CoffeeScriptFeatures
zh ubrwno.rmt'i ieZh i'
al=Nme idwpop Gben alen
#AlsitenAsrc sls r/ac)
le s i uduk(ebttycth
#Fltruhbi`wth idvridr
alhog e sic`wr ehnet
sau wthzh
tts=sic al
we 3te enNr'
hn2 hn'i ed
we 2te enGe'
hn4 hn'i ek
es
le
#Vrett egece
ekteeVrlih
i 00>zh 90
f90 al>00
'agelg
lnwii'
es
le
'rßnaning
göewhsni'
#Srnneplto
tigItroain
wno.lr D it#sau}
idwaet"ubs {tts"
localhost/~peter/OpenSource/Pik6/presentations/Workshop 5 Tage/index_is24.html#print 36/94
9. 17.09.12 Workshop-Intro
CoffeeScriptFeatures
casTe lse
ls ir #Kasn
eege
nri:0
cntutr @ae='en' > aaeeeals
osrco:(nm Brd) #PrmtrDfut
fis >@nri+ @ ti`
rs: eege+ #``=`hs
sib >@nri 1
tr: eege=
casShag xed ir
ls clneetnsTe
fis ofr >
rs:(pe)
ofrsib)
pe.tr(
spr) ifce spr)
ue( #enahs`ue(`
brd=nwTe(
en e ir)
ags e clne'uut)
uut=nwShag(Ags'
ags.rs en
uutfisbrd
wno.lr uuteege
idwaetags.nri
localhost/~peter/OpenSource/Pik6/presentations/Workshop 5 Tage/index_is24.html#print 37/94
10. 17.09.12 Workshop-Intro
CoffeeScriptNachteile
Große Ausdrucksfreiheit (mehr Nachdenken erforderlich)
Whitespace kann nerven (v.a. bei Wrapperfunktionen)
Debuggt werden muss das kompilierte JavaScript
localhost/~peter/OpenSource/Pik6/presentations/Workshop 5 Tage/index_is24.html#print 38/94
16. 17.09.12 Workshop-Intro
Daten speichern
#Fruabednafne
omlrAsne bagn
$'om)sbi et >
(fr'.umt(v)
etpeeteal( bednsopn
v.rvnDfut)#Asne tpe
nwtm=nwIe( ee oe ae..
eIe e tm)#NusMdlbun.
nwtmst'il' (iptnm=tte])vl)
eIe.e tte,$'nu[ae"il"'.a(
nwtmst'roiy,$'eetnm=pirt"'.a(
eIe.e pirt' (slc[ae"roiy])vl)
Iesadnwtm . e olcinhnuüe..
tm.d eIe #..drCleto izfgn.
nwtmsv( . n pihr!
eIe.ae) #..udsecen
localhost/~peter/OpenSource/Pik6/presentations/Workshop 5 Tage/index_is24.html#print 66/94
17. 17.09.12 Workshop-Intro
(Stellt euch hier einfach eine Demo des Gezeigten vor)
localhost/~peter/OpenSource/Pik6/presentations/Workshop 5 Tage/index_is24.html#print 67/94
18. 17.09.12 Workshop-Intro
Gute Sachen
Fertige Bausteine (Models, Views, Collections) mit nützlichen Defaults
Viel nützliches Zubehör (Underscore, Events, Templating)
Konventionen und gleichzeitig viele Freiheitenn
localhost/~peter/OpenSource/Pik6/presentations/Workshop 5 Tage/index_is24.html#print 68/94
19. 17.09.12 Workshop-Intro
Offene Fragen
Wie strukturieren wir übergeordnete Konzepte wie Module?
Wie wird ein „Item“ repräsent? Seite? Widget?
Wie managen wir Permissions und Authentifizierung?
Backbone gibt uns keine Antworten hierauf!
localhost/~peter/OpenSource/Pik6/presentations/Workshop 5 Tage/index_is24.html#print 69/94