5 ms·
Original author here. Yes, it's great to learn Ctrl + D. But losing out on beginners that aren't familiar in favor of things that are naturally intuitive is a
by craigkerstiens 8y ago
Original author here.
Yes, it's great to learn Ctrl + D.
But losing out on beginners that aren't familiar in favor of things that are naturally intuitive is a great way to make those who are new to programming and especially databases feel like they're dumb or not capable of it. I still recall the first time I was in vi and I couldn't figure out how to get out of the damn thing, and don't get me started on arrow keys. There are a lot of ways to help others learn things like Ctrl + D, an even better experience might be a 1 second delay with a message informing them of other ways.
We could bikeshed all day on which is the more pristine way to exit a program, paint the shed whatever color you want, being intuitive for beginners is never a bad thing.
- Jedd 8y agoYou use the word intuitive a couple of times, and suggest there's a natural way to exit interactive cli programs (and it's not ctrl-d). Yet for me, ctrl-d is my usual first way of trying to exit any shell or cli utility. Whether it's natural or not, I couldn't say. Arguably the nipple is the first and only intuitive interface, everything after that is learned. After many years on my/maria I find the backslash shortcuts very counterintuitive to 'show databases | tables' etc. While I think it's great to have both options present, I don't think the demographic of people who work out they want an rdbms, evaluate and select postgresql, work out how to install server and client components, su to the postgres user, and are then likely to abandon in frustration as they can't determine how to exit the cli, is negligible.
- craigkerstiens 8y agoThe background of what you learned on is key to whats intuitive or natural. If you came up on an unix based system then yes you'd expect this. If you learned databases via MySQL then you'd expect show database to work. Today though many more are coming to development without an academic or linux background. If you install Postgres via Postgres.app there is a chance you're not at all familiar with a commandline. What is intuitive... yes it's relative to your background. I very much hope that the number quit or exit is intuitive for, those that don't come from a linux or academic background, grows of time. This does become a more valuable tool the more beginners there are, and personally from working with a lot of beginners already suspect it's more valuable than many realize.
- tormeh 8y agoMost CLIs can be exited with "quit" or "exit". Many trap Ctrl-C, so those two are the first things I try. Didn't know about Ctrl-D before now, and I've worked as a sysadm.
- Jedd 8y ago> The background of what you learned on is key to whats intuitive or natural. That's pretty much the summary of my post. > If you install Postgres via Postgres.app ... I had to go lookup what postgres.app actually is -- evidently it's an easy way for Mac users to install postgres. I don't have a Mac -- which is also true for most people -- so I can't speak to the average mac user's experience or expectations. As I have (had to repeatedly) say a few times now, I think it's great that multiple options to end the program are available. I'd imagine for Mac users the 'most intuitive' thing would be to find some magic symbol on their keyboard and combine it with the letter Q.
- solarengineer 8y agoMac users either don't stop the service at all, or they use the GUI to do so (if they installed via the postgres.app tool)
- freeopinion 8y agoCTRL+D works. You like it. Great use that. You don't think anybody needs an alternative? Or you don't think having an alternative will help at all? Fine. Think what you want. One thing's for (mostly) certain: it doesn't hurt. So there's really nothing to complain about.
- Jedd 8y ago> CTRL+D works. You like it. Great use that. You don't think anybody needs an alternative? Or you don't think having an alternative will help at all? Fine. Think what you want. One thing's for (mostly) certain: it doesn't hurt. So there's really nothing to complain about. Not complaining about its presence, as per my comment : "While I think it's great to have both options present,..." Just observing that claims of 'more intuitive' interfaces are very subjective, and that it was unlikely to be a deal breaker for a new user.
- sverhagen 8y agoYou don't think it's intuitive for a command line application that is entirely driven by commands, there to be a command to exit it? Instead of a key combination? I'm used to Ctrl+D now, but it sure took me a while to figure it out. Are we not confusing intuitive with standardized?
- Jedd 8y agoI can't say if anyone else is confusing intuitive with standardised. I can repeat (again) that I think it's great both options are there. Given pretty much all the other 'standard' postgres commands are \[a-z] and sometimes \[a-z][a-z] it sounds like more a complaint about \q
- cuboidGoat 8y ago"You use the word intuitive a couple of times, and suggest there's a natural way to exit interactive cli programs (and it's not ctrl-d)." Surely it is when you detect the angry mashing of keys? There should really be a function for that in the standard library. Distinguishing such inputs from the actions of cats would be the difficult bit.
- walterstucco 8y agoAnd yet CTRL+D does not take you out from an Erlang console...
- wink 8y agoI find it highly unintuitive that ctrl-d only works on an empty line. So despite the fact I've known it for years (decaded at this point?) I still regularly want to exit mid-typed line. And no, it doesn't matter why this is a good thing or not - I'm just saying even if you've known it for years it's still not intuitive that an "end of a file" has to be on a new line.
- davidw 8y agoI'm reminded of this bit, from https://www.gnu.org/fun/jokes/ed-msg.html https://www.gnu.org/fun/jokes/ed-msg.html Let's look at a typical novice's session with the mighty ed: golem$ ed ? help ? ? ? quit ? exit ? bye ? hello? ? eat flaming death ? ^C ? ^C ? ^D ? --- Note the consistent user interface and error reportage. Ed is generous enough to flag errors, yet prudent enough not to overwhelm the novice with verbosity.
- tormeh 8y agoI think I did something like this with vim when I first encountered it. Now I like the damn thing (but still prefer VS Code).
- user5994461 8y agoThe intuitive way to exit anything is Alt + F4.
- yawboakye 8y ago> But losing out on beginners that aren't familiar in favor of things that are naturally intuitive is a great way to make those who are new to programming and especially databases feel like they're dumb or not capable of it. I disagree with you here, Craig. In my experience I reach for Ctrl + D, Ctrl + C in quick succession to see what succeeds. I've learnt those and it works for most programs that don't trap exits (again, why would you trap exit?). It has saved me from learning how to exit interactive terminals for python, ruby, node, PostgreSQL (psql) without learning their specific instruction. I like that and I'd prefer to have one way of exiting programs that works on all programs on the system than learn what's any programs preferred command.
- SSLy 8y ago>why would you trap exit? flush buffers, gracefully close sockets, print the final \LF to the stdout.
- MaxBarraclough 8y ago> I like that and I'd prefer to have one way of exiting programs that works on all programs on the system than learn what's any programs preferred command. I bet you love Vim ;-P
- eip 8y ago> Ctrl+D > things that are naturally intuitive Pick one