Remix.run Logo
atomicnumber3 4 days ago

On the contrary, I find "The older I get, the more I appreciate dynamic languages. Fuck, I said it. Fight me." is exactly my sentiment too, with a caveat. I really like gradual typing, like python has. And not like ruby has (where it's either RBS files and it's tucked away, or it's sorbet and it's weird).

YZF 4 days ago | parent | next [-]

The worst code base I had to work in by far was a Python code base. Extremely difficult to refactor. Many bugs that were completely avoidable with static typing. I think maybe more modern Python is a little bit better but wouldn't be my choice for large projects. It's not just about correctness. It's also about performance. That code was so slow and that impacted our business.

atomicnumber3 4 days ago | parent | next [-]

Meanwhile the worst codebase I've had to work in by far is golang where someone clearly took the language's limitations as a challenge and not as an intentional constraint on writing clever code. And it's an impressive feat because I too have seen horrifying clusterfucks of python codebases with no typing whatsoever and very sloppy hygiene.

My take on static vs dynamic is that a sufficiently motivated programmer can make a mess out of anything they're given, and that types actually really don't help that much. Furthermore, "the types work out!" is also not actually an incredibly comforting fact to me. There are so many more places things can be wrong. And I also find that the types of errors static typing prevents tend to not be the most meaningful errors to prevent or the hardest to catch in subsequent testing, ESPECIALLY with gradual typing!

With python in particular, gradual typing with a checker gets you 99% of the benefits of static typing, with the HUGE added benefit of you just being able to tell the type checker to stfu when it's not adding value. ORMs and data parsing are so much easier in dynamic languages, for instance. And I find the most ergonomic ORMs and data parsers in static languages tend to be the ones that have gone to extraordinary lengths to make them feel like the stuff you just get much more cheaply in dynamic languages. I have recently been writing python with basedpyright and very intentional type hinting and it has been my favorite experience in a long time. More impactful to my productivity (real productivity - actually producing things that work and are real) than AI.

estetlinus 4 days ago | parent | prev [-]

Refactoring is a young mans game. I either nuke it and start over or treat it as a black box.

whateveracct 4 days ago | parent | prev [-]

You can just as easily take a static language dynamic - in userland.

I've interop'd with JS from Haskell and you can just go full dynamic property access. And gradually add phantom typed APIs around it.

paulryanrogers 4 days ago | parent [-]

Debugging Haskell and JS in the same stack? You kids are brave. And/or I'm a coward and a simpleton.

whateveracct 4 days ago | parent [-]

I debug in ghci mostly

console.log also still works fine