Comment by NeutralForest
9 months ago
That's an interesting approach, I'd like to see an implementation of what you're talking about. What language are you using that has such an expressive type system?
Oh, I agree that there usually isn't a scientific method to programming. I think there could be though. Not for everything of course, some things will always be up to personal taste and interpretation but the cursor could probably be moved with some effort in analyzing existing codebases at scale, doing surveys, internal testing of different approaches in large companies. Something more akin to what you see in social sciences, even if it might be a bad word in some circles!
We probably won't agree but I legitimately enjoy hearing about how people code.
Typescript is capable of dependent typing, union types, exhaustive matching and everything needed to achieve this style of programming. It's just not strict.
The other language is rust. Though it's type system is not as expressive as typescript it is strict meaning nobody can really cheat their way out of it. In general Rust code requires less unit tests then typescript because of this.
The other language is Idris and Haskell. But these languages are rarely used.
This article can shed some insight into what I'm talking about: https://wiki.haskell.org/Why_Haskell_just_works#:~:text=The%...
Thanks, I haven't touched Typescript in a while so it might be the occasion for that. When do you feel like you have a handle on the behavior, do you have complex integration tests then?