- cross-posted to:
- [email protected]
- [email protected]
- cross-posted to:
- [email protected]
- [email protected]
Made with KolourPaint and screenshots from Kate (with the GitHub theme).
I see your TypeScript and raise you kotlin:
var a: String
What’s up with that syntax? Why the use of var here?
Kotlin knows mutable and immutable variables.
var
indicate mutables andval
would indicate immutables (comparable with thefinal
modifier in java andconst
in JavaScript/TypeScript).So a var can start as a string and later be an integer?
No, the type is strict and fixed.
I don’t know Kotlin but in other languages “(im)mutable” refers to the value, not the type.
TypeScript vs Java?
char a[69]; btw.
Why have String when we have a perfectly good array at home?
because
char*
sucks
a = “”
Say that again, motherfucker! 🔫
When String a without being told Let a: String -
“Ah ah ah! Simon didn’t say!”