4 ms·
I'm not against studies and research - I have a computer science degree myself - but I'm a little tired of being told my personal anecdotal evidence is not suff
by fifticon 4y ago
I'm not against studies and research - I have a computer science degree myself - but I'm a little tired of being told my personal anecdotal evidence is not sufficient to conclude that water is wet.
As a professional software developer of 30+ years, the doubts on static types puzzle me.
8 years ago, I started dabbling more in javascript, for one of my continuous pet projects. I had it running and grew it to a considerable size, but after a year or two, I lost patience with debugging runtime issues, hunting for where I had forgot to update or initialize or remove stuff, during refactoring. I swore an oath never to use raw javascript again, and rewrote it from scratch in typescript. I am still working on it to this day, and I don't remember being angry at typescript a single day in the intervening 7 years.
My working day jobs have been mostly C++, and these days C#.
Periodically, I will temporarily inherit some of my younger colleagues' projects, if they move on to greener pastures in different companies, with the charter of "can you do something about the long-running issues this software has been having?"
My go-to solution is to go through their typescript and add return types to their functions, and replace their anys with interfaces.
After having done that, I fix the bugs that revealed,
and then I'm usually done.
Recently when I did that, I came across a central class/data structure, which turned out to exist in no less than 5 slightly different variants. i.e. different parts of their code adhered to 5 different assumptions about what fields would exist and be populated (but all expressed on the blank canvas of 'any').
- bergenty 4y ago
- shepherdjerred 4y agoJavaScript is a fantastic language once you understand how it really works. If you do truly understand the language then maybe you should use something that compiles to JS.
- kraf 4y agoI think we need to be careful with trusting even our own anecdotal evidence because it's simply riddled with biases and bugs. 30+ years of experience is certainly impressive but I'd say you probably never worked in a senior team on a larger Clojure codebase for example which would give you quite the opposite impression. You should read the anecdotal evidence in that community, it's very different.
- edanm 4y ago> [...] I'm a little tired of being told my personal anecdotal evidence is not sufficient to conclude that water is wet. The problem is, other people with just as many credentials as you have the opposite experience. From an outsider's perspective, two people with equal authority say opposite things, what can they possibly do except an independent study? Also, note that there's a reason anecdotal evidence is not always reliable. E.g. the famous story about fighter pilots and the "regression to the mean" hypothesis.
- ehnto 4y agoI suppose what they can do is write some code and figure out where their specific situation lands them on the Static Typing is good/bad spectrum. In this scenario, I honestly don't think it matters whose objectively right. Software is not a clean, normalized and organized set of use cases after all, maybe static typing works for person X and doesn't for person Y because of their background, or preferences, or codebase requirements, and so on. Maybe one day we can conclusively prove that on aggregate static-typing/{insertThingHere} is overall less buggy, but even if we did, it'll still change depending on circumstances.
- resonious 4y agoI have far less experience than you and I've definitely experienced drowning in runtime issues when working with a large project in a dynamic language. On the other hand, though: have you worked with large, thoroughly tested projects in a dynamic language? Personally, I find that good tests catch 99% of the bugs that static types do, plus quite a lot of other bugs as well. Arguably, you ought to write tests anyway to find those other bugs. Since they also find your typos etc, you get to enjoy the ergonomics boost of dynamic typing almost for free. That's my (also anecdotal) argument for doubting static types.