Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion should issue a warning when "strict mode"; is missing
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Marcel Laverdet  
View profile  
 More options Jan 22 2012, 3:46 am
From: Marcel Laverdet <mar...@laverdet.com>
Date: Sun, 22 Jan 2012 02:46:21 -0600
Local: Sun, Jan 22 2012 3:46 am
Subject: Re: [nodejs] should issue a warning when "strict mode"; is missing

@mark

> +1 to adding "use strict" to the module wrapper, so that all server side

code is implicitly strict, whether it says so or not. Having uses of octal
be a bit more awkward is a small price to pay for the increase in sanity.

Bit surprised to hear this from you! It seems dangerous to introduce this..
Without "use strict" it's impossible to tell the toxic waste from
otherwise, among other hazards.

@isaac

> Marcel, you know full well that responsible semicolon minimalists would

balk at the very notion of starting a line with ( and not prefixing it with
a semicolon.

> This "always" "never" business is a strawman duel.  No one who knows what

they're talking about endorses either.

Dude I wasn't trying to turn this into a duel. I'm saying that neither
solution is ideal because of the way the language is designed. Instead of 1
great way to do things we have 2 mediocre ways to do things. Semicolonites
and minimalists alike have to adhere to extra-grammatical rules in order to
write properly functioning applications.

@ryan

> I always use semicolons where they belong, or at least, that is my

intention. In what way is this not safe?

For the most part you should be fine. The only thing I could realistically
imagine biting you is the example above.
function foo() {
  return
    'foo';

}

foo() returns undefined!
On Fri, Jan 20, 2012 at 2:20 PM, Mark Miller <erig...@gmail.com> wrote:
> Hi Isaac, because of this octal impediment, we've decided to support 0o666
> octal literals, and 0b10101 binary literals while we're at it, to ES6.
> However, in the meantime, I think this is a truly terrible reason to burden
> the community with the continued presence of non-strict server-side code.
> Think of non-strict code as toxic waste -- we can't deny its inevitable
> continued existence, but let's please keep it out of places where people
> are still living (active code being actively maintained). It isn't even
> lexically scoped. Going forward, its only remaining purpose should be to
> keep old websites working even when their sources are no longer being
> actively maintained, i.e., most of the web, but essentially none of NodeJS
> or other server-side code.

> +1 to adding "use strict" to the module wrapper, so that all server side
> code is implicitly strict, whether it says so or not. Having uses of octal
> be a bit more awkward is a small price to pay for the increase in sanity.

> On Fri, Jan 20, 2012 at 11:27 AM, Isaac Schlueter <i...@izs.me> wrote:

>> A while ago (0.5, I think?) I looked into adding a NODE_USE_STRICT
>> environment var that the module system could respond to, by putting
>> "use strict"; in the module wrapper.

>> It didn't seem to affect any of our benchmarks.  So, to claim speed
>> changes, we'll have to see proof.

>> Attributing 99% of non-strict JS use to laziness is a bit
>> presumptuous.  I don't use strict in my own code primarily because I
>> prefer my C-style languages to support octal literals.

>> On Fri, Jan 20, 2012 at 11:11, AJ ONeal <coola...@gmail.com> wrote:
>> > There seem to be few primary reasons that people aren't using strict
>> mode:

>> > 99% Laziness (the inefficient kind)
>> > 0.9% FUD - They're new to JavaScript or otherwise don't know about /
>> > understand it
>> > 0.09% They forget to type it out
>> > 0.009% They wan't to pretend to be cool using `with`
>> > 0.0001% They have a deep hatred for other living creatures and
>> purposefully
>> > and knowingly use `this` to access the global object

>> > Since node is all about speed and "use strict"; mode allows for
>> significant
>> > performance enhancements, why doesn't it warn you when you forget or are
>> > lazy?

>> > I'm watching one of the Crockford videos right now as and just aching
>> inside
>> > as I think of how many rookie mistakes make it in to npm that wouldn't
>> have
>> > a chance with a simple "use strict";

>> > 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 nodejs@googlegroups.com
>> > To unsubscribe from this group, send email to
>> > nodejs+unsubscribe@googlegroups.com
>> > For more options, visit this group at
>> > http://groups.google.com/group/nodejs?hl=en?hl=en

>> --
>> 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 nodejs@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscribe@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en

> --
> Text by me above is hereby placed in the public domain

>   Cheers,
>   --MarkM

> --
> 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 nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.