Hacker News new | ask | show | jobs
by hn_throwaway_99 806 days ago
> 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...

That feels like a bit of a straw man because you just took the weakest example from the author's list and took that single one out of context. The full quote was:

> But there are many other contexts where I read code: a book, a blog post, a Git diff. When editing code in a limited environment, e.g. stock vim in a VM.

In other words, there are other contexts that most programmers encounter in their day-to-day that don't have the benefit of autocomplete or popups. I think the general principle of "the code should stand alone" is a fair one to point out without just scoffing "Who reads code in a book??".

1 comments

A tool lacking portability does not mean the tool is bad. It means there are opportunities to support that tool (or its concept) in other environments and media. There are tools for code review in your editor which supports type inference. Snippets in books can include annotations. The author's argument and conclusion is to throw the baby out with the bathwater.