Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #16703 > unrolled thread

Programming style question

Started byPatricia Shanahan <pats@acm.org>
First post2012-10-18 08:32 +0100
Last post2012-10-21 17:57 -0700
Articles 20 on this page of 113 — 20 participants

Back to article view | Back to comp.lang.javascript


Contents

  Programming style question Patricia Shanahan <pats@acm.org> - 2012-10-18 08:32 +0100
    Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-18 10:23 +0200
      Re: Programming style question Patricia Shanahan <pats@acm.org> - 2012-10-18 13:42 +0100
        Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-18 17:59 +0200
          Re: Programming style question Gene Wirchenko <genew@ocis.net> - 2012-10-18 09:56 -0700
            Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-19 00:49 +0200
              Re: Programming style question Gene Wirchenko <genew@ocis.net> - 2012-10-19 11:04 -0700
                Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-20 11:52 +0200
              Re: Programming style question Patricia Shanahan <pats@acm.org> - 2012-10-19 12:06 -0700
                Re: Programming style question Tim Streater <timstreater@greenbee.net> - 2012-10-19 23:12 +0100
                  Re: Programming style question "Mel Smith" <med_cutout_syntel@aol.com> - 2012-10-19 21:56 -0600
                Re: Programming style question Bart Van der Donck <bart@nijlen.com> - 2012-10-20 02:21 -0700
                  Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-20 12:03 +0200
                  Re: Programming style question Patricia Shanahan <pats@acm.org> - 2012-10-20 06:31 -0700
                    Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-20 18:30 +0200
                      Re: Programming style question Patricia Shanahan <pats@acm.org> - 2012-10-20 10:32 -0700
                        Re: Programming style question Tim Streater <timstreater@greenbee.net> - 2012-10-20 22:34 +0100
                          Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-21 10:12 +0200
                            Re: Programming style question Tim Streater <timstreater@greenbee.net> - 2012-10-21 09:34 +0100
                          Re: Programming style question Dr J R Stockton <reply1242@merlyn.demon.co.uk.invalid> - 2012-10-21 17:59 +0100
                            Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-22 09:55 +0200
                            Re: Programming style question Tim Streater <timstreater@greenbee.net> - 2012-10-22 09:50 +0100
                              Re: Programming style question Patricia Shanahan <pats@acm.org> - 2012-10-22 04:49 -0700
                                Re: Programming style question Tim Streater <timstreater@greenbee.net> - 2012-10-22 14:04 +0100
                                Re: Programming style question Hans-Georg Michna <hans-georgNoEmailPlease@michna.com> - 2012-10-22 16:07 +0200
                                Re: Programming style question Dr J R Stockton <reply1243@merlyn.demon.co.uk.invalid> - 2012-10-23 18:22 +0100
                              Re: Programming style question Hans-Georg Michna <hans-georgNoEmailPlease@michna.com> - 2012-10-22 16:01 +0200
                                Re: Programming style question Jim T. <x@y.z> - 2012-10-22 12:16 -0400
                                  Re: Programming style question Patricia Shanahan <pats@acm.org> - 2012-10-22 11:40 -0700
                                    Re: Programming style question Gene Wirchenko <genew@ocis.net> - 2012-10-22 14:01 -0700
                                      Re: Programming style question Hans-Georg Michna <hans-georgNoEmailPlease@michna.com> - 2012-10-23 10:07 +0200
                                        Re: Programming style question Gene Wirchenko <genew@ocis.net> - 2012-10-23 09:43 -0700
                                      Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-23 11:49 +0200
                                        Re: Programming style question Jim T. <x@y.z> - 2012-10-23 15:52 -0400
                                          Re: Programming style question Patricia Shanahan <pats@acm.org> - 2012-10-23 13:07 -0700
                                          Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-23 22:45 +0200
                                            Re: Programming style question Gene Wirchenko <genew@ocis.net> - 2012-10-23 14:14 -0700
                                              Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-24 09:35 +0200
                                                Re: Programming style question Gene Wirchenko <genew@ocis.net> - 2012-10-24 10:17 -0700
                                                  Re: Programming style question Dr J R Stockton <reply1243@merlyn.demon.co.uk.invalid> - 2012-10-25 18:41 +0100
                                                    Re: Programming style question Patricia Shanahan <pats@acm.org> - 2012-10-25 17:03 -0700
                                                      Re: Programming style question Gene Wirchenko <genew@ocis.net> - 2012-10-25 20:14 -0700
                                                        Re: Programming style question Patricia Shanahan <pats@acm.org> - 2012-10-25 20:46 -0700
                                                          Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-26 09:55 +0200
                                                            Re: Programming style question Patricia Shanahan <pats@acm.org> - 2012-10-26 06:18 -0700
                                                              Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-26 17:43 +0200
                                                          Re: Programming style question Gene Wirchenko <genew@ocis.net> - 2012-10-26 09:57 -0700
                                                            Re: Programming style question Patricia Shanahan <pats@acm.org> - 2012-10-26 10:24 -0700
                                                              Re: Programming style question Gene Wirchenko <genew@ocis.net> - 2012-10-26 14:18 -0700
                                                          Re: Programming style question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-27 10:45 +0200
                                                            Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-27 12:58 +0200
                                                              Re: Programming style question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-27 16:18 +0200
                                                                Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-27 18:08 +0200
                                                                  Re: Programming style question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-27 18:26 +0200
                                                                    Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-27 19:43 +0200
                                                                      Re: Programming style question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-27 21:09 +0200
                                                                        Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-27 22:53 +0200
                                                                Re: Programming style question John G Harris <john@nospam.demon.co.uk> - 2012-10-28 11:37 +0000
                                                                  Re: Programming style question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-28 12:50 +0100
                                                                    Re: Programming style question Martin Leese <please@see.Web.for.e-mail.INVALID> - 2012-10-28 13:43 -0600
                                                                      Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-28 23:58 +0100
                                                                    Re: Programming style question John G Harris <john@nospam.demon.co.uk> - 2012-10-29 11:18 +0000
                                                        Re: Programming style question Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2012-10-27 23:58 +0200
                                                          Re: Programming style question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-28 12:43 +0100
                                                        Re: Programming style question Dr J R Stockton <reply1243@merlyn.demon.co.uk.invalid> - 2012-10-27 19:44 +0100
                                                Re: Programming style question Patricia Shanahan <pats@acm.org> - 2012-10-24 12:06 -0700
                                                  Re: Programming style question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-24 21:27 +0200
                                                  Re: Programming style question Gene Wirchenko <genew@ocis.net> - 2012-10-24 15:12 -0700
                                                  Re: Programming style question Tim Streater <timstreater@greenbee.net> - 2012-10-25 01:29 +0100
                                                Re: Programming style question Stefan Weiss <krewecherl@gmail.com> - 2012-10-24 21:25 +0200
                                                  Re: Programming style question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-24 21:57 +0200
                                                    Re: Programming style question Stefan Weiss <krewecherl@gmail.com> - 2012-10-25 01:11 +0200
                                                      Re: Programming style question Christoph Becker <cmbecker69@gmx.de> - 2012-10-25 02:00 +0200
                                                        Re: Programming style question Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-24 20:27 -0700
                                                      Re: Programming style question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-25 08:44 +0200
                                                        Re: Programming style question Adam Silver <adambsilver@gmail.com> - 2012-10-25 04:28 -0700
                                                      Re: Programming style question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-25 23:18 +0200
                                                        Re: Programming style question Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-26 08:24 -0700
                                                        Re: Programming style question Stefan Weiss <krewecherl@gmail.com> - 2012-11-07 22:13 +0100
                                                          Re: Programming style question Tim Streater <timstreater@greenbee.net> - 2012-11-07 21:51 +0000
                                                          Re: Programming style question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-11-07 23:47 +0100
                                                            Re: Programming style question Stefan Weiss <krewecherl@gmail.com> - 2012-11-08 01:14 +0100
                                                          Re: Programming style question Gene Wirchenko <genew@ocis.net> - 2012-11-07 16:51 -0800
                                                            Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-11-08 16:45 +0100
                                                              Re: Programming style question Scott Sauyet <scott.sauyet@gmail.com> - 2012-11-08 08:02 -0800
                                                                Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-11-08 17:39 +0100
                                                              Re: Programming style question Gene Wirchenko <genew@ocis.net> - 2012-11-08 11:25 -0800
                                                                Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-11-08 22:25 +0100
                                                                  Re: Programming style question John G Harris <john@nospam.demon.co.uk> - 2012-11-09 10:19 +0000
                                                                    Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-11-09 17:41 +0100
                                                                    Re: Programming style question Dr J R Stockton <reply1245@merlyn.demon.co.uk.invalid> - 2012-11-10 22:38 +0000
                                  Re: Programming style question Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-22 12:32 -0700
                                  Re: Programming style question Hans-Georg Michna <hans-georgNoEmailPlease@michna.com> - 2012-10-23 10:05 +0200
                              Re: Programming style question Christoph Becker <cmbecker69@gmx.de> - 2012-10-22 22:11 +0200
                                Re: Programming style question Stefan Weiss <krewecherl@gmail.com> - 2012-10-23 02:42 +0200
                                  Re: Programming style question Hans-Georg Michna <hans-georgNoEmailPlease@michna.com> - 2012-10-23 10:08 +0200
                Re: Programming style question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-20 18:34 +0200
    Re: Programming style question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-18 11:57 +0200
      Re: Programming style question Patricia Shanahan <pats@acm.org> - 2012-10-18 13:06 +0100
        Re: Programming style question "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2012-10-18 15:32 +0300
          Re: Programming style question Patricia Shanahan <pats@acm.org> - 2012-10-18 13:37 +0100
            Re: Programming style question "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2012-10-18 15:55 +0300
            Re: Programming style question John G Harris <john@nospam.demon.co.uk> - 2012-10-19 10:12 +0100
              Re: Programming style question Patricia Shanahan <pats@acm.org> - 2012-10-19 07:24 -0700
                Re: Programming style question John G Harris <john@nospam.demon.co.uk> - 2012-10-20 17:47 +0100
            Re: Programming style question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-24 01:15 +0100
              Re: Programming style question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-24 01:31 +0100
              Re: Programming style question "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2012-10-24 07:34 +0300
                Re: Programming style question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-24 19:57 +0200
                  Re: Programming style question "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2012-10-24 21:02 +0300
          Re: Programming style question Patricia Shanahan <pats@acm.org> - 2012-10-18 20:15 -0700
        Re: Programming style question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-24 01:21 +0100
    Re: Programming style question Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-21 17:57 -0700

