top | item 45057576 (no title) alain_gilbert | 6 months 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. discuss order hn newest harikb|6 months ago It shouldn't require a fancy forward-lookup-capable editor / language-server to show type. That is the point I am trying to makevar/declare x;25 lines latercall f(x); // ** Reader has no idea what x is ... even though compiler has **25 lines laterif (....) x = "world" // infer type as string - this is bad
harikb|6 months ago It shouldn't require a fancy forward-lookup-capable editor / language-server to show type. That is the point I am trying to makevar/declare x;25 lines latercall f(x); // ** Reader has no idea what x is ... even though compiler has **25 lines laterif (....) x = "world" // infer type as string - this is bad
harikb|6 months ago
var/declare x;
25 lines later
call f(x); // ** Reader has no idea what x is ... even though compiler has **
25 lines later
if (....)