Type Inference Was a Mistake
21–30 of 133 posts
Re: Type Inference Was a Mistake
#22This is not good. One of the author's arguments is that type inference in an IDE is bad because sometimes I read code in a book where I don't have type inference... I don't know about other folks, but the vast majority of code I read is in my editor, where the type inference saves me a ton of time and pain.
Re: Type Inference Was a Mistake
#23This SOUNDS like “types are bad”. The author’s message (towards the end of the article) is “I don’t want to infer types from my code. I’d rather infer the code from the types. Types are the spec…” Yes. Always annotate types. Keep inference, it tells you when your annotations are inconsistent with tour code.
> Keep inference, it tells you when your annotations are inconsistent with tour code. Isn't that plain type checking, rather than type inference? Type checking detects inconsistencies, type inference assigns types in ways that avoid inconsistencies.
Re: Type Inference Was a Mistake
#24Explicit typing is great until your code is littered with shared_ptr >>> everywhere.
Re: Type Inference Was a Mistake
#25Re: Type Inference Was a Mistake
#26I enjoyed this reference to a false dichotomy while making one itself. Languages don't make programmers leave out annotations where it aids readability.
Re: Type Inference Was a Mistake
#27Re: Type Inference Was a Mistake
#28This is not good. One of the author's arguments is that type inference in an IDE is bad because sometimes I read code in a book where I don't have type inference... I don't know about other folks, but the vast majority of code I read is in my editor, where the type inference saves me a ton of time and pain.
Re: Type Inference Was a Mistake
#29If inference is bad, maybe the second sentence shouldn't leave it up to the reader to infer what "it" means. Surely it would be much easier to read as "Type inference [...] type inference [...] type inference".
Re: Type Inference Was a Mistake
#30Explicit typing is great until your code is littered with shared_ptr >>> everywhere.