Nerdsniping: A glimpse into a stubborn mind
blog.andyet.com
Nerdsniping: A glimpse into a stubborn mind
1–10 of 94 posts
Re: Nerdsniping: A glimpse into a stubborn mind
#2Couldn't you simply do this?:
if ((a==='80'||b==='443') && http===false) { ... }
Re: Nerdsniping: A glimpse into a stubborn mind
#3Not to say you are just like him etc. but this post reminded me of him because it was probably exactly what he would do.
Re: Nerdsniping: A glimpse into a stubborn mind
#4You probably haven't. But a less experienced programmer has learned why you should always use ===.
Re: Nerdsniping: A glimpse into a stubborn mind
#5Here, the antagonist says that b can't be 1 and 2 at the same time, which would be self-evident in mathematical algebra, but turns out to be quite irrelevant to Javascript and to programming paradigms generally (since two statements will never be checked simultaneously).
This difference in how syntax is understood actually presents a barrier to programming for modestly trained mathematicians, who would otherwise be expected to excel.
Re: Nerdsniping: A glimpse into a stubborn mind
#6"I want my code to execute if port is 80 or 443, and http is false" Couldn't you simply do this?: if ((a==='80'||b==='443') && http===false) { ... }
if (a==='80' || (b==='443'&&http===false)) {...}
Re: Nerdsniping: A glimpse into a stubborn mind
#7The differences between programming syntax and elementary/Boolean algebra are very awkward to understand clearly and deal with correctly. We clearly understand mathematical algebra to work one way, and we naturally assume programming algebra works the same way, which it doesn't at all. Here, the antagonist says that b can't be 1 and 2 at the same time, which would be self-evident in mathematical algebra, but turns ou…
Although this is true in general that syntax can be a barrier to entry, the article provides a particularly poor example. If anything, the article demonstrates how mathematical training is good preparation for many pitfalls of programming.
Mathematicians are used to working with various equivalence relations, even in the same context. So if a modestly trained mathematician saw == and ===, she would immediately ask "what is the difference between these two ER's?".
And then when she finds out the essential difference is that you can override ==, it would be clear that all bets are off.
I can't imagine any mathematician taking more than a few minutes and a google search -- let alone 11 days -- to figure out this loophole.
Re: Nerdsniping: A glimpse into a stubborn mind
#8You're comparing a literal number with an object, which are not the same type.
2 === new Number(2)
// => false
2 == new Number(2)
// => trueRe: Nerdsniping: A glimpse into a stubborn mind
#9> : a 2 ;
> : 2 3 ;
> a 2 =
> a 3 =
The two flags on the top of the stack are now equal.
Re: Nerdsniping: A glimpse into a stubborn mind
#10The differences between programming syntax and elementary/Boolean algebra are very awkward to understand clearly and deal with correctly. We clearly understand mathematical algebra to work one way, and we naturally assume programming algebra works the same way, which it doesn't at all. Here, the antagonist says that b can't be 1 and 2 at the same time, which would be self-evident in mathematical algebra, but turns ou…
This isn't really a problem if b is enforced to be immutable.