Page 5 of 6 — ← Prev page 1 2 3 4 [5] 6  Next page →


#17071

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-11-07 23:47 +0100
Message-ID<2729874.cOLIL9gChU@PointedEars.de>
In reply to#17065
Stefan Weiss wrote:

> On 2012-10-25 23:18, Thomas 'PointedEars' Lahn wrote:
>> What kind of sorry luser are you [...]
> 
> If you have to resort to name-calling, this is EOD for me.

Hear, hear!

> Most of what I would have replied has already been covered by Scott.
> 
> Food for thought:
> 
> For a comp.lang group focussing on one of the fastest growing languages,
> there are unusually few people here who will volunteer actual code
> examples when answering questions. IMO, one of the main reasons for that
> is the high probability of getting one of your long-winded, pedantic
> replies. […]

Rest assured *you* won't get *any* replies from me anymore for a longer time 
to come.  May you die in ignorance.

*plonk*


F'up2 poster

PointedEars
-- 
var bugRiddenCrashPronePieceOfJunk = (
    navigator.userAgent.indexOf('MSIE 5') != -1
    && navigator.userAgent.indexOf('Mac') != -1
)  // Plone, register_function.js:16

[toc] | [prev] | [next] | [standalone]


#17075

FromStefan Weiss <krewecherl@gmail.com>
Date2012-11-08 01:14 +0100
Message-ID<k7eti1$av$1@news.albasani.net>
In reply to#17071
On 2012-11-07 23:47, Thomas 'PointedEars' Lahn wrote:
> Rest assured *you* won't get *any* replies from me anymore for a longer time 
> to come.  May you die in ignorance.
> 
> *plonk*

