Live data from Hacker News

Nerdsniping: A glimpse into a stubborn mind

blog.andyet.com

81–90 of 94 posts

Re: Nerdsniping: A glimpse into a stubborn mind

#81

And this is why Javascript can be such an awful language. Leaving off a single equals has such a profound effect, often without a new coder even realizing it while reading the code. Imagine what happens to your code when someone tries to write a function for its side effects similar to the example seen in the blog post. Then releases it in production for it to break in six months with a feature change.

>"And this is why Javascript can be such an awful language." To be fair, this is breaking Javascript and that is something you could do in other languages, for instance here is a similar version for C++: http://pastebin.com/seySfpku

Now do it in Haskell.

Re: Nerdsniping: A glimpse into a stubborn mind

#83
post #20

Earlier quoted context omitted.

Wasting other people's time is a negative, but deepening your understanding of a topic by examining edge cases is generally worthwhile, IMHO.

I think he's referring to some people's inability to balance technical issues and product commitments (deadlines). Focusing solely on the means and disregarding the ends is a good way to not deliver anything useful. Most times, things need to be good enough, not technically perfect...

> Most times, things need to be good enough, not technically perfect...

This sentence means almost literally nothing, given how varied both "good enough" and "technically perfect" definitions are for each developer.

Re: Nerdsniping: A glimpse into a stubborn mind

#84
This kind of abuse is also available in Python!

    In [3]:
    class TheObjectThatIsEqualToAnything(object):
        def __eq__(self, other):
            return True

    In [4]:
    x = TheObjectThatIsEqualToAnything()

    In [6]:
    x == 3 and x == 5
    Out [6]:
    True

Re: Nerdsniping: A glimpse into a stubborn mind

#87
post #5

The 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…

Umm , you missed a key point here. The first comparison is == while the second one is ===. These 2 are different. The == checks equivalent. Mathematically speaking he should have used === in both places.

These things are more of quirks of javascript than anything else. The post did nothing but made me hate javascript. Try doing the same in Java !

Re: Nerdsniping: A glimpse into a stubborn mind

#88
post #35
post #20

Earlier quoted context omitted.

Wasting other people's time is a negative, but deepening your understanding of a topic by examining edge cases is generally worthwhile, IMHO.

Is it really fair to call poor code an edge case? If not for the double-equals typo, which most code reviews would fix, this wouldn't work. I'm more interested that this team has conversations where person A asks a really simple question that should be able to be tested in 11 seconds, person B gives a patently false answer that mistakes && for ||, which is the very thing person A is asking about. Meanwhile person C g…

I don't know if the last bit was added later, but he did find a solution which would work without using ==

Re: Nerdsniping: A glimpse into a stubborn mind

#89
post #51
post #50

Earlier quoted context omitted.

In Obj-C you can if you would allow `a.prop == b.prop`.

Sure, but then it's obvious that you're doing something beyond an equality comparison.

Do you mean it is obvious to people who know objective C? I've never used the language, but its not obvious to me just from the other c-family languages I know.

Re: Nerdsniping: A glimpse into a stubborn mind

#90

Earlier quoted context omitted.

> And this is why Javascript can be such an awful language. Leaving off a single equals has such a profound effect, often without a new coder even realizing it while reading the code. You get used to this as you get seasoned with javascript. Every language has it's quirks. The human brain is remarkably adaptable to using tools & dealing with intricacies. I personally utilize & appreciate the difference between == and…

>> I also find automated testing, logging, a module system like commonjs, and linters to be useful when programming in javascript Except when I use JSLint. Talk about bringing you back to Earth when you think you've done something remarkable with JS.

Try JSHint instead. It catches actual problems and everything else is customisable, so you're not forced to change your coding style to fall in line with the whims of a stubborn author.
Post reply on HN