News for hackers. Stuff that matters.
Re:The Next Step for Generics by amelius on Tuesday June 16, 2020 @06:56PM (#23545341)
Ideally, you'd have a language that allowed you to do both. Generics/type safety when you want them (e.g. for stuff that is hard to maintain), and total freedom otherwise.
Re:The Next Step for Generics by pdehaan on Tuesday June 16, 2020 @08:02PM (#23545919)
Python with type annotations is the closest I've used to that, and I hate it. It beats no type annotations, but only barely.

As soon as I need to use someone else's code, all bets are off. Half the reason I want types is because it makes my life easier when I'm trying to use something written by someone else -- instead I find myself needing to experiment with a debugger to figure out what functions are actually doing.

Re:The Next Step for Generics by ummonk on Wednesday June 17, 2020 @03:34AM (#23548820)
Plenty of languages allow you to do this, either by opting into type checking only when you add type annotations, or by using "any" / "dynamic" or unchecked typecasts as an escape hatch when you don't feel like going through the trouble of how to make the typechecker happy.
Re:The Next Step for Generics by int_19h on Wednesday June 17, 2020 @02:35AM (#23548444)
C# with liberal use of "dynamic" would be pretty close to that.
Re:The Next Step for Generics by g5becks on Thursday June 18, 2020 @03:37AM (#23560711)
So basically typescript?