• dan@upvote.au
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    5 months ago

    Use TypeScript, and nonsensical things like adding arrays to objects will be compile-time errors.

    • Schadrach@lemmy.sdf.org
      link
      fedilink
      English
      arrow-up
      0
      ·
      5 months ago

      By that logic what we really need is a modernization of Ada, where there are no compiler warnings and anything that would generate one in another language is instead a compiler error, everything is strongly typed, etc, etc.

      If you aren’t familiar with Ada, just imagine Pascal went to military school.

    • Ethan@programming.dev
      link
      fedilink
      English
      arrow-up
      0
      ·
      5 months ago

      Sure. But in a sane language doing something totally nonsensical like that is an error, and in a statically typed language it’s a compiler error. It doesn’t just silently do weird shit.

  • Mesa@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    5 months ago

    I’m in this no-experience-to-apprenticeship program and everyone in my class thinks type coercion is the greatest thing ever.