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

    Typescript is far nicer than Python though. Well I will give Python one point: arbitrary precision integers was absolutely the right decision. Dealing with u64s in Typescript is a right pain.

    But apart from that it’s difficult to see a single point on which Python is clearly better than Typescript:

    • Static typing. Pyright is great but it’s entirely optional and rarely used. Typescript obviously wins here.
    • Tooling. Deno is fantastic but even if we regress to Node/NPM it’s still a million miles better than the absolute dog shit pile of vomit that is Pip & venv. Sorry Python but admit your flaws. uv is a shining beacon of light here but I have little hope that the upstream Python devs will recognise that they need to immediately ditch pip in favour of officially endorsing uv. No. They’ll keep it on the sidelines until the uv devs run out of hope and money and give up.
    • Performance. Well I don’t need to say more.
    • Language sanity. They’re pretty on par here I think - both so-so. JavaScript has big warts (the whole prototype system was clearly a dumb idea) but you can easily avoid them, especially with ESLint. But Python has equally but warts that Pylint will tell you about, e.g. having to tediously specify the encoding for every file access.
    • Libraries & ecosystem. Again I would say there’s no much in it. You’d obviously be insane to use Python for anything web related (unless it’s for Django which is admittedly decent). On the other hand Python clearly dominates in AI, at least if you don’t care about actually deploying anything.
    • Eager Eagle@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      1 year ago

      I write mostly Python for 5 years and uv is indeed the best thing that happened to the Python landscape during this period.

      I disagree that typescript is far nicer; even syntax-wise, type annotated Python seems much easier to read, write, and refactor; but I’ll give that Python needs to ditch pip and “requirements.txt” for good.