Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I agree. Typescript is much nicer than Python and doesn't suffer from the problem you describe. I think you'd be mad not to use it at this point.


TypeScript, if you use its strong points, has a much slower development pace than a language such as Python. To each their own.


How so? After having used typescript, Mypy and static languages, I could never go back.


I've started with static languages and I prefer dynamic ones over static. Code is a liability and static typing can create incentives for adding more and more boilerplate that brings little value to the table.

I'm preferring dynamic languages and lots of tracing and rollback capabilities in production in 2021.


I've found this to be a common mindset among people who started out with Java/C#/C++/etc.

Modern statically-typed languages are a totally different beast. Type inference is widespread and powerful, and you end up writing very little additional boilerplate. On top of that, guarantees like the prevention of null values greatly increase the value you get from having static types.

If you haven't tried one in a few years, I recommend revisiting them. TypeScript is a great place to start.

PS: It's totally possible, but also totally unnecessary, to write TypeScript like you would Java or C# (lots of classes, nullable-everything, explicit types for everything). To get the most out of it you honestly have to do the exact opposite of that (turn on strict null checks, use plain types, leverage type inference as much as possible).


My last experience was with Go. Awesome language. I use it when I need extraordinary performance. For everything else, it's Python or vanilla JavaScript.


If only there was some project that was a go webserver with a client that was like some sort of python/javascript hybrid…


Even "old" statically typed languages like Java and C++ are streets better than dynamically typed languages like Python (without type hints).

I don't think people have that view because they haven't experienced modern static typing systems. I think they have that view because they aren't willing to admit that they make the kinds of mistakes that static types help with, and they aren't willing to admit that they benefit from the kinds of assistance that static types provide (autocomplete, go to definition, etc.).

It's annoying.


I get autocomplete and goto definition with dynamic languages just fine. And I make mistakes that static typing could have helped, but then again they are not frequent enough to justify the bureaucracy (and they don't break production).

Of course, there is no general rule. This is true for the type of projects that I've been recently working on, which are small-scale distributed web systems.

If a new project demands a rigorous type system, I would probably go to something like PureScript[0] before going to C# clones like TypeScript. It seems that the compiler would help me a lot more in a language like that.

[0]https://www.purescript.org/


> I get autocomplete and goto definition with dynamic languages just fine.

No you don't. See how autocomplete does with this function:

    def foo(s):
        s.
Now try it with type annotations:

    def foo(s: str):
        s.


Static languages are good for beginners. Like training wheels for programmers.


Does the downvote mean static languages are bad for beginners?


No it means that statically typed languages are good for everyone. They aren't "training wheels" that you'd want to remove at any point.

A lot of misguided programmers think they don't write bugs and they don't need any help from autocomplete or linting or whatever. It's not just inexperienced programmers! A lot of experienced ones mistakenly think that they don't write bugs and therefore don't need to use anything that helps them detect bugs. How very dare you suggest that I might make a typo?!

I guess it is just hubris.


Weird that you’re talking in English without injecting a bunch of literal “noun” “adjective” “adverb” in your sentences. I mean why not really commit to it, ya know? Are programming languages for the human or the computer anyways? Typescript is definitely popular right now. So is McDonalds.

Of course for many advanced things you are forced to use types. Like shader languages. But thats not because the advancement there is in the domain of programming languages.

And your boos mean nothing. I’ve seen what makes you cheer.


English is not a programming language. And anyway English does have a load of extra stuff to indicate the "types" of things. For example proper nouns are capitalised, plurals get different quantifiers, adverbs get a "ly" suffix.

I think Latin is even more of a "typed" language.

But anyway that is really irrelevant because it's not programming.

> But thats not because the advancement there is in the domain of programming languages.

Well, no because static typing is ancient.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: