by pawelduda · 3y ago · 0 comments
Absolute anything else would be better than it.
Static typing in Python is a complete disaster when it's used on real commerical projects. I've seen the code thank you very much.
Do you mean "the worst"? There are plenty languages that are worse, and that are still in use. It's not great, but it's also not as terrible as you're making it seem.
> Absolute anything else would be better than it.
Okay, what does that have to do with static typing? Or are you saying that Typescript is better than Javascript? If static typing can make such "the worse" language better, why can't it improve other languages as well?
> Static typing in Python is a complete disaster when it's used on real commerical projects. I've seen the code thank you very much.
You make it seem like the alternative, not having static typing, is in any way better. No, it's definitely not - having e.g. your IDE know the types of values to help you in refactoring is extremely valuable, as is having static type checkers tell you about issues before running your code.
You either have unknown type problems because you're missing test cases, or you're re-building a static type system in your test suites. There is no way around verifying your assumptions about types if you want to build stable software.
The major piece of the puzzle missing is generics support, but other type handling is already there.
In typescript, when I do a refactor, or I add a feature, I will code for hours, relying solely on the typechecker for feedback, and then I will manually test, and then write unit tests. (It helps that I use discriminated unions with exhaustiveness-checks, and avoid shortcuts like `any`, to the extent possible).
Such a workflow is impossible with how limited sorbet is in the RoR context.
I'd still choose an RoR codebase with sorbet than without it any day of the week tho.
I agree, but in that case, using a scripting language to build and maintain applications with significant LOC ... is poor engineering.
Static typing is there so you can get compile-time support for validating assumptions made throughout your source code, which is critical for developing and maintaining LARGE applications by teams of engineers of all skill-sets, over significant periods of time.
And that is very poor software engineering. You should be breaking down those large applications into smaller more maintainable micro-services.
It's bad really bad.
"compile-time support for validating assumptions"
Bad software development again. If you are checking assumptions at compile time then you are slowing down your software development iteration loop. It's the 4 hour compile time problem from C++ revisited.
"over significant periods of time"
Bad, really bad software development again. As business requirements change over the life-time of a software project, you need to retire and replace old code with new code that better meets the changing business needs.
Static typing is useful for performance reasons but that doesn't apply in a scripting language. In pretty much every other context it's terrible.
>You should be breaking down those large applications into smaller more maintainable micro-services.
This take ... I'm not even sure where to start: 1. Everything I said applies equally to microservices as it does to monoliths. 2. You must have never worked with microservices if you think they are a panacea. 3. What is the difference between the same amount of code but split between one monolith versus many microservices?
>It's the 4 hour compile time problem from C++ revisited.
Do you know what's even more expensive? Tracking down TypeErrors at Runtime.
> As business requirements change over the life-time of a software project, you need to retire and replace old code with new code that better meets the changing business needs.
Yes .. keep rewriting working code - that's a path to success.