Re:The Next Step for Generics
by systemvoltage on Tuesday June 16, 2020 @04:20PM
(#23543586)
> or we can learn to read them
That's an awful way to think about hard to read code. I could produce the most unreadable one liners you've ever seen in your life. We should condemn that and not blame it on others to "learn how to read".
> That's an awful way to think about hard to read code
Most of the time I hear about "hard to read code" is "pattern I don't currently have a mental model for". We didn't move on from COBOL by letting that be a deterrant.
Re:The Next Step for Generics
by systemvoltage on Tuesday June 16, 2020 @07:49PM
(#23545792)
Fair, I've actually seen both types of situations. I only complain after having some domain knowledge of the project and the language/tools. After sufficient understanding, I will make sure that the code that gets merged into master is highly readable. Simple > complicated. Always. Don't be ashamed to write simple code.
You write code for an audience. In that audience, sit yourself in your current state, yourself a year+ from now, your colleagues (you know their level) and the compiler. With bad luck, your current self i a state pulling your hair out to debug.
Think about the audience when you code.
I assume you only program in readable languages like COBOL and AppleScript.
Re:The Next Step for Generics
by michaelcampbell on Tuesday June 16, 2020 @09:39PM
(#23546731)
Ah, blub. It will never leave us.
Or we can learn to read them. Just treat types like a first class value. You either assign names to types like you do to values, or you can assign a name to a function that returns a type, this being generics.