Hallelujah!

Even if you won't read this after killfiling me: Thank you. This will
make participating in this group much more enjoyable for me.

- stefan

[toc] | [prev] | [next] | [standalone]


#17076

FromGene Wirchenko <genew@ocis.net>
Date2012-11-07 16:51 -0800
Message-ID<hb0m98l5ru2fee11hoqakj05trv73g9pau@4ax.com>
In reply to#17065
On Wed, 07 Nov 2012 22:13:29 +0100, Stefan Weiss
<krewecherl@gmail.com> wrote:

[snip]

>refute your claims. I don't know about the other regulars, but the
>prospect of getting into another pointless sparring match with you has
>often led me to discard a reply instead of posting it. I just don't have
>the time for this.

     I killfiled Mr. Lahn long ago.  When I stated what I had done,
some said that I was missing out.  I really do not think so.

     It is too easy to get into a nasty argument with well-meaning
people without inviting those with chips on their shoulders to play,
too.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#17083

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2012-11-08 16:45 +0100
Message-ID<XnsA105AA6457E29eejj99@194.109.133.133>
In reply to#17076
Gene Wirchenko wrote on 08 nov 2012 in comp.lang.javascript:

>      I killfiled Mr. Lahn long ago.  When I stated what I had done,
> some said that I was missing out.  I really do not think so.

Thinking like this can only be a personally valid argument, 
but not a valid point in a discussion like this,
since how could you know, if you plonked him long ago.
 
>      It is too easy to get into a nasty argument with well-meaning
> people without inviting those with chips on their shoulders to play,
> too.

This NG is about Javascript, not about being treated nicely.

Usenet does not work on invitation, everybody is welcome.

Perhaps there is a difference between "us" and the transponders in the felt 
importance of niceties?

