Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I agree with this. When the library docs and examples are in the native language (ES*) it's easier for developers unfamiliar with the code base to get on board.

We've switched to Typescript for our React projects because we've found it's the sweet spot between developer perks (type checking, static analysis, intellisense, inline lint errors) and abstraction of the actual code running in production. It's also a lot less of a readjustment to make if you need to dive into the transpiled source to track down a subtle or unusual bug.



I agree principally, however I haven't found it to be an issue.

Kotlin is rather literal in it's translation. Arrays are mapped to arrays, interfaces are mapped to objects.

Plus you can use plain javascript anywhere in your code:

    val p: MyTypedObject = js("new require('something.js').default")

    val other: MyTypedObject
    js("Object.assign(other, p")
Or you write wrappers which do what you think they do:

    @JsModule("react")
    external object React {
        fun createElement(name: String, props: dynamic, vararg children: dynamic): ReactElement

        interface ReactElement {}
    }
It's definitely necessary to understand both languages though.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: