
Kotlin is like TypeScript - yoshiokatsuneo
https://gi-no.github.io/kotlin-is-like-typescript/
======
COil
I think we get it, every languages are like Kotlin!

~~~
toppy
Quite opposite - Kotlin is like every language ;)

------
realharo
TypeScript has structural typing, that is a HUGE difference.

~~~
seanmcdirmid
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.

~~~
atemerev
Scala has it. With Shapeless, you can go all crazy with it.

------
atemerev
"Happy languages are all alike; every unhappy language is unhappy in its own
way".

------
realharo

        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](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.

~~~
Cthulhu_
Some of the TS examples also include an external library (lodash) to compare
features; not sure if that's an apt comparison.

------
janwillemb
Why this comparison?

~~~
yoshiokatsuneo
Kotlin, Swift, and TypeScript have modern features like type inherence, null-
safe, closure, and are supported by big company.

~~~
TeMPOraL
> _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...

~~~
pjmlp
Still waiting for web developers to rediscover 90's RAD tooling.

~~~
realharo
I don't think we're ever going to go back to that. Those UIs were pretty
static, i.e. you only created the "initial state" in the UI designer, and then
modified it during the application run-time (sometimes even creating new
widgets in code), or attached some kind of data-binding models to it.

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.

~~~
romanovcode
I'm 100% we are.

Step 1: People realise that Electron apps look different and do not fit the
OS.

Step 2: Big company invests and creates a library that supports Win/OSX looks.

Step 3: Same big company creates a RAD type tooling for it.

We present you a revolution - Big Corp. RAD Tooling 2020 a la Borland Delphi
2007.

~~~
realharo
_> Step 1: People realise that Electron apps look different and do not fit the
OS._

This is not an issue for most people. I like to use Spotify (the desktop app)
as an example - it's a pretty good looking app, works nicely, and yet it uses
an HTML-based UI.

Microsoft's own UWP also looks vastly different than native Win32-based apps.

The resource usage and slowness of Electron apps is a problem, but that is
caused by using the entire browser runtime. When it comes to the capabilities
of a UI framework, one of the questions I ask is "Could you build something
like Spotify's UI with this? How difficult would it be?".

~~~
noway421
I really wonder whether something like electrino.js solves the problem of apps
being a memory hog. So far just a demo preview AFAIK, but they nailed the
problem of binary size pretty well.

I guess the question boils down to whether a single tab in a browser which is
properly managed by OS can compete with a good old native desktop app.

------
yoshiokatsuneo
derived from Swift is like Kotlin: [https://github.com/Nilhcem/swift-is-like-
kotlin](https://github.com/Nilhcem/swift-is-like-kotlin)

~~~
mbel
I guess that the next one will be: "Kotlin is like Rust", or perhaps there
should be "Kotlin is like Go" first?

~~~
qcz
Why not do "Kotlin is like PHP" or "Kotlin is like Visual Basic 6"
immediately?

~~~
COil
Could be fun.

~~~
pjmlp
You mean like Go is like Algol?

[http://cowlark.com/2009-11-15-go/](http://cowlark.com/2009-11-15-go/)

------
dtech
This is getting ridiculous

~~~
noway421
Kotlin getting love, this is nice, although in a very peculiar, syntax-
comparison type of way.

------
ccozan
Is this Kotlin the new "Erlang" of the HN' first page?

------
mhd
I wonder what's the oldest and/or most maligned language that you can use to
make a similar comparison that's still somewhat valid...

------
ptx
"for index in 1–5" is like "for let index of underscore dot range 1–6" in the
same way Lisp is like COBOL.

------
codesternews
Kotlin is like Swift

Kotlin is like TypeScript

that infer

TypeScript is like Swift

am I getting right? or Is there anything else?

~~~
Illniyar
Type script is like c#? Scala is like c#?

Is go like scala?

Everything is C (or lisp).

------
boubiyeah
Kotlin is also like Kotlin

~~~
noway421
Now, are there languages for which that doesn't hold true?

