4 ms·
Two things here: 1. You need to understand how to express concepts in a form the type system can understand. Each type system will have patterns it understands
by noelwelsh 2y ago
Two things here:
1. You need to understand how to express concepts in a form the type system can understand. Each type system will have patterns it understands, and patterns it does not.
2. Go isn't a great example. It has a Java-circa-2000 type system. Modern type systems are much more expressive.
- scott_w 2y ago> Go isn't a great example. I picked Go as an example of a language that gets a lot of praise specifically for having strict compiler rules. I've also tried Scala and found it clunky but I do suspect most of its problems came from the insane operator overloading and opaque build system rather than the type system. I understand it's gotten better since I looked 8 years ago but I've not had a reason to check it out again.
- noelwelsh 2y agoYeah, the early days of Scala were a bad time for people going crazy with symbolic method names. Thankfully, most of that is in the past. (And Scala 3 is a much cleaner language in every way.)
- never_inline 2y agoThose people haven't used Java 11+ or Python with types. Python with types is a double edged sword. If you can enforce other collaborators and SDKs use strict typing, it's a very pleasant experience to write, coupled with Pydantic for defining POJO-like structs. For CLI tools Click + Poetry build system. Java17+ type system is pretty good. Way better than Go in terms of dev experience. you may need a POJO generation tool (Lombok, Autovalue) and preferably validation libraries. I'd still write java over Go if efficiency and single binary is not a concern.
- js2 2y ago> For CLI tools Click Once you're using types, I would recommend Typer instead. Built on-top of Click but configured via type hints: https://typer.tiangolo.com/ https://typer.tiangolo.com/