I for one couldn't care less if a good tip on, or explanation of, 
programming came from a kind person or any other percepted kind. 
[Independent of what I my perception is about the person at hand.]

PS: "Argument" for me is a statement or fact [to be] introduced in a 
discussion, a "nasty argument" where supposedly "argument" is used in the 
sense of "discussion", I cannot find that sense in 
<http://www.oed.com/view/Entry/10663>. Is it local slang?

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#17084

FromScott Sauyet <scott.sauyet@gmail.com>
Date2012-11-08 08:02 -0800
Message-ID<35a3e14f-43ce-40da-ac79-601fa39831da@r5g2000yqo.googlegroups.com>
In reply to#17083
Evertjan wrote:
> PS: "Argument" for me is a statement or fact [to be] introduced in a
> discussion, a "nasty argument" where supposedly "argument" is used in the
> sense of "discussion", I cannot find that sense in
> <http://www.oed.com/view/Entry/10663>. Is it local slang?

No, it's very common usage.  I'm not an OED subscriber, so I can't see
that link, but this link:

    <https://www.google.com/?q=define:argument>

gives as its first definition:

|  An exchange of diverging or opposite views, typically a heated or
|  angry one: "I've had an argument with my father".

The second definition from here:

    <http://en.wiktionary.org/wiki/argument>

is

|  A verbal dispute; a quarrel.

And the first definition from here:

    <http://dictionary.reference.com/browse/argument>

reads

|  an oral disagreement; verbal opposition; contention;
|  altercation: `a violent argument`.

  -- Scott

[toc] | [prev] | [next] | [standalone]


#17085

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2012-11-08 17:39 +0100
Message-ID<XnsA105B398188EFeejj99@194.109.133.133>
In reply to#17084
Scott Sauyet wrote on 08 nov 2012 in comp.lang.javascript:

> Evertjan wrote:
>> PS: "Argument" for me is a statement or fact [to be] introduced in a
>> discussion, a "nasty argument" where supposedly "argument" is used in
>> the sense of "discussion", I cannot find that sense in
>> <http://www.oed.com/view/Entry/10663>. Is it local slang?
> 
> No, it's very common usage.  I'm not an OED subscriber, so I can't see
> that link, but this link:
> 
>     <https://www.google.com/?q=define:argument>
> 
> gives as its first definition:
> 
>|  An exchange of diverging or opposite views, typically a heated or
>|  angry one: "I've had an argument with my father".
> 
> The second definition from here:
> 
>     <http://en.wiktionary.org/wiki/argument>
> 
> is
> 
>|  A verbal dispute; a quarrel.
> 
> And the first definition from here:
> 
>     <http://dictionary.reference.com/browse/argument>
> 
> reads
> 
>|  an oral disagreement; verbal opposition; contention;
>|  altercation: `a violent argument`.

Argumentative, my dear Scott.

Perhaps it is American English, but even so, 
OED usually states those aberrations.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#17086

FromGene Wirchenko <genew@ocis.net>
Date2012-11-08 11:25 -0800
Message-ID<9i1o989se4it6nergt758mn9qq96enaifl@4ax.com>
In reply to#17083
On Thu, 08 Nov 2012 16:45:00 +0100, "Evertjan."
<exxjxw.hannivoort@inter.nl.net> wrote:

>Gene Wirchenko wrote on 08 nov 2012 in comp.lang.javascript:
>
>>      I killfiled Mr. Lahn long ago.  When I stated what I had done,
>> some said that I was missing out.  I really do not think so.
>
>Thinking like this can only be a personally valid argument, 
>but not a valid point in a discussion like this,
>since how could you know, if you plonked him long ago.

     Other people have been posting about the same issue.  Also, my
killfiling does not do anything to replies to his post, and replies
frequently quote.

>>      It is too easy to get into a nasty argument with well-meaning
>> people without inviting those with chips on their shoulders to play,
>> too.
>
>This NG is about Javascript, not about being treated nicely.

     That does not make being treated nicely unnecessary.

>Usenet does not work on invitation, everybody is welcome.

     Really?  What about spammers?

>Perhaps there is a difference between "us" and the transponders in the felt 
>importance of niceties?
>
>I for one couldn't care less if a good tip on, or explanation of, 
>programming came from a kind person or any other percepted kind. 
>[Independent of what I my perception is about the person at hand.]

     The reason that I am concerned with the manner of the
communication is that it is indicative of how useful the advice will
be.

>PS: "Argument" for me is a statement or fact [to be] introduced in a 
>discussion, a "nasty argument" where supposedly "argument" is used in the 
>sense of "discussion", I cannot find that sense in 
><http://www.oed.com/view/Entry/10663>. Is it local slang?

     No, it is perfectly ordinary English.  We could have a polite
