And to that end:

If you're using JSHint with all of the quality options turned on, then
great. You're writing strict mode code and you won't have strange errors
and you'll get all of the speed benefits.

But not everyone is using JSHint or the like, so strict mode is one more
avenue to help prevent errors before they happen (and force some
optimizations).

AJ ONeal

On Wed, Mar 13, 2013 at 3:01 PM, AJ ONeal <[email protected]> wrote:

> On Wed, Mar 13, 2013 at 2:26 PM, Joshua Holbrook 
> <[email protected]>wrote:
>
>> > Why would you ever allow indeterminate, unsafe, or code that causes
>> your vm
>> > to implement runtime hacks to work around it to run at all?
>> > Just because the code would run without throwing an exception doesn't
>> mean
>> > that it worked.
>>
>> Yeah but I've been using that (hypothetical) code for ages and never
>> had a problem with it. Plus, the unit tests pass. Solid empirical data
>> is more than enough for me.
>>
>> > In my mind "working" code is code that runs the same way every time
>> without
>> > ambiguity of execution or intent.
>>
>> AFAIK 'non-strict' code can and does run the same way every time
>> without ambiguity of execution or intent. Especially when it's been
>> used in production and has a reasonable test suite. I find these
>> things more compelling than knowing that the code only used some
>> "safe" subset of the language.
>
>
> if (thisthing) {
>   function doStuff() {
>     console.log('never');
>   }
> } else {
>   function doStuff() {
>     console.log('always');
>   }
> }
>
> If you have good unit tests, you'd find out that that code doesn't run
> properly. Otherwise, you might not.
>
> I'm going to go back to the newbie argument.
>
> Most people using JavaScript aren't intimately familiar with all of the
> bugs and workarounds. Why make it harder if it's easy to make it easier?
> (from my experience it's also true that most people also aren't great at
> writing great unit tests)
>
> ES5 was created for a variety of reasons. One of them was to make
> JavaScript easier!
>
> AJ ONeal
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to