this post was submitted on 19 Jun 2025
27 points (90.9% liked)

Programming Humor

3199 readers
1 users here now

Related Communities [email protected] [email protected] [email protected] [email protected]

Other Programming Communities [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]

founded 2 years ago
MODERATORS
 

Made with KolourPaint and screenshots from Kate (with the GitHub theme).

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 5 points 2 weeks ago (5 children)

I see your TypeScript and raise you kotlin:

var a: String
[–] [email protected] 1 points 2 weeks ago (1 children)

What’s up with that syntax? Why the use of var here?

[–] [email protected] 3 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

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).

[–] [email protected] 1 points 1 week ago (2 children)

So a var can start as a string and later be an integer?

[–] [email protected] 2 points 1 week ago

No, the type is strict and fixed.

[–] [email protected] 2 points 1 week ago

I don't know Kotlin but in other languages "(im)mutable" refers to the value, not the type.

load more comments (3 replies)