Hacker News new | past | comments | ask | show | jobs | submit login

Yes exactly. There must be some good reason why TS chose the syntax they did, because a lot of it feels very old-school-java.



Type inference is one good reason. Similar syntax exists in a few modern languages, too: e.g. Rust and Swift. In languages with type inference it can be convenient that type annotations are in the postfix position relative to variable names:

    let user = new User();
    let user: User = new User();




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: