I see your TypeScript and raise you kotlin:
var a: String
Related Communities !programmerhumor@lemmy.ml !programmer_humor@programming.dev !programmerhumor@kbin.social !programming_horror@programming.dev
Other Programming Communities !programming@beehaw.org !programming@programming.dev !programming@lemmy.ml !programming@kbin.social !learn_programming@programming.dev !functional_programming@programming.dev !embedded_prog@lemmy.ml
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 and val
would indicate immutables (comparable with the final
modifier in java and const
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.
a = ""
Say that again, motherfucker! 🔫
TypeScript vs Java?
char a[69]; btw.
Why have String when we have a perfectly good array at home?
because char*
sucks
When String a without being told Let a: String -
"Ah ah ah! Simon didn't say!"
To keep the casuals away