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


Groups > comp.lang.javascript > #36876

Re: Rudimentary programming methodology

Newsgroups comp.lang.javascript
Date 2019-06-13 00:57 -0700
References <9beb723d-79b6-4894-bf22-6906fb06dec1@googlegroups.com> <XnsAA6CF33282DACeejj99@194.109.6.166> <69a21152-fca0-4037-a818-7e61ed22fe5f@googlegroups.com> <1278c859-eec5-4787-966a-38ac2b9af03b@googlegroups.com>
Message-ID <02fafd13-fb2d-4ccb-bff3-bc6a70fe20dd@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. 09:49:39 UTC+2 skrev Jonas Thörnvall:
> Den torsdag 13 juni 2019 kl. 08:57:06 UTC+2 skrev Jonas Thörnvall:
> > Den torsdag 13 juni 2019 kl. 00:45:19 UTC+2 skrev Evertjan.:
> > > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 12
> > > Jun 2019 in comp.lang.javascript: 
> > > 
> > > > I have a problem that i should know howto solve it is probably very
> > > > basic. 
> > > > 
> > > > Normally when you have choices, the most common way is to solve it with
> > > > if, else if. 
> > > > 
> > > > But sometimes your choices is fundamental to a process, so they are the
> > > > input parmeters for something. 
> > > > 
> > > > In my case i have a metronome, but depending on the "synth/hardware" you
> > > > want to use you simply select it from an option list. 
> > > > 
> > > > And now i could do 
> > > > 
> > > > if (met=="external") {something sent to port)
> > > > else if (met=="othersynth") {something else sent to port}
> > > > else if (met=="anothersynth") {something else sent to port}
> > > > 
> > > > 
> > > > If these are timed events it is not that effective to do this x times a
> > > > second. 
> > > > 
> > > > So you just want check and set the case once? and then be used everytime
> > > > during the interval? 
> > > > 
> > > > I guess that means to breakout the if cases into functions?
> > > > But you just want the actual function call to differ, but not be checked
> > > > every time you send something to the metronome. 
> > > > 
> > > > Basicly about setting what function to be called once, like flipping a
> > > > switch and then it always take that "path". 
> > > > 
> > > > I have a slight memory it could be case programming using switches, but
> > > > i don't quite see hot it applies dealing with timed events during an
> > > > interval? 
> > > > 
> > > > Basicly i want to replace if else if before every metronome event.
> > > 
> > > Basically you are not making sense,
> > > even for one professing a slight memory. 
> > > 
> > > Your timing requirements ar by large not short enough 
> > > to require machine language decision speeds.
> > > 
> > > Scripting language witches internally are just if-else-then constructs,
> > > and are perfect to implement logic showing a clearer human visible script, 
> > > not for much faster execution.
> > > 
> > > -- 
> > > Evertjan.
> > > The Netherlands.
> > > (Please change the x'es to dots in my emailaddress)
> > 
> > Even if it is not necessary in my case, is there a construct to handle this type of problems in Javascript? It must be something with realtime switches of sort.
> > 
> > It seem analogue to setting a switch to chose a leg/route "before" the actual timed events take place?
> > 
> > Is there a typecase for howto solve these types of problems?
> > Because i am a bit stumped for how i should tackle this type of problem?
> > They seem to create full legs with much more code then the actual choice of metronome? I could solve this type of problem with alot of code duplicated, but there must be some construct to just handle the explicit choice of metronome?
> 
> I guess this is maybe also about programming language methodology?
> 
> What would been awesome in languages would be...."i just dealt with highlevel Turbo Pascal, a little C , Java and javascript
> 
> A construct? like this.
> 
> 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
> 
> Maybe there already is and i am just lost on howto?

I guess that Case  in my example is a variable / construct holding an adress to some code to be run?

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