argument over some subject, or we could be rude to each other as we
argue.  The latter would be a nasty argument.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#17092

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2012-11-08 22:25 +0100
Message-ID<XnsA105E4116C9E1eejj99@194.109.133.133>
In reply to#17086
Gene Wirchenko wrote on 08 nov 2012 in comp.lang.javascript:

> On Thu, 08 Nov 2012 16:45:00 +0100, "Evertjan."
> <exxjxw.hannivoort@inter.nl.net> wrote:
> 
>>Gene Wirchenko wrote on 08 nov 2012 in comp.lang.javascript:
>>
[..]
> 
>>>      It is too easy to get into a nasty argument with well-meaning
>>> people without inviting those with chips on their shoulders to play,
>>> too.

>>This NG is about Javascript, not about being treated nicely.
> 
>      That does not make being treated nicely unnecessary.

You may like it to be treated nicely, but necessity is something else.

>>Usenet does not work on invitation, everybody is welcome.
> 
>      Really?  What about spammers?

They cannot be excluded, that is the nature of usenet, 
perhaps "welcome" is not the word I should have used.

I nearly never see spam on this NG by excluding postings from 
groups.google.com [formerly dejavue.com] and using a list of exclusion 
words made years ago. There must be quite al lot, as seen by the number of 
postings that do not come into view. So for me they are not exactly 
unwelcome.
 
>>Perhaps there is a difference between "us" and the transponders in the
>>felt importance of niceties?
>>
>>I for one couldn't care less if a good tip on, or explanation of, 
>>programming came from a kind person or any other percepted kind. 
>>[Independent of what I my perception is about the person at hand.]
> 
>      The reason that I am concerned with the manner of the
> communication is that it is indicative of how useful the advice will
> be.

I would measure it's usefulness by it's direct content.

Why should:

"Better not use eval(), you son of a bitch"

be less useful then:

"Better not use eval(), my dearest friend" ?

It could be that you become so angry that you do not read tghe advice.

On the other hand it could be that you gt so angry, that you will never 
forget the advice.

Or it could be that you get so frustrated that you will use eval() in 
every line just to punish the stipulated wrongdoer. 


>>PS: "Argument" for me is a statement or fact [to be] introduced in a 
>>discussion, a "nasty argument" where supposedly "argument" is used in
>>the sense of "discussion", I cannot find that sense in 
>><http://www.oed.com/view/Entry/10663>. Is it local slang?
> 
>      No, it is perfectly ordinary English.  We could have a polite
> argument over some subject, or we could be rude to each other as we
> argue.

Quite ordinary, I heard it more than once,
however "having an argument"[1] [in OED only as 5th: debate] 
[argument = discussion, debate, subject of discussion]
contrasts with
"the arguments brought into the discussion by the parties" [2] 
[argument = proof, evidence, point of view, conceded fact, statements or 
reasons intended to establish a position]

In a discussion forum, I would prefer the second option.

>   The latter would be a nasty argument.

Some one could say something nasty [a subjective interpretation btw],
but how could the argument[1] [= discussion] be/turn nasty is the felt 
nastyness is only onesided? 

A nasty argument[2] [=statement, view] seems not to be what you mean.

==================

btw, OED has a "draft addition 1997":
"Math. and Computing: An independent variable of a function"

Leading to the javascript function collection "arguments[n]" 

function calcAverage() { 
   var sum = 0; 
   for(var i=0; i<arguments.length; i++) 
      sum = sum + arguments[i]; 
   var average = sum/arguments.length; 
   return average;
};

document.write("Average = " + calcAverage(400, 600, 83));

<http://www.devguru.com/technologies/ecmascript/quickref/arguments.html>

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#17095

FromJohn G Harris <john@nospam.demon.co.uk>
Date2012-11-09 10:19 +0000
Message-ID<O4nBTuB0iNnQFwRx@J.A830F0FF37FB96852AD08924D9443D28E23ED5CD>
In reply to#17092
On Thu, 8 Nov 2012 at 22:25:11, in comp.lang.javascript, Evertjan.
wrote:

  <snip>
>Why should:
>
>"Better not use eval(), you son of a bitch"
>
>be less useful then:
>
>"Better not use eval(), my dearest friend" ?
  <snip>

Both are bad. The right way would be
  "Better not use eval() because ... "

  John
-- 
John Harris

[toc] | [prev] | [next] | [standalone]


#17099

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2012-11-09 17:41 +0100
Message-ID<XnsA106B3ED1FDE9eejj99@194.109.133.133>
In reply to#17095
John G Harris wrote on 09 nov 2012 in comp.lang.javascript:

