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


Groups > comp.lang.javascript > #37674

Re: Lazy programmers guide to blizz

Newsgroups comp.lang.javascript
Date 2019-11-02 04:02 -0700
References <a5e610b3-f5ee-4d80-a085-0d9300fa5e1d@googlegroups.com> <96195235-1db3-458b-a25f-d38a48a84291@googlegroups.com> <9cc18ff7-4972-454e-b5c7-a722887bf1db@googlegroups.com> <7e61e43c-594d-4206-ad60-d9d0e6a8490b@googlegroups.com> <9193c2a0-0097-447c-bcc2-dda8e86cb8c1@googlegroups.com>
Message-ID <12838d9d-b4fe-4e34-883b-bde8c301013d@googlegroups.com> (permalink)
Subject Re: Lazy programmers guide to blizz
From Jonas Thörnvall <jonas.thornvall@gmail.com>

Show all headers | View raw


Den lördag 2 november 2019 kl. 11:57:21 UTC+1 skrev Jonas Thörnvall:
> Den fredag 1 november 2019 kl. 21:23:27 UTC+1 skrev Jonas Thörnvall:
> > Den fredag 1 november 2019 kl. 21:19:56 UTC+1 skrev Jonas Thörnvall:
> > > Den fredag 1 november 2019 kl. 18:44:26 UTC+1 skrev luserdroog:
> > > > On Friday, November 1, 2019 at 2:51:05 AM UTC-5, Jonas Thörnvall wrote:
> > > > > It so boring writing if intervals using < > or > <
> > > > > And hard to read
> > > > > Why not simplify 
> > > > > 
> > > > > if(A inside.interval(144-159))
> > > > > if (A outside.interval(144-159))
> > > > > 
> > > > > Maybe there already is interval functions in javascript?
> > > > > 
> > > > > Alteratively for the operator fixated
> > > > > if   (144< A <159)
> > > > > if   (144> A >159)
> > > > > 
> > > > > I know whichone i would prefer......
> > > > 
> > > > When I've needed something like this, I just write a function.
> > > > 
> > > >   function within( lower, x, upper ){
> > > >     return lower <= x && x < upper;
> > > >   }
> > > > 
> > > > The half-open interval is very common, eg.
> > > > 
> > > >   function httpOK( response ){
> > > >     return within( 200, response, 300 );
> > > >   }
> > > > 
> > > > BTW, (144< A <159) probably doesn't do what you think it should.
> > > > 
> > > > For the "outside" interval, just prefix ! (logical NOT) to the
> > > > function call.
> > > > 
> > > > For a more OO style, how about
> > > > 
> > > > class Interval {
> > > >   constructor( lower, upper ){
> > > >     this.lower = lower;
> > > >     this.upper = upper;
> > > >     return this;
> > > >   }
> > > >   inside( x ){
> > > >     return this.lower <= x && x < this.upper;
> > > >   }
> > > >   outside( x ){
> > > >     return ! this.inside( x );
> > > >   }
> > > > }
> > > > 
> > > > if( Interval(145, 159).inside(A) ) 
> > > > if( Interval(145, 159).outside(A) )
> > > 
> > > You people really fuck up things beyond  semantical an interval can not be inside a number.... It may be outside but you really love to add complexity to problems that is simple. An interval is always a range there is no between in it so interval 1 to 3 always hold 1 and 2 and 3.
> > > 
> > > But why do feel the urge to change things so they do not make sense  the interval can never be inside A.....
> > > 
> > > It is utterly stupid...
> > 
> > So i repeat if (A inside.interval(128-144)) there is no need for anything else.
> 
> Maybe one should fuck the dots, paragraphs, blips and blops all together and make a semantical correct language that people could program out of the box.
> 
> if A inside interval 128-144.
> if A bigger then B.
> if A smaller then B.
> if A eual B.
> 
> A=2.
> do while A < then B and A length less then 10
> 
> 
> A++.
> done.
> 
> Maybe i make a parser for javascript one day, javascript has nice features but fucked up syntax/semantics.

Well evidently even i got damaged by syntax.
A equal 2.
A add 1.

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


Thread

Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-01 00:50 -0700
  Re: Lazy programmers guide to blizz dr.j.r.stockton@gmail.com - 2019-11-01 02:42 -0700
    Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-01 06:22 -0700
      Re: Lazy programmers guide to blizz Silvio <silvio@internet.com> - 2019-11-01 18:21 +0100
        Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-01 10:39 -0700
          Re: Lazy programmers guide to blizz Silvio <silvio@internet.com> - 2019-11-02 19:45 +0100
            Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-02 17:57 -0700
        Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-01 10:42 -0700
  Re: Lazy programmers guide to blizz John G Harris <niam@jghnorth.org.uk.invalid> - 2019-11-01 09:58 +0000
    Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-01 12:22 -0700
      Re: Lazy programmers guide to blizz dr.j.r.stockton@gmail.com - 2019-11-01 14:02 -0700
        Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-01 15:19 -0700
  Re: Lazy programmers guide to blizz Arno Welzel <usenet@arnowelzel.de> - 2019-11-01 11:04 +0100
    Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-01 06:27 -0700
      Re: Lazy programmers guide to blizz Arno Welzel <usenet@arnowelzel.de> - 2019-11-05 11:06 +0100
  Re: Lazy programmers guide to blizz luserdroog <luser.droog@gmail.com> - 2019-11-01 10:44 -0700
    Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-01 13:19 -0700
      Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-01 13:23 -0700
        Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-02 03:57 -0700
          Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-02 04:02 -0700
          Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-02 04:44 -0700
          Re: Lazy programmers guide to blizz Arno Welzel <usenet@arnowelzel.de> - 2019-11-05 11:20 +0100
        Re: Lazy programmers guide to blizz Arno Welzel <usenet@arnowelzel.de> - 2019-11-05 11:14 +0100
      Re: Lazy programmers guide to blizz luserdroog <luser.droog@gmail.com> - 2019-11-01 14:48 -0700
      Re: Lazy programmers guide to blizz John G Harris <niam@jghnorth.org.uk.invalid> - 2019-11-02 14:23 +0000
        Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-02 08:17 -0700
          Re: Lazy programmers guide to blizz John G Harris <niam@jghnorth.org.uk.invalid> - 2019-11-02 18:12 +0000
            Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-02 17:56 -0700
      Re: Lazy programmers guide to blizz Arno Welzel <usenet@arnowelzel.de> - 2019-11-05 11:14 +0100
        Re: Lazy programmers guide to blizz luserdroog <luser.droog@gmail.com> - 2019-11-05 09:04 -0800
  Re: Lazy programmers guide to blizz Flng Fck <nothanks@invalid.invalid> - 2019-11-04 11:31 +0100
    Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-04 02:46 -0800
      Re: Lazy programmers guide to blizz Gregor Kofler <usenet@gregorkofler.com> - 2019-11-07 14:59 +0100
    Re: Lazy programmers guide to blizz Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-04 02:48 -0800
      Re: Lazy programmers guide to blizz Silvio <silvio@internet.com> - 2019-11-05 09:38 +0100

csiph-web