Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.javascript Subject: Re: How would you prepare for javascripting interview? Date: Mon, 12 Sep 2016 21:06:22 +0100 Organization: A noiseless patient Spider Lines: 41 Message-ID: <87d1k8sx1d.fsf@bsb.me.uk> References: <50e38667-93da-4c5d-bc02-a78394f0ca3b@googlegroups.com> <1875389.irdbgypaU6@PointedEars.de> <9cstsb1uddjiltlflrdiks2ha2u3msi1ao@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="12781"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Lfvc42U7TcUqwGhXZzpKb3ml7R6ZkdG8=" Cancel-Lock: sha1:MANxwAOJ4uAh7etvqgBDZY2dm0E= sha1:0RZRZwMfmyEWyTYaQKFIakoO2lM= X-BSB-Auth: 1.98cae6dfd38d1eda0941.20160912210622BST.87d1k8sx1d.fsf@bsb.me.uk Xref: csiph.com comp.lang.javascript:31346 Doc O'Leary writes: > For your reference, records indicate that > Scott Sauyet wrote: > >> Doc O'Leary wrote: >> > >> > People need to stop making this mistaken argument. This has nothing >> > to do with the mathematical sets. It has to do with a function in a >> > library of computer code. >> >> Sorry, I should have used "list" here rather than "set". > > I was taking issue with your whole argument, not the questionable > equivalence of sets/lists/arrays. > >> I was simply pointing out that if `max([]); //=> NaN`, >> then we get some awkward behavior, a violation of the law I was proposing. > > I know. Stop proposing that law, because the topic at hand is > computer science, not pure mathematics. I think you've got it backwards. It's relatively rare for mathematicians to define max of nothing. I did not find any, in fact, (though I am sure there must be some), and had to hunt quite hard to find a math text that defined sup {} to be -oo and inf {} = oo, but that's both rare and not quite the same thing to a mathematician. It's computer scientists who've generalised max to empty lists. They do it for practical reasons. I don't know why you are determined to reject the idea that a CS person would want their library functions to follow simple laws. It helps write correct programs. > “For every problem there is a solution which is simple, clean and wrong.” > Henry Louis Mencken Which leaves open the possibility of a simple, clean and correct solution. Maybe this is one of those problems? -- Ben.