• tram1@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    I’m kind of a beginner… Can someone explain why you would make/use/have a dynamically and/or weak typed language? Is it just to not write some toInteger / as u64 / try_from()? I mean the drawbacks seem to outweigh the benefits…

    • Lmaydev@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      1 year ago

      If you are writing small and simple apps it will give you more velocity and much less boiler plate.

      As apps grow it becomes harder to keep track of things and can quickly grow into a mess. You then start to need external tools to give you the features of a strong static type system.

      Also from a web point of view you don’t want the website to crash and burn with every error. JS will power through things like invalid types. Imagine if any error caused the website to just stop.

        • Nerd02@lemmy.basedcount.com
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

          There’s no real alternatives to JS “for websites” (meaning on the frontend, the part of your code that gets executed on your client’s browser). That’s what JS was invented for and what it does best.

          I say “no real alternative” because technically we also have WebAssembly, which is a tool that allows you to run code written with any language on the web, but if you indeed are a beginner approaching to web development you should just forget about this for now and stick to JS as you learn.

          Of course this doesn’t mean that you can’t use Python on your backend, your server.