this post was submitted on 02 Apr 2024
143 points (98.6% liked)

Programming

17492 readers
116 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
 

I was talking to my manager the other day, discussing the languages we are using at $dayjob. He kind of offhandedly said that he thinks TypeScript is a temporary fad and soon everything will go back to using JavaScript. He doesn't like that it's made by Microsoft either.

I'm not a frontend developer so I don't really know, but my general impression is that everything is moving more and more towards TypeScript, not away from it. But maybe I'm wrong?

Does anyone who actually works with TypeScript have any impression about this?

you are viewing a single comment's thread
view the rest of the comments
[–] cbarrick@lemmy.world 11 points 7 months ago (3 children)

Dynamic typing is not a fad.

Python is older than Java, older than me. It is still going strong.

[–] Dark_Arc@social.packetloss.gg 8 points 7 months ago* (last edited 7 months ago) (1 children)

Python also has a statically typed option these days.

Edit: Previously said "strongly" instead of "statically"

[–] FooBarrington@lemmy.world 2 points 7 months ago (1 children)

Which one? There is static typing with the typing module, but that's not strong.

[–] Dark_Arc@social.packetloss.gg 1 points 7 months ago (1 children)

I should have said statically typed, fixed.

[–] FooBarrington@lemmy.world 2 points 7 months ago (1 children)

Ah, gotcha, thanks! I'd have loved a strongly-typed option.

The static typing system is slowly getting there, but many useful Python patterns can't be expressed yet. You can, for example, write a function that appends an item to a generic tuple - but you can't concatenate two tuples. I really hope they keep expanding on the system!

[–] sylveon@lemmy.blahaj.zone 2 points 7 months ago (1 children)

Isn’t Python already strongly typed?

[–] FooBarrington@lemmy.world 1 points 7 months ago (1 children)

No:

$ python 
Python 3.10.13 (main, Jan 28 2024, 03:02:00) [GCC 13.2.1 20230918 (Red Hat 13.2.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> def handle_foo(value: list[int]) -> bool:
...     return 42
... 
>>> print(handle_foo(False))
42
[–] sylveon@lemmy.blahaj.zone 2 points 7 months ago

I haven’t used Python since around the time when type hints first became a thing so I might be completely wrong here, but isn’t this because Python just generally ignores type hints? If you ran a static type checker like mypy over this it would complain right?

Also, if you actually did anything with the list that you couldn’t do with a bool (e.g. len(value)), it would throw an error too because Python is actually pretty strict about types, just only at runtime. That’s why it’s usually considered to be strongly typed, although people don’t seem to agree what exactly that’s supposed to mean.

[–] hascat@programming.dev 6 points 7 months ago

This just blew my mind. I had always assumed Java was older. I started writing hobby projects in Java in the 90s. I don't think I heard about Python until the early 2000s.