> On Thu, 8 Nov 2012 at 22:25:11, in comp.lang.javascript, Evertjan.
> wrote:
> 
>   <snip>
>>Why should:
>>
>>"Better not use eval(), you son of a bitch"
>>
>>be less useful then:
>>
>>"Better not use eval(), my dearest friend" ?
>   <snip>
> 
> Both are bad.

This is not a Q of absolute good or bad, 
but one of relative usefulness.

>  The right way would be
>   "Better not use eval() because ... "

Not so, as it wouldn't show my argument[2].

btw, "The right way" should be prohibited on this NG,
but more so such "prohibitions" should be prohibited.


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#17154

FromDr J R Stockton <reply1245@merlyn.demon.co.uk.invalid>
Date2012-11-10 22:38 +0000
Message-ID<GfcXM9McdtnQFwzg@invalid.uk.co.demon.merlyn.invalid>
In reply to#17095
In comp.lang.javascript message <O4nBTuB0iNnQFwRx@J.A830F0FF37FB96852AD0
8924D9443D28E23ED5CD>, Fri, 9 Nov 2012 10:19:32, John G Harris
<john@nospam.demon.co.uk> posted:

>On Thu, 8 Nov 2012 at 22:25:11, in comp.lang.javascript, Evertjan.
>wrote:
>
>  <snip>
>>Why should:
>>
>>"Better not use eval(), you son of a bitch"
>>
>>be less useful then:
>>
>>"Better not use eval(), my dearest friend" ?
>  <snip>
>
>Both are bad. The right way would be
>  "Better not use eval() because ... "

No; eval() should always be used when it is necessary to do so -- unless
another function with much the same main effect is found, in which case
it should be in the FAQ.

One must not fall into the trap of writing advice suitable only for
simple-minded programmers of "commercial" pages, and the like.

-- 
 (c) John Stockton, nr London, UK.  Mail via homepage.  Turnpike v6.05  MIME.
  Web  <http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms and links;
  Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.

[toc] | [prev] | [next] | [standalone]


#16802

FromScott Sauyet <scott.sauyet@gmail.com>
Date2012-10-22 12:32 -0700
Message-ID<bce723cf-8020-464b-9872-8e4e6fa1916e@4g2000yql.googlegroups.com>
In reply to#16800
Jim T. wrote:
[RE:  `console.info( (n || "No") + " results" );`  ]

>> This particular case is useful also because it teaches you what
>> the || operator actually does. It looks like an OR operator and
>> often acts like one, but it really does something else.
>
> I have to admit, I've always just assumed || expressions always
> evaluated to a  boolean. Maybe it's time I actually read the specs...

While reading the specs is worthwhile, they are not an easy read, and
there are other fairly decent sources of information at this level.
For this case, the MDN page [1] is pretty good, and it gives examples
such as

    "Cat" || "Dog" // ==> "Cat"
    false || "Cat" // ==> "Cat"

  -- Scott

[1] https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/Logical_Operators

[toc] | [prev] | [next] | [standalone]


#16811

FromHans-Georg Michna <hans-georgNoEmailPlease@michna.com>
Date2012-10-23 10:05 +0200
Message-ID<8pjc88hovvm402qvtgmorb9akmkho3eme1@4ax.com>
In reply to#16800
On Mon, 22 Oct 2012 12:16:42 -0400, Jim T. wrote:

>I have to admit, I've always just assumed || expressions always
>evaluated to a  boolean. Maybe it's time I actually read the specs...

Not at all. Not in JavaScript.

Its result is the first operand if that is truthy (results in
true when converted to Boolean), otherwise it is the second
operand. Examples:

"Hello" || "world" // Result: "Hello"

"" || "world" // Result: "world"

3 || 7 // Result: 3

0 || 7 // Result: 7

etc.

Hans-Georg

[toc] | [prev] | [next] | [standalone]


#16804

FromChristoph Becker <cmbecker69@gmx.de>
Date2012-10-22 22:11 +0200
Message-ID<k6497q$bib$1@speranza.aioe.org>
In reply to#16788
Tim Streater wrote:
> In article <cP4vbFDDoChQFwQo@invalid.uk.co.demon.merlyn.invalid>,
> Dr J R Stockton <reply1242@merlyn.demon.co.uk.invalid> wrote:
>
>>  console.info( (n||"No") + " results" ) ; // ??
> 
> I find constructs such as this to be unreadable. I never use them since
> I don't want to spend 20 mins figuring it out the first time, and
> another 20 mins convincing myself it's correct each time I come across it.

If I'm not mistaken the following expression evaluates to true for all a,b:

(a ? a : b) === (a || b)

So (a || b) could be seen as short-cut for the ternary operator.

-- 
Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#16810

