I think we get it, every languages are like Kotlin!
Kotlin is like TypeScript
21–30 of 49 posts
Re: Kotlin is like TypeScript
#22Re: Kotlin is like TypeScript
#23 name: string;
constructor(name: string) {
this.name = name
}
You don't have to do this in TypeScript either, you can just do constructor(public name: string) { }
Also, the "Empty collections" section doesn't do the same thing, the collections you created in Kotlin are immutable.And the TypeScript ones have the value `undefined` (unfortunate that strictNullChecks doesn't catch things like that https://github.com/Microsoft/TypeScript/issues/8476).
And for some nitpicking, please be consistent with your semicolons, either use them or don't use them, but don't mix it randomly like that.
Re: Kotlin is like TypeScript
#24TypeScript has structural typing, that is a HUGE difference.
Ya, I'm not away of any other popular OO language that goes this route. The implications of structural sub-typing are huge, though I guess many programmers wouldn't be able to call it out.
Re: Kotlin is like TypeScript
#25Re: Kotlin is like TypeScript
#26Re: Kotlin is like TypeScript
#27Re: Kotlin is like TypeScript
#28Earlier quoted context omitted.
> modern features like type inherence, null-safe, closure This is one of the more annoying problems with our industry. People rediscover solutions from 60s and 70s and sell them as if they were new and revolutionary...
Still waiting for web developers to rediscover 90's RAD tooling.
With the popularity of things like React, you now have a powerful way to express how the UI looks in every state, not just the initial one.
Re: Kotlin is like TypeScript
#29Re: Kotlin is like TypeScript
#30TypeScript has structural typing, that is a HUGE difference.
Scala has it too indeed, but it's not the default mode and feels awkward, also has known limitations.
The nice thing with typescript is that structural typing makes sense for 90% of the use cases, and for the remaining 10%, you can very easily simulate nominal typing by adding a field like so:
interface Robot { __Robot: true }