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


Groups > comp.lang.javascript > #36894

Re: Rudimentary programming methodology

Newsgroups comp.lang.javascript
Date 2019-06-13 04:01 -0700
References (4 earlier) <gmejb9Ffp58U2@mid.individual.net> <383de7d3-c422-4039-91dd-576f5a815d0a@googlegroups.com> <XnsAA6D7E4028C9Beejj99@194.109.6.166> <0d0ea75c-5b26-4f88-8094-5edeaca4199d@googlegroups.com> <7e2e0f80-cb71-4485-a2ac-c07754af34a5@googlegroups.com>
Message-ID <7c59fdb7-201f-4e71-be56-e8d016c84873@googlegroups.com> (permalink)
Subject Re: Rudimentary programming methodology
From Jonas Thörnvall <jonas.thornvall@gmail.com>

Show all headers | View raw


Den torsdag 13 juni 2019 kl. 12:48:45 UTC+2 skrev Jonas Thörnvall:
> Den torsdag 13 juni 2019 kl. 12:36:51 UTC+2 skrev Jonas Thörnvall:
> > Den torsdag 13 juni 2019 kl. 12:24:42 UTC+2 skrev Evertjan.:
> > > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 13
> > > Jun 2019 in comp.lang.javascript: 
> > > 
> > > > Well Arno Evertjan claimed that javscript switch is just a fancy layout
> > > > and doing if else if in background. So it is just a reading aid for
> > > > code. 
> > > 
> > > No, you should not try to read between the lines.
> > > 
> > > A switch DOES the same in the background as a if-then-else construct does,
> > > but IS NOT the same.
> > > 
> > > You can easily measure any timing improvement by setting up a test script.
> > > 
> > > > But maybe he was just trying to pull a joke upon me.
> > > 
> > > This is the first sensible idea you have, 
> > > you should always be prepared for that.
> > > 
> > > After all, forgetting the sex thing, there is only one thing more enjoyable 
> > > than discussing by arguments, and that is exchanging jokes.
> > > 
> > > PS: the discussion being more educational.
> > > 
> > > -- 
> > > Evertjan.
> > > The Netherlands.
> > > (Please change the x'es to dots in my emailaddress)
> > 
> > Well you make me confused Evertjan is there a sequential case evaluation until break, or is case basicly a function call to the appropriate case?
> > 
> > If it is not, why does not javascript have a construct more like this pseudocode where Case basicly a variable assigned to hold a function call?
> > 
> > Case A {do this} 
> > Case B {do that} 
> > Case C {do something else} 
> > 
> > If switch=A {Case:A)} else if switch=B {Case:B)}elseif switch=C {Case:C} 
> > 
> > start process 
> >   do Case; 
> > end process
> 
> This syntax would probably be more suitable for javascript.
> 
>  Case(A) {do this} 
>  Case(B) {do that} 
>  Case(C) {do something else} 
>  
>  If (switch==A) {x=A)} else if (switch==B) {x=B)} elseif (switch==C) {x=C} 
>  
>  
>  setTimeout(function(){Case(x);}, 300);
> 
> Well i know that x is normally a function parameter, and there is no syntax appropriate but since Case probably a reserved word i see no problem with it.
> 
> I think it is rather beautiful in its simplicity?

Well maybe you lke this syntax better.

 Case:A {do this} 
 Case:B {do that} 
 Case:C {do something else} 
  
 If (switch==A) {x=A)} else if (switch==B) {x=B)} elseif (switch==C) {x=C} 
  
  
 setTimeout(function(){Case:(x);}, 300)

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


Thread

Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-12 14:40 -0700
  Re: Rudimentary programming methodology "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-06-12 23:54 +0200
    Re: Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-12 23:41 -0700
      Re: Rudimentary programming methodology Arno Welzel <usenet@arnowelzel.de> - 2019-06-13 11:27 +0200
    Re: Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-12 23:56 -0700
      Re: Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-13 00:49 -0700
        Re: Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-13 00:57 -0700
          Re: Rudimentary programming methodology Arno Welzel <usenet@arnowelzel.de> - 2019-06-13 11:31 +0200
            Re: Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-13 03:19 -0700
            Re: Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-13 03:21 -0700
            Re: Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-13 03:26 -0700
              Re: Rudimentary programming methodology Arno Welzel <usenet@arnowelzel.de> - 2019-06-13 13:43 +0200
        Re: Rudimentary programming methodology Arno Welzel <usenet@arnowelzel.de> - 2019-06-13 11:29 +0200
          Re: Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-13 03:13 -0700
            Re: Rudimentary programming methodology "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-06-13 12:24 +0200
              Re: Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-13 03:36 -0700
                Re: Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-13 03:48 -0700
                Re: Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-13 03:56 -0700
                Re: Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-13 04:01 -0700
                Re: Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-13 04:03 -0700
                Re: Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-13 04:10 -0700
                Re: Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-13 04:14 -0700
                Re: Rudimentary programming methodology Arno Welzel <usenet@arnowelzel.de> - 2019-06-13 13:45 +0200
                Re: Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-15 03:36 -0700
                Re: Rudimentary programming methodology "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-06-15 13:49 +0200
                Re: Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-15 06:31 -0700
                Re: Rudimentary programming methodology dr.j.r.stockton@gmail.com - 2019-06-15 07:40 -0700
                Re: Rudimentary programming methodology Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-15 08:25 -0700
  Re: Rudimentary programming methodology JJ <jj4public@vfemail.net> - 2019-06-13 15:13 +0700
  Re: Rudimentary programming methodology dr.j.r.stockton@gmail.com - 2019-06-13 04:20 -0700

csiph-web