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


Groups > comp.lang.javascript > #31197

Re: JSlint finds for loops intolerable

From $Bill <news@todbe.com>
Newsgroups comp.lang.javascript
Subject Re: JSlint finds for loops intolerable
Date 2016-08-28 14:59 -0700
Organization A noiseless patient Spider
Message-ID <npvmrs$uac$1@dont-email.me> (permalink)
References <npug18$166s$1@gioia.aioe.org>

Show all headers | View raw


On 08-28-16 03:56, emf wrote:
> In the current JSLint help webpage (http://jslint.com/help.html) it now says:
>
> "Tolerate for statement:
> true if the for statement should be allowed
> It is almost always better to use the array methods instead."
>
> Getting rid of the for loops is a big change. Reflecting on it, however, the for loop is an awkward construction -- it's just something you learn as a matter of fact when you begin and that time on you take it for granted. Instead of
>
> for (var i = 0; i < 10; i += 1) {
>     ...
> }
>
> the while loop does seem more straightforward:
>
> var i = 0;
> while (i < 10) {
>     ...
>     i += 1;
> }
>
> After stopping using for loops, I can imagine a time when I won't be able to understand why I once almost always preferred to use them.
>
> I do not understand, however, the comment about array methods. I seldom find use for them. Can someone explain what Crawford implies??

Anyone that's been a programmer prior to HTML is familiar with the standard C for loop.
Seems more straightforward than the 3-piece while loop you have there.
It's concise, self contained on one line and obvious to any programmer that's been
around a while.  Combined with a while and a foreach loop, you have all the looping
constructs you need.  Of course there was no object oriented programming at the time
of invention - everything was procedural which could make a difference.

So "Tolerate For == true;"

Back to comp.lang.javascript | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

JSlint finds for loops intolerable emf <emfril@gmail.com> - 2016-08-28 06:56 -0400
  Re: JSlint finds for loops intolerable "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-08-28 14:28 +0200
    Re: JSlint finds for loops intolerable emf <emfril@gmail.com> - 2016-08-29 22:35 -0400
    Re: JSlint finds for loops intolerable Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-08-30 12:11 +0200
      Re: JSlint finds for loops intolerable "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-09-03 20:54 +0200
      Re: JSlint finds for loops intolerable Scott Sauyet <scott@sauyet.com> - 2016-09-03 23:03 +0000
    Re: JSlint finds for loops intolerable Scott Sauyet <scott@sauyet.com> - 2016-09-03 22:47 +0000
  Re: JSlint finds for loops intolerable Lewis Perin <perin@panix.com> - 2016-08-28 16:50 -0400
    Re: JSlint finds for loops intolerable Lewis Perin <perin@panix.com> - 2016-08-28 18:49 -0400
      Re: JSlint finds for loops intolerable Lewis Perin <perin@panix.com> - 2016-08-28 19:13 -0400
  Re: JSlint finds for loops intolerable $Bill <news@todbe.com> - 2016-08-28 14:59 -0700

csiph-web