Hacker News new | ask | show | jobs
by alain_gilbert 290 days ago
For case like this, I'd say your text editor should definitely just be able to tell you right away that this variable is a "string" when you mouse over it.
1 comments

It shouldn't require a fancy forward-lookup-capable editor / language-server to show type. That is the point I am trying to make

var/declare x;

25 lines later

call f(x); // ** Reader has no idea what x is ... even though compiler has **

25 lines later

if (....)

     x = "world" // infer type as string - this is bad