this post was submitted on 19 Jun 2025
97 points (86.5% liked)

Programmer Humor

36939 readers
204 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 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
[โ€“] ByteWelder 5 points 1 week ago (1 children)

In Kotlin, you can have the type become implicit with the former syntax: let text = number.toString() (text is a String here)

[โ€“] Witchfire@lemmy.world 3 points 1 week ago* (last edited 1 week ago)

You can also do that in TypeScript

readonly a!: Foo;
readonly b = bar.toFoo();

constructor(){
    a = bar.toFoo();
}