• 0 Posts
  • 2 Comments
Joined 4 years ago
cake
Cake day: July 7th, 2020

help-circle
  • IhavehadenoughtoLemmy SupportWhy Typescript?
    link
    fedilink
    arrow-up
    2
    ·
    4 years ago

    languages aren’t ‘duck typed’ duck typing is to do with protocols, duck typing can be used in a language that is even statically typed.

    javascript has weak types meaning they can be coerced to other types, the confusion arises because by defining a protocol for type coercion you can get weak types from duck typing.


  • IhavehadenoughtoLemmy SupportWhy Typescript?
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    4 years ago

    what is a strict type?

    Also there’s no reason whatsoever why a dynamically typed language cannot be strongly typed

    but you also gain intellisense and auto-complete and all that too.

    I don’t believe this has anything to do with types at all

    I can’t tell you how many times I’ve been saved by accidentally forgetting a field that was marked as required, at compile time.

    There’s no reason why an implementation of a dynamically typed language cannot check for things like this either, this is just a common misconception brought about by the way some interpreters work.