|
<< Click to Display Table of Contents >> Navigation: Telegram > 2018 > 03 > 25 > Telegram_2018-03-25T17 |
2018-03-25T17:17:38
LOL
2018-03-25T17:17:45
Did you \use strict\, Chad?
2018-03-25T17:18:28
oh! Type safety... not undeclared variables :)
2018-03-25T17:18:59
You need to check for types in your function... unless it's not your function, and it's someone else's.
2018-03-25T17:19:30
don't rely on use strict if you have to support older browser. That's a recipe for disaster
2018-03-25T17:20:10
Thanks for your advice, Alexandre.
2018-03-25T17:23:54
There are no directives that can detect this...
2018-03-25T17:24:53
not typeof?
2018-03-25T17:24:54
type: link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof
2018-03-25T17:25:50
I use this lint tool online (which I think is the best I've tested so far): type: link http://jshint.com
2018-03-25T17:26:04
helped and saved my ass a few times ??
2018-03-25T17:26:46
however, if you follow all its advices, you will probably break your beloved JS code. You know, JS depends on some bugs to work correctly LOL
2018-03-25T17:42:29
I have a linter too, it cannot catch it all and linters are hacks for a shitty compiler in this case.
2018-03-25T17:43:15
The linter I have is set to very agressive settnigs, and Im actually using TS as well which also enforces things best it can. .but its still on top of JS.
2018-03-25T17:43:22
type of is almost useless
2018-03-25T17:43:42
it cant distinquish between different obejcts, and doesnt help with type sfatey.
2018-03-25T17:44:15
function foo(x: string)
x = new object();
foo(x) is valid in many cases where not even a linter can catch it
2018-03-25T17:44:31
TS can catch it in most cases.. but not all becuase of JS
2018-03-25T17:46:32
VB even in its shittiest days was 1000x more type safe than JS even wtih the harshest of linters.
2018-03-25T17:58:33
:D