TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Dynamic vs. Static Typed Languages

8 pointsby jlalfonso21over 3 years ago
What can do better static-typed languages that dynamic ones cant?

6 comments

Comeviusover 3 years ago
1. Find type-related bugs at compile time.<p>2. More readable code.<p>3. More maintainable code.<p>4. More efficient generated code.
UglyToadover 3 years ago
I&#x27;d say it&#x27;s about what static languages don&#x27;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.<p>Types help make (some) invalid states unrepresentable, though the type systems could always be better and some data can only be checked at runtime.<p>But you can focus your test effort on checking those logic conditions. In addition it makes teamwork far easier.<p>I&#x27;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.
yhavrover 3 years ago
- Painless refactoring. I change field &quot;foo.bar&quot; into &quot;foo.quux&quot; 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&#x27;s broken.<p>- Integrated documentation. I see &quot;foo&quot;, I see it&#x27;s type, I see what can I do with it (if it&#x27;s OO-like).
runawaybottleover 3 years ago
I’ll take the downvotes.<p>It can fulfill certain compulsive needs of certain personality types that like to be comprehensive (think compulsive note takers, list makers).<p>No harm done, everyone has their quirks.
girishsoover 3 years ago
Detect typos, can be a huge time saver at times.
preordainedover 3 years ago
Accretion...