News for hackers. Stuff that matters.
Re:Ask HN: Dynamic vs. Static Typed Languages by Comevius on Sunday September 05, 2021 @05:40PM (#28428071)
1. Find type-related bugs at compile time.

2. More readable code.

3. More maintainable code.

4. More efficient generated code.

Re:Ask HN: Dynamic vs. Static Typed Languages by UglyToad on Tuesday September 07, 2021 @01:27PM (#28447388)
I'd say it's about what static languages don't let you do that dynamic ones do. For example I just found a bug in some scheduling code I wrote where a date value could be null but I was treating it as non null. I change the type to nullable and the compiler tells me everywhere I currently use it in an invalid way.

Types help make (some) invalid states unrepresentable, though the type systems could always be better and some data can only be checked at runtime.

But you can focus your test effort on checking those logic conditions. In addition it makes teamwork far easier.

I'd compare it to the benefits of rust over plain C. Yes you can write safe code in C with a lot of discipline and being 100% focused all the time, or you can leverage tools to let you catch your mistakes and free mental cycles for the actual problem at hand.

Re:Ask HN: Dynamic vs. Static Typed Languages by yhavr on Monday September 06, 2021 @07:13AM (#28432566)
- Painless refactoring. I change field "foo.bar" into "foo.quux" and the same field changes everywhere else in the (huge) codebase. Or I change the field name in the type declaration and immediately see what's broken.

- Integrated documentation. I see "foo", I see it's type, I see what can I do with it (if it's OO-like).

Re:Ask HN: Dynamic vs. Static Typed Languages by runawaybottle on Tuesday September 07, 2021 @06:11PM (#28450553)
I’ll take the downvotes.

It can fulfill certain compulsive needs of certain personality types that like to be comprehensive (think compulsive note takers, list makers).

No harm done, everyone has their quirks.

Re:Ask HN: Dynamic vs. Static Typed Languages by girishso on Tuesday September 07, 2021 @04:04AM (#28442219)
Detect typos, can be a huge time saver at times.
Re:Ask HN: Dynamic vs. Static Typed Languages by preordained on Monday September 06, 2021 @02:19AM (#28430975)
Accretion...