Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #32357 > unrolled thread
| Started by | jonas.thornvall@gmail.com |
|---|---|
| First post | 2017-01-26 10:39 -0800 |
| Last post | 2017-01-27 13:36 +0100 |
| Articles | 20 on this page of 56 — 9 participants |
Back to article view | Back to comp.lang.javascript
Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-26 10:39 -0800
Re: Logic problem, i always had problem translate until statements into while Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-26 20:28 +0000
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-26 13:24 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-26 13:33 -0800
Re: Logic problem, i always had problem translate until statements into while Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-26 23:06 +0000
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 01:33 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 01:57 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 02:17 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 02:35 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 02:39 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 02:43 -0800
Re: Logic problem, i always had problem translate until statements into while Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-27 11:23 +0000
Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-01-27 12:14 +0000
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 08:00 -0800
Re: Logic problem, i always had problem translate until statements into while Gene Wirchenko <genew@telus.net> - 2017-01-27 09:29 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 10:43 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 10:44 -0800
Re: Logic problem, i always had problem translate until statements into while Gene Wirchenko <genew@telus.net> - 2017-01-27 15:46 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 18:20 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 18:34 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 18:51 -0800
Re: Logic problem, i always had problem translate until statements into while John Harris <niam@jghnorth.org.uk.invalid> - 2017-01-28 10:07 +0000
Re: Logic problem, i always had problem translate until statements into while Gene Wirchenko <genew@telus.net> - 2017-01-30 09:14 -0800
Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-28 10:48 +0100
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-28 05:05 -0800
Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-27 13:43 +0100
Re: Logic problem, i always had problem translate until statements into while Scott Sauyet <scott.sauyet@gmail.com> - 2017-01-27 19:52 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 22:25 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 22:36 -0800
Re: Logic problem, i always had problem translate until statements into while Scott Sauyet <scott.sauyet@gmail.com> - 2017-01-29 18:05 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-30 09:25 -0800
Re: Logic problem, i always had problem translate until statements into while Dr J R Stockton <reply1700@merlyn.demon.co.uk.invalid> - 2017-01-31 23:12 +0000
Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-01 09:22 +0100
Re: Logic problem, i always had problem translate until statements into while Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-27 11:02 +0000
Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-01-27 12:11 +0000
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 07:53 -0800
Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-27 17:07 +0100
Re: Logic problem, i always had problem translate until statements into while Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-28 00:55 +0000
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 18:14 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 18:15 -0800
Re: Logic problem, i always had problem translate until statements into while Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-28 15:22 +0000
Re: Logic problem, i always had problem translate until statements into while Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-01-28 16:54 +0100
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-28 13:53 -0800
Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-01-28 22:13 +0000
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-29 01:27 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-29 09:41 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-02-01 08:51 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-02-01 09:03 -0800
Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-01 19:19 +0100
Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-02-01 18:35 +0000
Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-01 19:40 +0100
Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-02-01 19:06 +0000
Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-02-01 19:09 +0000
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-02-01 08:51 -0800
Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-02-01 16:56 +0000
Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-27 13:36 +0100
Page 1 of 3 [1] 2 3 Next page →
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-26 10:39 -0800 |
| Subject | Logic problem, i always had problem translate until statements into while |
| Message-ID | <7112e5ec-cc6f-4b7b-b7db-b83b52bf8fbe@googlegroups.com> |
do until (regular == true && connected == false ) I honestly feel a bit lost, because i think they are so easy to code using do until. So how should i think about it?
[toc] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2017-01-26 20:28 +0000 |
| Message-ID | <87inp11s6w.fsf@bsb.me.uk> |
| In reply to | #32357 |
jonas.thornvall@gmail.com writes:
> do until (regular == true && connected == false )
>
> I honestly feel a bit lost, because i think they are so easy to code
> using do until.
What as the initial values of 'regular' and 'connected'?
> So how should i think about it?
Provided the initial value of the resulting while condition is true you
just need to invert it:
while (!(regular == true && connected == false)) ...
You can use De Morgan's laws to simplify that if you like:
!(A && B) <=> !A || !B
!(A || B) <=> !A && !B
in your case
!(regular == true && connected == false)
=> !(regular == true) || !(connected == false)
=> regular != true || connected != false
which I'd just write as
while (!regular || connected) ...
Often, the use of do ... until is simply an error (while is needed more
often in algorithms than do...until). In those cases there is no need
for the loop to execute at least once and you don't need to check that
'!regular || connected' is initially true.
--
Ben.
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-26 13:24 -0800 |
| Message-ID | <36a74771-51d8-439a-bd1a-0c7338031b9c@googlegroups.com> |
| In reply to | #32358 |
Den torsdag 26 januari 2017 kl. 21:29:05 UTC+1 skrev Ben Bacarisse: > jonas.thornvall@gmail.com writes: > > > do until (regular == true && connected == false ) > > > > I honestly feel a bit lost, because i think they are so easy to code > > using do until. > > What as the initial values of 'regular' and 'connected'? > > > So how should i think about it? > > Provided the initial value of the resulting while condition is true you > just need to invert it: > > while (!(regular == true && connected == false)) ... > > You can use De Morgan's laws to simplify that if you like: > > !(A && B) <=> !A || !B > !(A || B) <=> !A && !B > > in your case > > !(regular == true && connected == false) > => !(regular == true) || !(connected == false) > => regular != true || connected != false > > which I'd just write as > > while (!regular || connected) ... > > Often, the use of do ... until is simply an error (while is needed more > often in algorithms than do...until). In those cases there is no need > for the loop to execute at least once and you don't need to check that > '!regular || connected' is initially true. > > -- > Ben. Unfortunately they are both false, but maybe is is because i run selective loops depending on user the user settings regular and connected. With naive coding it is easy, but it also make one wonder why should booleans have to need a starting condition do they really need to be true or false at start? NAIVE CODING regular=? connected=? if (regular checked && connected checked) do until (regular true && connected true) else if (regular checked && connected unchecked) do until (regular true && connected false) else if (regular unchecked && connected checked) do until (regular false && connected true) else do until (regular false && connected false) Normally i do not have any problem with if, if else, else but i feel blocked?
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-26 13:33 -0800 |
| Message-ID | <10dc87b2-3078-4b1d-a914-0461db1c80a6@googlegroups.com> |
| In reply to | #32359 |
Den torsdag 26 januari 2017 kl. 22:24:32 UTC+1 skrev jonas.t...@gmail.com: > Den torsdag 26 januari 2017 kl. 21:29:05 UTC+1 skrev Ben Bacarisse: > > jonas.thornvall@gmail.com writes: > > > > > do until (regular == true && connected == false ) > > > > > > I honestly feel a bit lost, because i think they are so easy to code > > > using do until. > > > > What as the initial values of 'regular' and 'connected'? > > > > > So how should i think about it? > > > > Provided the initial value of the resulting while condition is true you > > just need to invert it: > > > > while (!(regular == true && connected == false)) ... > > > > You can use De Morgan's laws to simplify that if you like: > > > > !(A && B) <=> !A || !B > > !(A || B) <=> !A && !B > > > > in your case > > > > !(regular == true && connected == false) > > => !(regular == true) || !(connected == false) > > => regular != true || connected != false > > > > which I'd just write as > > > > while (!regular || connected) ... > > > > Often, the use of do ... until is simply an error (while is needed more > > often in algorithms than do...until). In those cases there is no need > > for the loop to execute at least once and you don't need to check that > > '!regular || connected' is initially true. > > > > -- > > Ben. > > Unfortunately they are both false, but maybe is is because i run selective loops depending on user the user settings regular and connected. > > With naive coding it is easy, but it also make one wonder why should booleans have to need a starting condition do they really need to be true or false at start? > > NAIVE CODING regular=? connected=? > > if (regular checked && connected checked) > do until (regular true && connected true) > > else if (regular checked && connected unchecked) > do until (regular true && connected false) > > else if (regular unchecked && connected checked) > do until (regular false && connected true) > > else do until (regular false && connected false) > > Normally i do not have any problem with if, if else, else but i feel blocked? The real programming also have time constraints so you do not need to worry it will run forever, basically it is a search for graphs using attributes. I plan more so i don't think it will get easier.
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2017-01-26 23:06 +0000 |
| Message-ID | <87sho5zaj9.fsf@bsb.me.uk> |
| In reply to | #32360 |
jonas.thornvall@gmail.com writes: > Den torsdag 26 januari 2017 kl. 22:24:32 UTC+1 skrev jonas.t...@gmail.com: >> Den torsdag 26 januari 2017 kl. 21:29:05 UTC+1 skrev Ben Bacarisse: >> > jonas.thornvall@gmail.com writes: >> > >> > > do until (regular == true && connected == false ) >> > > >> > > I honestly feel a bit lost, because i think they are so easy to code >> > > using do until. >> > >> > What as the initial values of 'regular' and 'connected'? >> > >> > > So how should i think about it? >> > >> > Provided the initial value of the resulting while condition is true you >> > just need to invert it: >> > >> > while (!(regular == true && connected == false)) ... >> > >> > You can use De Morgan's laws to simplify that if you like: >> > >> > !(A && B) <=> !A || !B >> > !(A || B) <=> !A && !B >> > >> > in your case >> > >> > !(regular == true && connected == false) >> > => !(regular == true) || !(connected == false) >> > => regular != true || connected != false >> > >> > which I'd just write as >> > >> > while (!regular || connected) ... >> > >> > Often, the use of do ... until is simply an error (while is needed more >> > often in algorithms than do...until). In those cases there is no need >> > for the loop to execute at least once and you don't need to check that >> > '!regular || connected' is initially true. >> > >> > -- >> > Ben. >> >> Unfortunately they are both false, Why is that unfortunate? If they are both initially false your do...until can be written as a while with the condition negated. <snip> -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-27 01:33 -0800 |
| Message-ID | <74b7c25f-9f8f-4bc5-8380-9cb6e6e8bd1e@googlegroups.com> |
| In reply to | #32362 |
Den fredag 27 januari 2017 kl. 00:06:24 UTC+1 skrev Ben Bacarisse: > jonas.thornvall@gmail.com writes: > > > Den torsdag 26 januari 2017 kl. 22:24:32 UTC+1 skrev jonas.t...@gmail.com: > >> Den torsdag 26 januari 2017 kl. 21:29:05 UTC+1 skrev Ben Bacarisse: > >> > jonas.thornvall@gmail.com writes: > >> > > >> > > do until (regular == true && connected == false ) > >> > > > >> > > I honestly feel a bit lost, because i think they are so easy to code > >> > > using do until. > >> > > >> > What as the initial values of 'regular' and 'connected'? > >> > > >> > > So how should i think about it? > >> > > >> > Provided the initial value of the resulting while condition is true you > >> > just need to invert it: > >> > > >> > while (!(regular == true && connected == false)) ... > >> > > >> > You can use De Morgan's laws to simplify that if you like: > >> > > >> > !(A && B) <=> !A || !B > >> > !(A || B) <=> !A && !B > >> > > >> > in your case > >> > > >> > !(regular == true && connected == false) > >> > => !(regular == true) || !(connected == false) > >> > => regular != true || connected != false > >> > > >> > which I'd just write as > >> > > >> > while (!regular || connected) ... > >> > > >> > Often, the use of do ... until is simply an error (while is needed more > >> > often in algorithms than do...until). In those cases there is no need > >> > for the loop to execute at least once and you don't need to check that > >> > '!regular || connected' is initially true. > >> > > >> > -- > >> > Ben. > >> > >> Unfortunately they are both false, > > Why is that unfortunate? If they are both initially false your > do...until can be written as a while with the condition negated. > > <snip> > -- > Ben. I feel you dodged the obstacle, i asked if the boolean is generated/searched and found within loop and all values of the truth table can be found, how do you set the start condition, can i set the boolean to "null" at start?
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-27 01:57 -0800 |
| Message-ID | <dab5855e-f587-4639-9d5c-11af9a79bdc0@googlegroups.com> |
| In reply to | #32366 |
Den fredag 27 januari 2017 kl. 10:33:16 UTC+1 skrev jonas.t...@gmail.com: > Den fredag 27 januari 2017 kl. 00:06:24 UTC+1 skrev Ben Bacarisse: > > jonas.thornvall@gmail.com writes: > > > > > Den torsdag 26 januari 2017 kl. 22:24:32 UTC+1 skrev jonas.t...@gmail.com: > > >> Den torsdag 26 januari 2017 kl. 21:29:05 UTC+1 skrev Ben Bacarisse: > > >> > jonas.thornvall@gmail.com writes: > > >> > > > >> > > do until (regular == true && connected == false ) > > >> > > > > >> > > I honestly feel a bit lost, because i think they are so easy to code > > >> > > using do until. > > >> > > > >> > What as the initial values of 'regular' and 'connected'? > > >> > > > >> > > So how should i think about it? > > >> > > > >> > Provided the initial value of the resulting while condition is true you > > >> > just need to invert it: > > >> > > > >> > while (!(regular == true && connected == false)) ... > > >> > > > >> > You can use De Morgan's laws to simplify that if you like: > > >> > > > >> > !(A && B) <=> !A || !B > > >> > !(A || B) <=> !A && !B > > >> > > > >> > in your case > > >> > > > >> > !(regular == true && connected == false) > > >> > => !(regular == true) || !(connected == false) > > >> > => regular != true || connected != false > > >> > > > >> > which I'd just write as > > >> > > > >> > while (!regular || connected) ... > > >> > > > >> > Often, the use of do ... until is simply an error (while is needed more > > >> > often in algorithms than do...until). In those cases there is no need > > >> > for the loop to execute at least once and you don't need to check that > > >> > '!regular || connected' is initially true. > > >> > > > >> > -- > > >> > Ben. > > >> > > >> Unfortunately they are both false, > > > > Why is that unfortunate? If they are both initially false your > > do...until can be written as a while with the condition negated. > > > > <snip> > > -- > > Ben. > > I feel you dodged the obstacle, i asked if the boolean is generated/searched and found within loop and all values of the truth table can be found, how do you set the start condition, can i set the boolean to "null" at start? I slightly remember one can use a switch within side loop and look for the boolean values within loop and set the switch, but does that not defy the purpose of having booleans in the programming language to start with? Something either wrong with my way of thinking about it, or there is something wrong with that the boolan value do not have a null configuration. Because i read that in javascript a null setting will return false var x=null, boolean(x) return false? Maybe it is wrong from a structural point to look at something that have not been generated yet, but it sure would make things alot easier?
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-27 02:17 -0800 |
| Message-ID | <d196cdb5-c79c-4771-bc6a-5fbd2119c437@googlegroups.com> |
| In reply to | #32367 |
Den fredag 27 januari 2017 kl. 10:57:26 UTC+1 skrev jonas.t...@gmail.com: > Den fredag 27 januari 2017 kl. 10:33:16 UTC+1 skrev jonas.t...@gmail.com: > > Den fredag 27 januari 2017 kl. 00:06:24 UTC+1 skrev Ben Bacarisse: > > > jonas.thornvall@gmail.com writes: > > > > > > > Den torsdag 26 januari 2017 kl. 22:24:32 UTC+1 skrev jonas.t...@gmail.com: > > > >> Den torsdag 26 januari 2017 kl. 21:29:05 UTC+1 skrev Ben Bacarisse: > > > >> > jonas.thornvall@gmail.com writes: > > > >> > > > > >> > > do until (regular == true && connected == false ) > > > >> > > > > > >> > > I honestly feel a bit lost, because i think they are so easy to code > > > >> > > using do until. > > > >> > > > > >> > What as the initial values of 'regular' and 'connected'? > > > >> > > > > >> > > So how should i think about it? > > > >> > > > > >> > Provided the initial value of the resulting while condition is true you > > > >> > just need to invert it: > > > >> > > > > >> > while (!(regular == true && connected == false)) ... > > > >> > > > > >> > You can use De Morgan's laws to simplify that if you like: > > > >> > > > > >> > !(A && B) <=> !A || !B > > > >> > !(A || B) <=> !A && !B > > > >> > > > > >> > in your case > > > >> > > > > >> > !(regular == true && connected == false) > > > >> > => !(regular == true) || !(connected == false) > > > >> > => regular != true || connected != false > > > >> > > > > >> > which I'd just write as > > > >> > > > > >> > while (!regular || connected) ... > > > >> > > > > >> > Often, the use of do ... until is simply an error (while is needed more > > > >> > often in algorithms than do...until). In those cases there is no need > > > >> > for the loop to execute at least once and you don't need to check that > > > >> > '!regular || connected' is initially true. > > > >> > > > > >> > -- > > > >> > Ben. > > > >> > > > >> Unfortunately they are both false, > > > > > > Why is that unfortunate? If they are both initially false your > > > do...until can be written as a while with the condition negated. > > > > > > <snip> > > > -- > > > Ben. > > > > I feel you dodged the obstacle, i asked if the boolean is generated/searched and found within loop and all values of the truth table can be found, how do you set the start condition, can i set the boolean to "null" at start? > > I slightly remember one can use a switch within side loop and look for the boolean values within loop and set the switch, but does that not defy the purpose of having booleans in the programming language to start with? > > Something either wrong with my way of thinking about it, or there is something wrong with that the boolan value do not have a null configuration. Because i read that in javascript a null setting will return false var x=null, boolean(x) return false? > > Maybe it is wrong from a structural point to look at something that have not been generated yet, but it sure would make things alot easier? Sometimes the coding get convoluted for what i would call no reason at all. Why is programming languages constructed that way, i mean isn't do until clear enough, and why do i need a swithch inside would it be flawed to allow a boolean to be undefined "probably"? But it sure would make coding more straight forvard NAIVE CODING regular=false connected=false found==false if (regbox checked && conbox checked) do until (found==true) generate(); if (regular true && connected true) found true; else if (regbox checked && conbox unchecked) do until (found==true) generate(); if (regular true && connected false) found true; else if (regbox unchecked && conbox checked) do until (found==true) generate(); if (regular false && connected true) found true; else if (regbox unchecked && connected unchecked) do until (found==true) generate(); if (regular false && connected false) found true;
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-27 02:35 -0800 |
| Message-ID | <c7e16efd-38a1-4a5a-b4d2-cb6f91c7dcee@googlegroups.com> |
| In reply to | #32368 |
Den fredag 27 januari 2017 kl. 11:17:42 UTC+1 skrev jonas.t...@gmail.com: > Den fredag 27 januari 2017 kl. 10:57:26 UTC+1 skrev jonas.t...@gmail.com: > > Den fredag 27 januari 2017 kl. 10:33:16 UTC+1 skrev jonas.t...@gmail.com: > > > Den fredag 27 januari 2017 kl. 00:06:24 UTC+1 skrev Ben Bacarisse: > > > > jonas.thornvall@gmail.com writes: > > > > > > > > > Den torsdag 26 januari 2017 kl. 22:24:32 UTC+1 skrev jonas.t...@gmail.com: > > > > >> Den torsdag 26 januari 2017 kl. 21:29:05 UTC+1 skrev Ben Bacarisse: > > > > >> > jonas.thornvall@gmail.com writes: > > > > >> > > > > > >> > > do until (regular == true && connected == false ) > > > > >> > > > > > > >> > > I honestly feel a bit lost, because i think they are so easy to code > > > > >> > > using do until. > > > > >> > > > > > >> > What as the initial values of 'regular' and 'connected'? > > > > >> > > > > > >> > > So how should i think about it? > > > > >> > > > > > >> > Provided the initial value of the resulting while condition is true you > > > > >> > just need to invert it: > > > > >> > > > > > >> > while (!(regular == true && connected == false)) ... > > > > >> > > > > > >> > You can use De Morgan's laws to simplify that if you like: > > > > >> > > > > > >> > !(A && B) <=> !A || !B > > > > >> > !(A || B) <=> !A && !B > > > > >> > > > > > >> > in your case > > > > >> > > > > > >> > !(regular == true && connected == false) > > > > >> > => !(regular == true) || !(connected == false) > > > > >> > => regular != true || connected != false > > > > >> > > > > > >> > which I'd just write as > > > > >> > > > > > >> > while (!regular || connected) ... > > > > >> > > > > > >> > Often, the use of do ... until is simply an error (while is needed more > > > > >> > often in algorithms than do...until). In those cases there is no need > > > > >> > for the loop to execute at least once and you don't need to check that > > > > >> > '!regular || connected' is initially true. > > > > >> > > > > > >> > -- > > > > >> > Ben. > > > > >> > > > > >> Unfortunately they are both false, > > > > > > > > Why is that unfortunate? If they are both initially false your > > > > do...until can be written as a while with the condition negated. > > > > > > > > <snip> > > > > -- > > > > Ben. > > > > > > I feel you dodged the obstacle, i asked if the boolean is generated/searched and found within loop and all values of the truth table can be found, how do you set the start condition, can i set the boolean to "null" at start? > > > > I slightly remember one can use a switch within side loop and look for the boolean values within loop and set the switch, but does that not defy the purpose of having booleans in the programming language to start with? > > > > Something either wrong with my way of thinking about it, or there is something wrong with that the boolan value do not have a null configuration. Because i read that in javascript a null setting will return false var x=null, boolean(x) return false? > > > > Maybe it is wrong from a structural point to look at something that have not been generated yet, but it sure would make things alot easier? > > Sometimes the coding get convoluted for what i would call no reason at all. > Why is programming languages constructed that way, i mean isn't do until clear enough, and why do i need a swithch inside would it be flawed to allow a boolean to be undefined "probably"? > > But it sure would make coding more straight forvard > > NAIVE CODING regular=false connected=false found==false > > if (regbox checked && conbox checked) > do until (found==true) > generate(); > if (regular true && connected true) found true; > > else if (regbox checked && conbox unchecked) > do until (found==true) > generate(); > if (regular true && connected false) found true; > > else if (regbox unchecked && conbox checked) > do until (found==true) > generate(); > if (regular false && connected true) found true; > > else if (regbox unchecked && connected unchecked) > do until (found==true) > generate(); > if (regular false && connected false) found true; I mean aftarall what is the logic looking for while (found==false) or while (found!=true) compare to do until(found==true) elegance ;) For none programmers i can say that probably 99,999 would express the later as more clearly expressed, so why do programmers prefer the former "negated statement", is it an occupational injury of the programming environment? It would be like trying to trap a bird, and say as long there is no bird in cage i did not trap any, repeatedly. While ***normal*** people prefer i do this until i trap a bird "yeah i know they have to check in the box but probably they do check if it is a bird there not if the cage is empty. So why do programmers look for the empty cage when they want it full, that is my question.
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-27 02:39 -0800 |
| Message-ID | <4fb6cf5c-dc4f-4f23-a1cf-c48c8264aaf9@googlegroups.com> |
| In reply to | #32369 |
Den fredag 27 januari 2017 kl. 11:35:37 UTC+1 skrev jonas.t...@gmail.com: > Den fredag 27 januari 2017 kl. 11:17:42 UTC+1 skrev jonas.t...@gmail.com: > > Den fredag 27 januari 2017 kl. 10:57:26 UTC+1 skrev jonas.t...@gmail.com: > > > Den fredag 27 januari 2017 kl. 10:33:16 UTC+1 skrev jonas.t...@gmail.com: > > > > Den fredag 27 januari 2017 kl. 00:06:24 UTC+1 skrev Ben Bacarisse: > > > > > jonas.thornvall@gmail.com writes: > > > > > > > > > > > Den torsdag 26 januari 2017 kl. 22:24:32 UTC+1 skrev jonas.t...@gmail.com: > > > > > >> Den torsdag 26 januari 2017 kl. 21:29:05 UTC+1 skrev Ben Bacarisse: > > > > > >> > jonas.thornvall@gmail.com writes: > > > > > >> > > > > > > >> > > do until (regular == true && connected == false ) > > > > > >> > > > > > > > >> > > I honestly feel a bit lost, because i think they are so easy to code > > > > > >> > > using do until. > > > > > >> > > > > > > >> > What as the initial values of 'regular' and 'connected'? > > > > > >> > > > > > > >> > > So how should i think about it? > > > > > >> > > > > > > >> > Provided the initial value of the resulting while condition is true you > > > > > >> > just need to invert it: > > > > > >> > > > > > > >> > while (!(regular == true && connected == false)) ... > > > > > >> > > > > > > >> > You can use De Morgan's laws to simplify that if you like: > > > > > >> > > > > > > >> > !(A && B) <=> !A || !B > > > > > >> > !(A || B) <=> !A && !B > > > > > >> > > > > > > >> > in your case > > > > > >> > > > > > > >> > !(regular == true && connected == false) > > > > > >> > => !(regular == true) || !(connected == false) > > > > > >> > => regular != true || connected != false > > > > > >> > > > > > > >> > which I'd just write as > > > > > >> > > > > > > >> > while (!regular || connected) ... > > > > > >> > > > > > > >> > Often, the use of do ... until is simply an error (while is needed more > > > > > >> > often in algorithms than do...until). In those cases there is no need > > > > > >> > for the loop to execute at least once and you don't need to check that > > > > > >> > '!regular || connected' is initially true. > > > > > >> > > > > > > >> > -- > > > > > >> > Ben. > > > > > >> > > > > > >> Unfortunately they are both false, > > > > > > > > > > Why is that unfortunate? If they are both initially false your > > > > > do...until can be written as a while with the condition negated. > > > > > > > > > > <snip> > > > > > -- > > > > > Ben. > > > > > > > > I feel you dodged the obstacle, i asked if the boolean is generated/searched and found within loop and all values of the truth table can be found, how do you set the start condition, can i set the boolean to "null" at start? > > > > > > I slightly remember one can use a switch within side loop and look for the boolean values within loop and set the switch, but does that not defy the purpose of having booleans in the programming language to start with? > > > > > > Something either wrong with my way of thinking about it, or there is something wrong with that the boolan value do not have a null configuration. Because i read that in javascript a null setting will return false var x=null, boolean(x) return false? > > > > > > Maybe it is wrong from a structural point to look at something that have not been generated yet, but it sure would make things alot easier? > > > > Sometimes the coding get convoluted for what i would call no reason at all. > > Why is programming languages constructed that way, i mean isn't do until clear enough, and why do i need a swithch inside would it be flawed to allow a boolean to be undefined "probably"? > > > > But it sure would make coding more straight forvard > > > > NAIVE CODING regular=false connected=false found==false > > > > if (regbox checked && conbox checked) > > do until (found==true) > > generate(); > > if (regular true && connected true) found true; > > > > else if (regbox checked && conbox unchecked) > > do until (found==true) > > generate(); > > if (regular true && connected false) found true; > > > > else if (regbox unchecked && conbox checked) > > do until (found==true) > > generate(); > > if (regular false && connected true) found true; > > > > else if (regbox unchecked && connected unchecked) > > do until (found==true) > > generate(); > > if (regular false && connected false) found true; > > I mean aftarall what is the logic looking for > while (found==false) or while (found!=true) > > compare to > > do until(found==true) elegance ;) > > For none programmers i can say that probably 99,999 would express the later as more clearly expressed, so why do programmers prefer the former "negated statement", is it an occupational injury of the programming environment? > > It would be like trying to trap a bird, and say as long there is no bird in cage i did not trap any, repeatedly. > > While ***normal*** people prefer i do this until i trap a bird "yeah i know they have to check in the box but probably they do check if it is a bird there not if the cage is empty. > > So why do programmers look for the empty cage when they want it full, that is my question. I can tell you one thing if you want to build an AI slightly resembling human thinking, you probably shouldn't teach it to look for the empty cage.... I hope you understand that.
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-27 02:43 -0800 |
| Message-ID | <f255a85e-da8c-49ef-aae8-d3ba8f03773d@googlegroups.com> |
| In reply to | #32370 |
Den fredag 27 januari 2017 kl. 11:39:24 UTC+1 skrev jonas.t...@gmail.com: > Den fredag 27 januari 2017 kl. 11:35:37 UTC+1 skrev jonas.t...@gmail.com: > > Den fredag 27 januari 2017 kl. 11:17:42 UTC+1 skrev jonas.t...@gmail.com: > > > Den fredag 27 januari 2017 kl. 10:57:26 UTC+1 skrev jonas.t...@gmail.com: > > > > Den fredag 27 januari 2017 kl. 10:33:16 UTC+1 skrev jonas.t...@gmail.com: > > > > > Den fredag 27 januari 2017 kl. 00:06:24 UTC+1 skrev Ben Bacarisse: > > > > > > jonas.thornvall@gmail.com writes: > > > > > > > > > > > > > Den torsdag 26 januari 2017 kl. 22:24:32 UTC+1 skrev jonas.t...@gmail.com: > > > > > > >> Den torsdag 26 januari 2017 kl. 21:29:05 UTC+1 skrev Ben Bacarisse: > > > > > > >> > jonas.thornvall@gmail.com writes: > > > > > > >> > > > > > > > >> > > do until (regular == true && connected == false ) > > > > > > >> > > > > > > > > >> > > I honestly feel a bit lost, because i think they are so easy to code > > > > > > >> > > using do until. > > > > > > >> > > > > > > > >> > What as the initial values of 'regular' and 'connected'? > > > > > > >> > > > > > > > >> > > So how should i think about it? > > > > > > >> > > > > > > > >> > Provided the initial value of the resulting while condition is true you > > > > > > >> > just need to invert it: > > > > > > >> > > > > > > > >> > while (!(regular == true && connected == false)) ... > > > > > > >> > > > > > > > >> > You can use De Morgan's laws to simplify that if you like: > > > > > > >> > > > > > > > >> > !(A && B) <=> !A || !B > > > > > > >> > !(A || B) <=> !A && !B > > > > > > >> > > > > > > > >> > in your case > > > > > > >> > > > > > > > >> > !(regular == true && connected == false) > > > > > > >> > => !(regular == true) || !(connected == false) > > > > > > >> > => regular != true || connected != false > > > > > > >> > > > > > > > >> > which I'd just write as > > > > > > >> > > > > > > > >> > while (!regular || connected) ... > > > > > > >> > > > > > > > >> > Often, the use of do ... until is simply an error (while is needed more > > > > > > >> > often in algorithms than do...until). In those cases there is no need > > > > > > >> > for the loop to execute at least once and you don't need to check that > > > > > > >> > '!regular || connected' is initially true. > > > > > > >> > > > > > > > >> > -- > > > > > > >> > Ben. > > > > > > >> > > > > > > >> Unfortunately they are both false, > > > > > > > > > > > > Why is that unfortunate? If they are both initially false your > > > > > > do...until can be written as a while with the condition negated. > > > > > > > > > > > > <snip> > > > > > > -- > > > > > > Ben. > > > > > > > > > > I feel you dodged the obstacle, i asked if the boolean is generated/searched and found within loop and all values of the truth table can be found, how do you set the start condition, can i set the boolean to "null" at start? > > > > > > > > I slightly remember one can use a switch within side loop and look for the boolean values within loop and set the switch, but does that not defy the purpose of having booleans in the programming language to start with? > > > > > > > > Something either wrong with my way of thinking about it, or there is something wrong with that the boolan value do not have a null configuration. Because i read that in javascript a null setting will return false var x=null, boolean(x) return false? > > > > > > > > Maybe it is wrong from a structural point to look at something that have not been generated yet, but it sure would make things alot easier? > > > > > > Sometimes the coding get convoluted for what i would call no reason at all. > > > Why is programming languages constructed that way, i mean isn't do until clear enough, and why do i need a swithch inside would it be flawed to allow a boolean to be undefined "probably"? > > > > > > But it sure would make coding more straight forvard > > > > > > NAIVE CODING regular=false connected=false found==false > > > > > > if (regbox checked && conbox checked) > > > do until (found==true) > > > generate(); > > > if (regular true && connected true) found true; > > > > > > else if (regbox checked && conbox unchecked) > > > do until (found==true) > > > generate(); > > > if (regular true && connected false) found true; > > > > > > else if (regbox unchecked && conbox checked) > > > do until (found==true) > > > generate(); > > > if (regular false && connected true) found true; > > > > > > else if (regbox unchecked && connected unchecked) > > > do until (found==true) > > > generate(); > > > if (regular false && connected false) found true; > > > > I mean aftarall what is the logic looking for > > while (found==false) or while (found!=true) > > > > compare to > > > > do until(found==true) elegance ;) > > > > For none programmers i can say that probably 99,999 would express the later as more clearly expressed, so why do programmers prefer the former "negated statement", is it an occupational injury of the programming environment? > > > > It would be like trying to trap a bird, and say as long there is no bird in cage i did not trap any, repeatedly. > > > > While ***normal*** people prefer i do this until i trap a bird "yeah i know they have to check in the box but probably they do check if it is a bird there not if the cage is empty. > > > > So why do programmers look for the empty cage when they want it full, that is my question. > > I can tell you one thing if you want to build an AI slightly resembling human thinking, you probably shouldn't teach it to look for the empty cage.... > > I hope you understand that. https://www.youtube.com/watch?v=svVaEWQaoSo
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2017-01-27 11:23 +0000 |
| Message-ID | <87efzozqyq.fsf@bsb.me.uk> |
| In reply to | #32369 |
jonas.thornvall@gmail.com writes: <snip> > I mean aftarall what is the logic looking for > while (found==false) or while (found!=true) > > compare to > > do until(found==true) elegance ;) There are two separate issues here. I some languages the do...until syntax always executes at least once because the test it as the end. This applies equally to the do...while syntax that some languages have. The other issue is why use the word "while" which implies some sort of "negative" condition because the loop operates until the condition is false. But equally it can be seen as a positive condition -- the loop operates provided it is true. One thing is for sure -- it is not fashionable these days to provide both 'while' and 'until' loops these days since most programmers are happy with either form. > For none programmers i can say that probably 99,999 would express the > later as more clearly expressed, so why do programmers prefer the > former "negated statement", is it an occupational injury of the > programming environment? It's natural for you. For other people looping when something is true is more natural. For others (like me) neither is natural. People who hold this sort of string opinion about "natural" constructs often end up writing their own programming language that does everything in the "obvious" and "natural" way, only to find out that no one else wants to use it. <snip> -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Tim Streater <timstreater@greenbee.net> |
|---|---|
| Date | 2017-01-27 12:14 +0000 |
| Message-ID | <270120171214590675%timstreater@greenbee.net> |
| In reply to | #32373 |
In article <87efzozqyq.fsf@bsb.me.uk>, Ben Bacarisse <ben.usenet@bsb.me.uk> wrote: >jonas.thornvall@gmail.com writes: ><snip> >> I mean aftarall what is the logic looking for >> while (found==false) or while (found!=true) >> >> compare to >> >> do until(found==true) elegance ;) > >There are two separate issues here. I some languages the do...until >syntax always executes at least once because the test it as the end. Sometimes you want a loop to execute at least once. Other times you may want it not to be executed at all. -- "If you're not able to ask questions and deal with the answers without feeling that someone has called your intelligence or competence into question, don't ask questions on Usenet where the answers won't be carefully tailored to avoid tripping your hair-trigger insecurities." - D M Procida, UCSM
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-27 08:00 -0800 |
| Message-ID | <0c16b34d-3503-4893-8aaf-95f3059d317d@googlegroups.com> |
| In reply to | #32373 |
Den fredag 27 januari 2017 kl. 12:23:45 UTC+1 skrev Ben Bacarisse: > jonas.thornvall@gmail.com writes: > <snip> > > I mean aftarall what is the logic looking for > > while (found==false) or while (found!=true) > > > > compare to > > > > do until(found==true) elegance ;) > > There are two separate issues here. I some languages the do...until > syntax always executes at least once because the test it as the end. > This applies equally to the do...while syntax that some languages have. > > The other issue is why use the word "while" which implies some sort of > "negative" condition because the loop operates until the condition is > false. But equally it can be seen as a positive condition -- the loop > operates provided it is true. One thing is for sure -- it is not > fashionable these days to provide both 'while' and 'until' loops these > days since most programmers are happy with either form. > > > For none programmers i can say that probably 99,999 would express the > > later as more clearly expressed, so why do programmers prefer the > > former "negated statement", is it an occupational injury of the > > programming environment? > > It's natural for you. For other people looping when something is true > is more natural. For others (like me) neither is natural. > > People who hold this sort of string opinion about "natural" constructs > often end up writing their own programming language that does everything > in the "obvious" and "natural" way, only to find out that no one else > wants to use it. > > <snip> > -- > Ben. Well my answer to that is that the programmer occupation probably do come with a pride of handling negated statements, you could probably call it a nerd vanity mastering something regular people think of as a hassle. Well i am a nerd to but i really do prefer "kiss" before some counterproductive pride and vanity.
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@telus.net> |
|---|---|
| Date | 2017-01-27 09:29 -0800 |
| Message-ID | <oh0n8c59d16300495vm23lmhdntblne4ia@4ax.com> |
| In reply to | #32384 |
On Fri, 27 Jan 2017 08:00:49 -0800 (PST), jonas.thornvall@gmail.com
wrote:
[snip]
>Well my answer to that is that the programmer occupation probably do
come with a pride of handling negated statements, you could probably
call it a nerd vanity mastering something regular people think of as a
hassle.
I have never thought about it. It is the way that it works, and
to use it, I learned it.
>Well i am a nerd to but i really do prefer "kiss" before some counterproductive pride and vanity.
It is simple to us. It is not counterproductive at all. I have
used it very productively as have many programmers.
You do have one thing in common with a lot of us. That is
thinking that your point of view is somehow privileged and therefore
holy. I do not have that to anywhere near the degree that some have,
but I have observed it all too often.
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-27 10:43 -0800 |
| Message-ID | <9584f414-289a-4da5-ae76-ce3078bf72fb@googlegroups.com> |
| In reply to | #32387 |
Den fredag 27 januari 2017 kl. 18:29:56 UTC+1 skrev Gene Wirchenko: > On Fri, 27 Jan 2017 08:00:49 -0800 (PST), jonas.thornvall@gmail.com > wrote: > > [snip] > > >Well my answer to that is that the programmer occupation probably do > come with a pride of handling negated statements, you could probably > call it a nerd vanity mastering something regular people think of as a > hassle. > > I have never thought about it. It is the way that it works, and > to use it, I learned it. > > >Well i am a nerd to but i really do prefer "kiss" before some counterproductive pride and vanity. > > It is simple to us. It is not counterproductive at all. I have > used it very productively as have many programmers. > > You do have one thing in common with a lot of us. That is > thinking that your point of view is somehow privileged and therefore > holy. I do not have that to anywhere near the degree that some have, > but I have observed it all too often. > > Sincerely, > > Gene Wirchenko Well to be quite honest if there is logical statement of more intrisic nature you probably do not want express anything from a juxta position....
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-27 10:44 -0800 |
| Message-ID | <779703ed-80f6-4fc9-ab44-c9763ebf2f01@googlegroups.com> |
| In reply to | #32388 |
Den fredag 27 januari 2017 kl. 19:43:30 UTC+1 skrev jonas.t...@gmail.com: > Den fredag 27 januari 2017 kl. 18:29:56 UTC+1 skrev Gene Wirchenko: > > On Fri, 27 Jan 2017 08:00:49 -0800 (PST), jonas.thornvall@gmail.com > > wrote: > > > > [snip] > > > > >Well my answer to that is that the programmer occupation probably do > > come with a pride of handling negated statements, you could probably > > call it a nerd vanity mastering something regular people think of as a > > hassle. > > > > I have never thought about it. It is the way that it works, and > > to use it, I learned it. > > > > >Well i am a nerd to but i really do prefer "kiss" before some counterproductive pride and vanity. > > > > It is simple to us. It is not counterproductive at all. I have > > used it very productively as have many programmers. > > > > You do have one thing in common with a lot of us. That is > > thinking that your point of view is somehow privileged and therefore > > holy. I do not have that to anywhere near the degree that some have, > > but I have observed it all too often. > > > > Sincerely, > > > > Gene Wirchenko > > Well to be quite honest if there is logical statement of more intrisic nature you probably do not want express anything from a juxta position.... Well i don't think one want express logic from a negated juxta position.
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@telus.net> |
|---|---|
| Date | 2017-01-27 15:46 -0800 |
| Message-ID | <rrmn8c933i4rg7v1d8hmb98gd9vb75mtp3@4ax.com> |
| In reply to | #32389 |
On Fri, 27 Jan 2017 10:44:38 -0800 (PST), jonas.thornvall@gmail.com
wrote:
[snip]
>Well i don't think one want express logic from a negated juxta position.
You might not want to, but some of us have little problem with
it. I have built much nastier expressions. It was what was needed so
I got onto it and did it.
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-27 18:20 -0800 |
| Message-ID | <93284257-2668-4ae4-89ee-3f3a29aa3d95@googlegroups.com> |
| In reply to | #32390 |
Den lördag 28 januari 2017 kl. 00:46:20 UTC+1 skrev Gene Wirchenko: > On Fri, 27 Jan 2017 10:44:38 -0800 (PST), jonas.thornvall@gmail.com > wrote: > > [snip] > > >Well i don't think one want express logic from a negated juxta position. > > You might not want to, but some of us have little problem with > it. I have built much nastier expressions. It was what was needed so > I got onto it and did it. > > Sincerely, > > Gene Wirchenko Well apparently you read what i say you just don't understand it. I say if you would to build a logic language, you probably wouldn't it all exressed as negations. You may feel proud that you can handle them to a certain level, but if i would to give you a real hard logical problem that you could not read up upon, you probably would damn the fucking language not allow you to express yourself in a clear manner. Regareding null having no value. It is evidently a reserved term telling slots empty https://en.wikipedia.org/wiki/Null_pointer https://en.wikipedia.org/wiki/Null_(SQL) It has no value, but the container exist.
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-27 18:34 -0800 |
| Message-ID | <89330f51-0041-4c09-a39f-4b96f0766c5c@googlegroups.com> |
| In reply to | #32395 |
Den lördag 28 januari 2017 kl. 03:20:47 UTC+1 skrev jonas.t...@gmail.com: > Den lördag 28 januari 2017 kl. 00:46:20 UTC+1 skrev Gene Wirchenko: > > On Fri, 27 Jan 2017 10:44:38 -0800 (PST), jonas.thornvall@gmail.com > > wrote: > > > > [snip] > > > > >Well i don't think one want express logic from a negated juxta position. > > > > You might not want to, but some of us have little problem with > > it. I have built much nastier expressions. It was what was needed so > > I got onto it and did it. > > > > Sincerely, > > > > Gene Wirchenko > > Well apparently you read what i say you just don't understand it. I say if you would to build a logic language, you probably wouldn't it all exressed as negations. You may feel proud that you can handle them to a certain level, but if i would to give you a real hard logical problem that you could not read up upon, you probably would damn the fucking language not allow you to express yourself in a clear manner. > > Regareding null having no value. > It is evidently a reserved term telling slots empty > https://en.wikipedia.org/wiki/Null_pointer > https://en.wikipedia.org/wiki/Null_(SQL) > > It has no value, but the container exist. My main point is ***THIS IS PREFERABLE*** NAIVE CODING regular=? connected=? if (regbox checked && conbox checked) do until (regular true && connected true) generate(); else if (regubox checked && conbox unchecked) do until (regular true && connected false) generate(); else if (regbox unchecked && conbox checked) do until (regular false && connected true) generate(); else do until (regular false && connected false) generate(); ***THIS IS CONVOLUTED*** NAIVE CODING regular=false connected=false found==false if (regbox checked && conbox checked) do until (found==true) generate(); if (regular true && connected true) found true; else if (regbox checked && conbox unchecked) do until (found==true) generate(); if (regular true && connected false) found true; else if (regbox unchecked && conbox checked) do until (found==true) generate(); if (regular false && connected true) found true; else do until (found==true) generate(); if (regular false && connected false) found true; ================================================= I mean aftarall ***what is the logic looking for while (found==false) or while (found!=true) compare to do until(found==true) elegance() ;) For none programmers i can say that probably 99,999 would express the later as more clearly expressed, so why do programmers prefer the former "negated statement", is it an occupational injury of the programming environment? It would be like trying to trap a bird, and say as long there is no bird in cage i did not trap any, repeatedly. While ***normal*** people prefer i do this until i trap a bird "yeah i know they have to check in the box but probably they do check if it is a bird there not if the cage is empty. So why do programmers look for the empty cage when they want it full, that is my question. ========================================= I state that the case is to be about anal vanity feeling proud doing it in the most convoluted way possible.
[toc] | [prev] | [next] | [standalone]
Page 1 of 3 [1] 2 3 Next page →
Back to top | Article view | comp.lang.javascript
csiph-web