3 ms·
> [SaneScript] Accessing missing properties throws (on both reads & writes) Ah, I would love this. I have a small, thoroughly tested JS app (15k+ lines of cod
by tieTYT 12y ago
> [SaneScript] Accessing missing properties throws (on both reads & writes)
Ah, I would love this. I have a small, thoroughly tested JS app (15k+ lines of code) but the biggest pain in the butt to debug is, "how did this 'undefined' get here?" I wish there was a way to fail early without putting tons of guard clauses everywhere.
- peterashford 12y agoI hear ya. One of my greatest frustrations with reading "Javascript: the good parts" is where Crockford dismisses the legions of faults with Javascript as 'things that never happen to him anyway". Well in my bloody world, these JS faults go undetected in production code, causes days lost to debugging, cause customer complaints etc... "Fail early" (and loudly!) ought to be design goals for all programming languages IMO.