FromStefan Weiss <krewecherl@gmail.com>
Date2012-10-23 02:42 +0200
Message-ID<k64p58$5bk$1@news.albasani.net>
In reply to#16804
On 2012-10-22 22:11, Christoph Becker wrote:
> Tim Streater wrote:
>> In article <cP4vbFDDoChQFwQo@invalid.uk.co.demon.merlyn.invalid>,
>> Dr J R Stockton <reply1242@merlyn.demon.co.uk.invalid> wrote:
>>
>>>  console.info( (n||"No") + " results" ) ; // ??
>> 
>> I find constructs such as this to be unreadable. I never use them since
>> I don't want to spend 20 mins figuring it out the first time, and
>> another 20 mins convincing myself it's correct each time I come across it.
> 
> If I'm not mistaken the following expression evaluates to true for all a,b:
> 
> (a ? a : b) === (a || b)
> 
> So (a || b) could be seen as short-cut for the ternary operator.

And a very useful one, IMHO. It's understandable that programmers who
are new to JS may be unused to this behavior, at first, but that's not a
good reason to avoid it altogether. JS programmers with a little more
experience can be expected to understand it. That's the target group I
usually have in mind when I program.

A similar argument could be made against pre- and post-increment
operators. Some people (like Douglas Crockford) advocate avoiding them
because of their potential for creating unreadable code. Same thing with
bitwise operators in JS, and various other constructs like regular
expressions, switch, or the ternary operator. In the hands of a capable
programmer, all of these can be used just fine, and will not necessarily
lead to write-only code. I for one refuse to restrict myself in that
way, just to spare a hypothetical inexperienced reader the trouble of
learning the language properly.


- stefan


PS, this is in no way directed at the OP, who appears to be a veteran
programmer, and who is more than willing to learn about the finer points
of a new language.

[toc] | [prev] | [next] | [standalone]


#16813

FromHans-Georg Michna <hans-georgNoEmailPlease@michna.com>
Date2012-10-23 10:08 +0200
Message-ID<34kc8891f88bbr64thhv2rh85bl59e35uo@4ax.com>
In reply to#16810
On Tue, 23 Oct 2012 02:42:15 +0200, Stefan Weiss wrote:

>A similar argument could be made against pre- and post-increment
>operators. Some people (like Douglas Crockford) advocate avoiding them
>because of their potential for creating unreadable code. Same thing with
>bitwise operators in JS, and various other constructs like regular
>expressions, switch, or the ternary operator. In the hands of a capable
>programmer, all of these can be used just fine, and will not necessarily
>lead to write-only code. I for one refuse to restrict myself in that
>way, just to spare a hypothetical inexperienced reader the trouble of
>learning the language properly.

Seconded.

Hans-Georg

[toc] | [prev] | [next] | [standalone]


#16752

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2012-10-20 18:34 +0200
Message-ID<XnsA0F2BD07FB26Deejj99@194.109.133.133>
In reply to#16739
Patricia Shanahan wrote on 19 okt 2012 in comp.lang.javascript:

> On 10/18/2012 3:49 PM, Evertjan. wrote:
> ...
>> You young boys and girls perhaps do not remember programming in
>> Assembler or Forth, [or Algol], [and think pascal is a small form of
>> hectopascal] so have a limited definition of "new" in this field.
> ...
> 
> I don't know if you are including me in "girls", but I still remember
> life as an assembly language programmer in 1970. I've also done
> significant programming in Forth and Pascal, but I've only done some
> student exercises in Algol.

Accidentally or by subconcious intent, I failed to write "young girls".

In any case I am sure you will stay young forever, Patricia.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#16705

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-10-18 11:57 +0200
Message-ID<1538954.egObkdgl4n@PointedEars.de>
In reply to#16703
Patricia Shanahan wrote:

> I've just started writing some of my production code, as distinct from
> throw-away tests and practice programs. I find myself writing in a style
> that would work in a strongly typed language. I know the intended type
> of each identifier, and find myself recording types in comments.

Good idea.  Consider using (some variant of) JSdoc (until something better 
comes along).

> It is perhaps natural because I have been programming so long in
> more strongly typed languages.
> 
> Is it a problem?

With that "much" information, I have to say yes.

> On the one hand, it makes for very organized code, with a lot of
> opportunities for adding type-checking assertions, generally a good
> thing. On the other hand, I may be missing out on opportunities to make
> my code simpler and a better fit for the language.
> 
> Is it enough to be aware of the dynamic aspects of the language, and be
> prepared to use them when strong typing gets in the way?

(see above)

