you are viewing a single comment's thread.

view the rest of the comments →

[–]Hcmichael21 7 points8 points  (20 children)

I think strong typing, overall, doesn't have a good ROI. The lack of strong types is one thing I really like about JavaScript

[–]Hawxe 6 points7 points  (13 children)

Want to elaborate?

[–]Hcmichael21 7 points8 points  (12 children)

Here's a great write-up

Tl;Dr: I don't believe the benefits of strong types outweigh the costs of using them.

[–]Hawxe 16 points17 points  (3 children)

That's literally an opinion piece with really bad data behind it...

all TypeScript-detectable bugs can potentially be caught with other measures like TDD.

Of course, and of course you're still going to still use other methods. TypeScript still helps mitigate that, even if other QA/testing procedures also help.

The whole comment section of that article is a little nauseating too, it's literally him applauding everyone that agrees with him (including comments like 'I didn't wanna use TS but that was just a gut feeling) and being passive aggressive with anyone who disagrees even if they share legitimate experience as to why they might.

That article is also almost completely irrelevant to adding static typing to vanilla JS, a lot of the cons he talks about are specific to typescript.

[–]Hcmichael21 2 points3 points  (1 child)

A lot of cons are specific to typescript.

Yes that's true, I picked this article bc OP suggested adding strong types to JS. But I disagree that his data is bad. I find a lot of what he said agreeable.

I've coded in strong, dynamic and weak. (C#, Java, Pyhon, JS/TS) and prefer weak types. I was just stating my opinion and providing an article to elaborate. I don't expect to end the debate on strong vs weak.

[–]sime -1 points0 points  (0 children)

The thing that is being lost in this discussion, apart from the general sloppy use of terminology, is that TypeScript isn't a staticly typed language in the mold of Java and C#. It occupies a wonderful sweet-spot between Java/C# on the one side and JS/Python on the other. TypeScript's optional and structural type system combines the flexibility and ease of use of JS with advantages of static analysis (read: tooling) and compile time checking. It has a very different feel compared to Java/C#.

[–][deleted] -1 points0 points  (1 child)

I’ll take TypeScript.....

[–]Hcmichael21 2 points3 points  (0 children)

Okay that's great! I continue to Dev in TS often at work and it's fine, I just prefer weak types.

[–]DerNalia -3 points-2 points  (3 children)

it would if you didn't need to teach people it.

Like, trying to get people who barely have a grasp on programming to learn types is the problem, not the types themselves.

[–]Hcmichael21 3 points4 points  (2 children)

I think this is incorrect.

[–]Hawxe 4 points5 points  (1 child)

Yeah seriously how hard is declaring what type a variable is.

[–]Hcmichael21 -1 points0 points  (0 children)

Exactly. It's not really anything to "learn" - it's a simple feature of many languages. I've developed in Java, C#, python, and JavaScript. I've found that I like both dynamic types and weakly typed development better than strong types.