4 ms·
I would love legislation that mandated static typing for large/public companies (or any companies that took federal funding, etc). I think dynamic typing is one
by winter_blue 4y ago
I would love legislation that mandated static typing for large/public companies (or any companies that took federal funding, etc). I think dynamic typing is one of the worst software engineering practices in common use today, and I'd like to see it go into the trash heap of history.
It's already happening with the massive adoption of Mypy/Pyre, the JS -> TS switch, etc.; but if we can use the power of government / the force of law to hurry up the extinction of dynamic typing as an industry practice, that would be a huge huge thing.
The next step after it would be requiring the nullability be an explicit part of the type (like in Kotlin, TypeScript, etc), or mandating the use of Optionals everywhere that nullability is needed in languages like Java.
The death of dynamic typing and default-nullability would probably save the industry society billions of dollars in the long run.
- jraines 4y agoCome and take i[null pointer exception]
- ftrobro 4y ago> The death of dynamic typing and default-nullability would probably save the industry society billions of dollars in the long run. I'm not sure a ban on software coded using PHP, plain Javascript, legacy Python, C/C++ or assembler would be cheap for "society"...
- continuational 4y agoI don't think it's enough. Java without null would still have Log4Shell. The current model where any piece of code can do anything it likes needs to be abandoned before we can expect any kind of security from our systems.
- ahtihn 4y agoThis is never going to happen. Do you forbid shell scripting? What about turing-complete configuration formats? How do you define static typing? Is TS `Any` allowed? Is C# `dynamic` allowed? Are you allowed to use reflection? How are you going to enforce this at scale?
- Kototama 4y agoThis would make it impossible to use languages such as Clojure, Erlang and Elixir, which have been proven to be helpful to build robust software. Do you also know that there are disadvantages to type systems? And advantages to dynamically type languages? It's not all black and white.
- kneebonian 4y ago> I would love legislation that mandated static typing for large/public companies (or any companies that took federal funding, etc) You want the government to start dictating what language developers can choose? And before you say "just static typing" the fact of the matter is that there can be different interpretations of "static typing" what if I use a library that forces static typing in a non statically typed language? What about when they extend this to other features of programming languages. I guarentee you that the Sun and MS execs would've been jizzing their paints at the thought of forcing everyone to use OOP Languages, because "They are secure and supported." Technical excellence should win out in the end not government fiat, that's one of the worst things that could happen.
- dragonwriter 4y ago> You want the government to start dictating what language developers can choose? Do you want Ada? That's how you get Ada.
- winter_blue 4y agoFor what it's worth, Ada is actually a really well-designed and well-thought-out language (for the 1980s era), from a pure programming language design perspective. Definitely better than the popular languages (C, C++, Pascal, etc) of its era.