No.  (However, contrary to common misconception, there are no "untyped 
variables".  Implementations of ECMAScript Ed. 1 to 3, 5, and 5.1 are 
dynamically and weakly typed, not untyped.  Uninitialized variables and 
trailing parameters for which no argument has been passed, hold the 
`undefined' value, the sole value of the Undefined type.)


PointedEars
-- 
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
  -- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>

[toc] | [prev] | [next] | [standalone]


#16706

FromPatricia Shanahan <pats@acm.org>
Date2012-10-18 13:06 +0100
Message-ID<cfCdnQ0lM4FWbeLNnZ2dnUVZ_rmdnZ2d@earthlink.com>
In reply to#16705
Thomas 'PointedEars' Lahn wrote:
> Patricia Shanahan wrote:
> 
>> I've just started writing some of my production code, as distinct from
>> throw-away tests and practice programs. I find myself writing in a style
>> that would work in a strongly typed language. I know the intended type
>> of each identifier, and find myself recording types in comments.
> 
> Good idea.  Consider using (some variant of) JSdoc (until something better 
> comes along).

Yes, I've found JSdoc, and not yet found anything better, so I'm writing
my comments in that format. I'm not sure which variant to use, but I
will probably do several passes over my documentation anyway.

> 
>> It is perhaps natural because I have been programming so long in
>> more strongly typed languages.
>>
>> Is it a problem?
> 
> With that "much" information, I have to say yes.

The good news is that I do understand the problem of trying to program
in language X as though it were language Y. People who do that end up
programming in a very unsatisfactory language containing only the
features that are in common to the two languages, and work the same way
in both of them.

> 
>> On the one hand, it makes for very organized code, with a lot of
>> opportunities for adding type-checking assertions, generally a good
>> thing. On the other hand, I may be missing out on opportunities to make
>> my code simpler and a better fit for the language.
>>
>> Is it enough to be aware of the dynamic aspects of the language, and be
>> prepared to use them when strong typing gets in the way?
> 
> (see above)
> 
> No.  (However, contrary to common misconception, there are no "untyped 
> variables".  Implementations of ECMAScript Ed. 1 to 3, 5, and 5.1 are 
> dynamically and weakly typed, not untyped.  Uninitialized variables and 
> trailing parameters for which no argument has been passed, hold the 
> `undefined' value, the sole value of the Undefined type.)

As I understand the issue, a variable always has a type, but that type
can change on assignment. Similarly, the type of a formal parameter is
determined by the type of the actual parameter in the call, or, as you
say, the Undefined type if the call did not supply an actual parameter.

This is obviously significantly different from having a type that is
fixed at declaration, and I need to wrap my brain around the implications.

Patricia

[toc] | [prev] | [next] | [standalone]


#16707

From"Jukka K. Korpela" <jkorpela@cs.tut.fi>
Date2012-10-18 15:32 +0300
Message-ID<k5ost7$d7o$1@dont-email.me>
In reply to#16706
2012-10-18 15:06, Patricia Shanahan wrote:

 > Thomas 'PointedEars' Lahn wrote:
>
>> No.  (However, contrary to common misconception, there are no "untyped
>> variables".  Implementations of ECMAScript Ed. 1 to 3, 5, and 5.1 are
>> dynamically and weakly typed, not untyped.  Uninitialized variables
>> and trailing parameters for which no argument has been passed, hold
>> the `undefined' value, the sole value of the Undefined type.)

That's misleading play with words. Calling a variable typed just because 
its values have types is pointless.

> As I understand the issue, a variable always has a type, but that type
> can change on assignment.

No, a variable has values (possible different values, possibly of 
different types, at different times, and the values have types.

 > Similarly, the type of a formal parameter is
> determined by the type of the actual parameter in the call

A formal parameter has no type. Its values may have types. When you call 
foo(42), then the formal parameter gets the value 42, a number. When you 
call foo('a'), it gets the value 'a', a string. There is no point in 
confusing this by saying that parameters or variables have types.

As a programming style matter, you can decide to use each variable for 
values of a single type only. You can say that in a comment, or maybe 
just implicitly in initialization, e.g. var boo = '' would mean (in 
"typed style") that you intend to use boo with a string as its value.

I don't see any general problem with such an approach. It's mostly a 
good principle to use one variable for values of one type - one might 
even say that it's probably worth a comment in the source if you do 
otherwise in some case.

However, it is essential to note that the mechanisms of the language do 
not protect you from "type errors" in the sense as in many other 
languages where you get a compile-time or run-time message about 
assignment of a value of a wrong type. Neither do you get automatic type 
conversions based on the type of a variable - simply because variables 
do not have types in JavaScript.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

[toc] | [prev] | [next] | [standalone]


Page 5 of 6 — ← Prev page 1 2 3 4 [5] 6  Next page →

Back to top | Article view | comp.lang.javascript


csiph-web