-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
228 lines (190 loc) · 6.59 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<!--[if lt IE 9]>
<script src="html-slideshow/lib/html5shim.js"></script>
<![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="html-slideshow/lib/styles.css" />
<link href='//fonts.googleapis.com/css?family=Asap:700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/styles.css" />
<title>C++ to Scala - A quick taste</title>
</head>
<body>
<header class="showOnMouse">
<h1>C++ to Scala - A quick taste</h1>
<nav>
<ul>
<li><button id="prev-btn" title="Previous slide">Previous Slide</button></li>
<li><span id="slide-number"></span>/<span id="slide-total"></span></li>
<li><button id="next-btn" title="Next Slide">Next Slide</button></li>
</ul>
</nav>
</header>
<div id="deck">
<!-- Begin slides -->
<!-- SLIDE ----------------------------------------------------------------- -->
<section>
<hgroup>
<h1>C++ to <img src="images/scala.svg" style="height:0.8em;">Scala</h1>
<h2>A quick taste</h2>
</hgroup>
<blockquote style="max-width:30em; margin-top: 1em; margin: 0 auto;" class="indent" cite="http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html">
<p>A drunken Martin Odersky sees a Reese's Peanut Butter Cup ad featuring somebody's peanut butter getting on somebody else's chocolate and has an idea.</p>
<p>He creates Scala, a language that unifies constructs from both object oriented and functional languages. This pisses off both groups and each promptly declares jihad.</p>
</blockquote>
<div style="text-align:center">
<figure class="codeFigure">
<pre class="syntax scala">
object HelloWorld {
def main(args: Array[String]) {
println("Hello, world!")
}
} </pre>
</figure>
</div>
<p style="position:absolute; bottom: 0; font-size:medium;">Tip: Use arrow keys or spacebar.</p>
</section>
<!-- SLIDE ----------------------------------------------------------------- -->
<section>
<hgroup>
<h1><img src="images/java.svg" style="height:1em;">Java</h1>
<h2>Limitations</h2>
</hgroup>
<ul>
<li>No Destructor</li>
<li>final vs const (Object * const)</li>
<li>Generics & Type Erasure</li>
</ul>
</section>
<!-- SLIDE ----------------------------------------------------------------- -->
<section>
<hgroup>
<h1><img src="images/java.svg" style="height:1em;">Static</h1>
</hgroup>
<div style="text-align:center">
<figure class="codeFigure">
<pre class="syntax scala">
object HelloWorld {
def main(args: Array[String]) {
println("Hello, world!")
}
} </pre>
</figure>
</div>
</section>
<!-- SLIDE ----------------------------------------------------------------- -->
<section>
<hgroup>
<h1><img src="images/scala.svg" style="height:0.8em;">Packages</h1>
<h2>Aka. Namespaces</h2>
</hgroup>
<div style="text-align:center">
<figure class="codeFigure">
<pre class="syntax scala">
package net.codingwell.myapp
import net.codingwell.myapp.magic.MagicFactory
import net.codingwell.myapp.useful.{OneClass, AnotherClass}
import net.codingwell.{VeryVeryLongNameForClass => ShortName}
import net.codingwell.utils._</pre>
</figure>
</div>
</section>
<!-- SLIDE ----------------------------------------------------------------- -->
<section>
<hgroup>
<h1><img src="images/scala.svg" style="height:0.8em;">Access Modifiers</h1>
</hgroup>
<div style="text-align:center">
<figure class="codeFigure">
<pre class="syntax scala">
def ...
protected def ...
private def ...</pre>
</figure>
</div>
<div style="text-align:center">
<figure class="action codeFigure">
<pre class="syntax scala">
protected[utils] def ...
private[myapp] def ...
private[this] def ...</pre>
</figure>
</div>
</section>
<section>
<hgroup>
<h1><img src="images/scala.svg" style="height:0.8em;">Type Inference</h1>
<h2>Auto</h2>
</hgroup>
<div style="text-align:center">
<figure class="codeFigure">
<pre class="syntax scala">
val variable = doSomething( "parameter" )</pre>
</figure>
</div>
</section>
<section>
<hgroup>
<h1><img src="images/scala.svg" style="height:0.8em;">The Void</h1>
<h2>Unit, Nothing, Nil, None, & Null</h2>
</hgroup>
<ul class="action">
<li>Unit - Basically 'void'...</li>
<li>Nothing - 'Nothing' extends everything</li>
<li>Nil - An empty array of 'Nothing'</li>
<li>None - Subclass of Option</li>
<li>Null - Legacy support for Java</li>
</ul>
</section>
<section>
<hgroup>
<h1><img src="images/scala.svg" style="height:0.8em;">Variance</h1>
<h2>Covariance & Contravariance</h2>
</hgroup>
<ul class="action">
<li>Unit - Basically 'void'...</li>
<li>Nothing - 'Nothing' extends everything</li>
<li>Nil - An empty array of 'Nothing'</li>
<li>None - Subclass of Option</li>
<li>Null - Legacy support for Java</li>
</ul>
</section>
<section>
<hgroup>
<h1><img src="images/scala.svg" style="height:0.8em;">Tuples</h1>
<h2>std::pair is so 1994</h2>
</hgroup>
<ul class="action">
<li>Unit - Basically 'void'...</li>
<li>Nothing - 'Nothing' extends everything</li>
<li>Nil - An empty array of 'Nothing'</li>
<li>None - Subclass of Option</li>
<li>Null - Legacy support for Java</li>
</ul>
</section>
<section>
<hgroup>
<h1><img src="images/scala.svg" style="height:0.8em;">Currying</h1>
<h2></h2>
</hgroup>
</section>
<!-- /End slides -->
</div>
<!-- /deck -->
<script src="html-slideshow/lib/jquery-1.6.4.min.js"></script>
<script src="html-slideshow/lib/jquery.jswipe-0.1.2.js"></script>
<script src="jquery-syntax/public/jquery.syntax.min.js"></script>
<script src="html-slideshow/lib/htmlSlides.js"></script>
<script>
//Do our business when the DOM is ready for us
$(function() {
//One little option: hideToolbar (boolean; default = false)
htmlSlides.init({});
// This function highlights (by default) pre and code tags which are annotated correctly.
$.syntax({root: 'jquery-syntax/public/', blockLayout: 'plain', theme: 'base'});
});
</script>
</body>
</html>