Live data from Hacker News

You can't do that because I hate you

bvisness.me

61–70 of 216 posts

Re: You can't do that because I hate you

#61
I empathize with a lot of this. With experience and knowledge it's easy to recognize why and how these things happen, to point them out, and to call the author wrong. But I also remember being new to tools and not understanding how arbitrary they seem to be, in that they can understand what I want to do with uncanny precision but simultaneously refuse to do it. Things like exiting vim are the gold standard of this.[1]

But:

> Either support the feature, guide the user toward a better solution, or do nothing.

The first two examples _explicitly_ guide the user toward better solutions. That's much more than many tools do. If the Python repl behavior isn't "guide the user toward a better solution" in both letter and spirit, I'd love to know why.

There are much lower-hanging fruit than these examples, which makes a good point harder to agree with.

1: One of the first-page Google results for me on quitting vim is somehow this HN comment thread from 2017, in which the Python repl behavior catches strays with almost identical arguments as this article. https://news.ycombinator.com/item?id=14403297

Re: You can't do that because I hate you

#62
>Exiting Python

In early versions of COBOL exit was frequently used to go out of loops and out of sections and so on. Maybe a message is nice for someone still trying that while learning modern stuff, but I admit it’s farfetched/unlikely.

Re: You can't do that because I hate you

#64
post #10

Such a weird rant. Yes, some tools do some things, but not others. Making tools do everything for everyone just bloats them to unmaintainable messes. And it’s a special kind of entitlement to believe that the way _I_ imagine things must be working is the only possible correct interpretation. Reality is messy, there are trade-offs, and a lot of smart people think very hard about what the correct trade-offs should be g…

> Reality is messy, there are trade-offs, and a lot of smart people think very hard about what the correct trade-offs should be given a particular situation.

This is great and all, but misses the point. If you have made a decision to cut a feature then at least explain why. This then circumvents the 'why don’t you just' mentality. That is the root of the issue in the examples provided. It would be trivial to drop a warning about the comments not being formatted and include a link to the issue. Then there is no question of 'why' and thus you're now heading off the 'It is a completely trivial feature!' attitude, and blog posts complaining about it. Communicate clearly.

Re: You can't do that because I hate you

#65
post #32

Do what I mean, not what I said can be problematic for tools. That being said, the example where the devs left a link to file an issue to beg to restore functionality was maddening.

Agreed, but in that case the tool shouldn't be trying to detect what I mean. Why look for 'exit' only so you can print 'no actually, it's exit() dummy'. If you're parsing for it then just bloody do it! Otherwise I'll get a syntax error and realise that 'exit' isn't the right way to exit. And I'll do a quick search myself. But explicitly looking for and detecting my intention and then ignoring it is just dumb.

Perhaps a variable `exit = True` or something was defined previously, you don't want to have the language or REPL handle a myriad of possible corner cases, that would be very brittle. But a printing warning or lint-like suggestion is ok and actually useful.

Re: You can't do that because I hate you

#66
post #3

First example seems odd? The author acknowledges that the two proposed alternatives (printing " " or actually exiting) aren't great. The fact that the Python REPL provides a helpful hint seems like extra effort to make your life easier. This is especially notable given that in the next example, the author's complaint is about a command _not_ providing special guidance about the thing the user is probably trying to do…

I'd have done both the hint and the actual result. Like this: >>> print >>> exit Hint: Use exit() or Ctrl-D (i.e. EOF) to exit >>> This way, it does do the thing you literally asked for, but also does help a newbie out.

But really it should just exit. There's really no reason why it shouldn't.

I think telnet does something stupid along the same lines "I know you want to quit but please ask address me as Sir first".

Re: You can't do that because I hate you

#67
post #3

First example seems odd? The author acknowledges that the two proposed alternatives (printing " " or actually exiting) aren't great. The fact that the Python REPL provides a helpful hint seems like extra effort to make your life easier. This is especially notable given that in the next example, the author's complaint is about a command _not_ providing special guidance about the thing the user is probably trying to do…

Yeah, and it’s also useful to teach newbies about the usual syntax for doing things rather than introducing special-case magic. It would be _weird_ to just quit after writing a bare “exit”.

ipython intentionally diverges from the regular python REPL. It just quits like you expect without crying about it.

Re: You can't do that because I hate you

#68
post #18
post #6

the trouble with "do what I mean" is that if the software guesses, and guesses wrong, the results are far worse than just not doing it. an "if you really meant to do this here is the correct incantation" error message seems like the best possible thing to do.

The problem with this argument is the low hanging fruit. EXIT is pretty unambiguous. I HATE that some tools the help argument is -? and others use --? when everyone COULD just print help on both is maddening, especially when you use the "wrong" one and it just says "do the other for help". You KNEW what I wanted, and didn't do it, just like the article says. Yes, mindreading is tricky, but sometimes you don't need to…

exit() is unambiguous, syntactically and semantically.

exit is unambiguously broken syntax, it doesn't fit into what the REPL promises, it's an error.

newbies to unix need to learn about Ctrl-D, and it should be taught. But it should not be the job of every tool to teach that lesson, it's one step removed from QWERTY. There are actually apps that break Ctrl-D and they are another abomination in the direction of newbie hand holding.

Re: You can't do that because I hate you

#69
post #64
post #10

Such a weird rant. Yes, some tools do some things, but not others. Making tools do everything for everyone just bloats them to unmaintainable messes. And it’s a special kind of entitlement to believe that the way _I_ imagine things must be working is the only possible correct interpretation. Reality is messy, there are trade-offs, and a lot of smart people think very hard about what the correct trade-offs should be g…

> Reality is messy, there are trade-offs, and a lot of smart people think very hard about what the correct trade-offs should be given a particular situation. This is great and all, but misses the point. If you have made a decision to cut a feature then at least explain why. This then circumvents the 'why don’t you just' mentality. That is the root of the issue in the examples provided. It would be trivial to drop a w…

The very first example in the article discredits efforts to add clear communication.

Re: You can't do that because I hate you

#70
> But it does neither. It acknowledges your intent and refuses it. It’s saying “I know exactly what you want to do, but you’re doing it wrong. Do it right next time.”

Programming languages follow rules and programmers should follow the rules. Just because mistake is common doesn’t mean the language should incorporate it into its functioning. That makes inconsistent behavior and is a pain in the long run because instead of learning and following logic, programmers have to guess what’s a common enough error that the language compensates. And over time the language drifts and is hard to work with.

It seems easier to me to just suck it up and learn the right way to do things in a language.

Post reply on HN