44. C E Y L O N - C O D E
shared actual void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.Ilayout.activity_main);
assert (is TextView textView = findViewById(R.Iid.action_settings));
}
45. C E Y L O N - T H I N G S
• Type system
• Mixins
• String?
• Packages and modules inside Ceylon
46. C E Y L O N - O P I N I O N
• Not ready. Future?
• Doubt so.
49. S C A L A - H O W ?
• Gradle plugin?
• Post 47 degrees: Idea + plugins + SBT + activator…
• About 1 hour
50. T R O L L I N G S C A L A
• findView without casts -> a trait
• scala one liners -> hard to read by others but nice in collections
• scala -> 2.8M with proguard -> heaviest environment
• NPE -> with optionals, great solution IMHO
• implicit context -> magic everywhere
• traits -> quite common (kotlin, ceylon, ‘groovy’…)
• no getters/setters -> quite common
• pattern matching -> it’s nice but pure functional style
• case classes -> a glorified switch/if
51. S C A L A - T H I N G S
• Types
• Multiple programming styles
• Optional
52. S C A L A - O P I N I O N
• I love scala, way better than Java, but…
• Paradigm swift
• Programmers (25 in TIOBE)
53. S C A L A - S C A L O I D
new SVerticalLayout {
STextView("Sign in").textSize(24.5 sp).<<.marginBottom(25 dip).>>
STextView("ID")
SEditText()
STextView("Password")
SEditText() inputType TEXT_PASSWORD
SButton("Sign in")
this += new SLinearLayout {
SButton("Help")
SButton("Sign up")
}.wrap
}.padding(20 dip)
54. S C A L A - M A C R O I D
// the layout goes here
setContentView {
getUi {
l[LinearLayout](
w[Button],
w[TextView]
)
}
}
58. “ W h o s e b e t t i n g t h i s y e a r s I / O w i l l
a n n o u n c e t h e re p l a c e m e n t o f t h e
A n d ro i d A P I w i t h t h e G o A P I ? “
59. “ I l l o g i c a l , i r re s p o n s i b l e , i n s a n e
p e o p l e a re b e t t i n g t h i s . ”
“ G o , f o r C p e o p l e w h o h a t e
C + + b u t a re t o o a f r a i d o f re a l
I D E s f o r J a v a . ”
J a k e W h a r t o n
60. G O - H O W ?
• Docker image (docker -> boot2docker -> missing
steps -> worst hello world ever!)
• About 2 hours (image is 4GB! + docker errors + no
documentation)
61. G O - C O D E
• 2 ways:
• Shared Library (JNI…)
• All go
62. G O - C O D E
• var State
• func Run
• type Callbacks (Start, Stop, Draw)
• Stubs
63. G O - O P I N I O N
• API for OpenGL/business logic
• Not ready for “classic” app.
• I’m worried about iOS support
97. O K … K O T L I N V S S C A L A , F I G H T !
• Kotlin ppl are nice: comparison to scala -> if u are
already using Scala or need sth on that list…
• A good, external, comparison
98. O K … K O T L I N V S S C A L A , F I G H T !
• The main design goals behind “Kotlin” are:
• To create a Java-compatible language,
• That compiles at least as fast as Java,
• Make it safer than Java, i.e. statically check for common pitfalls such as
null pointer dereference,
• Make it more concise than Java by supporting variable type inference,
higher-order functions (closures), extension functions, mixins and first-
class delegation, etc;
• And, keeping the useful level of expressiveness (see above), make
it way simpler than the most mature competitor – Scala.
99. N E W A N D R O I D
L A N G U A G E S
J A V I E R G A M A R R A : : @ N H PA T T