Hacker News new | ask | show | jobs
by ReflectedImage 1292 days ago
Static typing on its own is very bad at finding errors.

Static typing is something you use for performance reasons primarily.

If you want to catch errors with static typing you need Haskell or Rust levels of support for it. C# / Java / C++ don't make the grade.

2 comments

I really disagree with this. I use static types as a quick correctness check. I've added types to large python projects to reduce the complexity of reasoning about the code base, and the typing does not make it run faster (actually, the opposite).
A correctness check so quick, it didn't check correctness at all.

That is not how to decrease the complexity of reasoning about a Python program.

What you should do instead is break the program up into smaller microservices.

You have no idea what you're talking about.
The issue is I know exactly what I'm talking about and you don't.

Errors that would be caught by static type checking are exceptionally rare when you do commerical development in dynamically typed languages.

You right now are complaining about a problem that only exists with inside your own head.

The issue is you think you know what you're talking about, but it's painfully obvious you don't.

> Errors that would be caught by static type checking are exceptionally rare when you do commerical development in dynamically typed languages.

Those kinds of errors are not rare at all.

I've got lots of experience in developing with both static and dynamically typed languages, I know the differences and it has very little to do with anything you are talking about.

Dynamically typed languages tend to be simpler and easier to use. This means on the whole they have less bugs than their static typed counter parts.

The real issue with dynamically typed languages is that their performance sucks. (That and according to this thread people not having a clue on how they are properly used. You can't just use the same development techniques as you use in a statically typed language. It's different.)

> I've got lots of experience in developing with both static and dynamically typed languages

And yet your comments demonstrate the opposite.

> Dynamically typed languages tend to be simpler and easier to use.

Very debatable.

> This means on the whole they have less bugs than their static typed counter parts.

Not at all.

> The real issue with dynamically typed languages is that their performance sucks

Every time you say something like this it just makes it obvious you have no idea what you're talking about. You can write almost completely typeless, highly performant, c and assembly code, while high level languages with advanced type systems are generally not the most performant.

You seen to be confused about interpreted/jit/compiled languages and static/dynamic typing - which are not the same thing.

Here's a study: https://games.greggman.com/game/dynamic-typing-static-typing...

The key points are as follows:

* Development in Dynamically Typed Languages is faster

* Dynamically typed languages use less lines of code than statically typed languages by a significant margin

* The level of bugs is the same between Dynamically typed and Statically typed code.

"You can write almost completely typeless, highly performant, c and assembly code,"

Yes, I'm sure the LOAD instructions take pictures of cats as operands via their typeless instruction sets... What in earth are you on???

"completely typeless, highly performant, c"

well once someone does that let me know. The only thing near is Javascript and that is only faster for microbenchmarks not real programs.