Live data from Hacker News

Become Shell Literate

drewdevault.com

321–330 of 341 posts

Re: Become Shell Literate

#321
post #211

Earlier quoted context omitted.

>The Linux man pages are upside down. Examples don't come till the very end, if at all. You only learn the tool once. Every subsequent time you visit the man page, the information you're probably looking for is frontloaded. Just scroll to the bottom if you want examples?

> You only learn the tool once. Every subsequent time you visit the man page, the information you're probably looking for is frontloaded. Just scroll to the bottom if you want examples? This is false for most tools we don't use daily. It's false even for tools we do use daily, in some cases (I have to google git commands every month or so for commands I use rarely). Most people are and remain perpetual intermediates:…

I bristled just now at the opportunity to have my first strong disagreement with Mr. Spolsky. Then I read the article you linked. I don’t think it means what you think it means. He’s talking about users of the software, not developers. And I know, I know, developers are users of software too, perhaps more than the average user. But then he links to this article about homo logicus [0] in which he begins:

> Of all the professional hubris I've observed in software developers, perhaps the greatest sin of all is that we consider ourselves typical users.

> We are experts. Who could possibly design software better than us superusers? What most developers don't realize is how freakishly outside the norm we are. We're not even remotely average-- we are the edge conditions.

Honestly, if you’re a hobbyist or moonlight as a FOSS contributor, fine, nbd. But if I found out an alleged professional working for me writing software was content to never figure something out like a git branch issue in the short term and grow over the long term in their total skillsets, I’d want them gone.

I wouldn’t want a lazy, mediocre carpenter to build my house either. I’m perfectly content to let them build a ramshackle residence for themself where nobody has to suffer because of it.

[0]: https://blog.codinghorror.com/the-rise-and-fall-of-homo-logi...

Re: Become Shell Literate

#322
post #211

Earlier quoted context omitted.

> You only learn the tool once. Every subsequent time you visit the man page, the information you're probably looking for is frontloaded. Just scroll to the bottom if you want examples? This is false for most tools we don't use daily. It's false even for tools we do use daily, in some cases (I have to google git commands every month or so for commands I use rarely). Most people are and remain perpetual intermediates:…

I bristled just now at the opportunity to have my first strong disagreement with Mr. Spolsky. Then I read the article you linked. I don’t think it means what you think it means. He’s talking about users of the software, not developers. And I know, I know, developers are users of software too, perhaps more than the average user. But then he links to this article about homo logicus [0] in which he begins: > Of all the…

[deleted]

Re: Become Shell Literate

#323
post #153

Earlier quoted context omitted.

On top of that, his opening example is so easy if you use a GUI for Git it's mind-boggling. It'd literally be click status column to sort, click top entry, shift-click bottom deleted file, right-click, restore. Done, a couple of seconds without even thinking about it. And somehow this simple task in a GUI inspired a blog post about how useful the shell is. I'm not going to deny a shell is extremely useful, and knowin…

The point of the article clearly is about how a few general purpose shell tools can combine together to be the "right" tool in so many different usecases for which they weren't specifically designed for. You can argue for more specialized tool, and that's okay. But saying just "this" task inspired this blog post clearly misses the point of the article, which is generality. In any case there are like a bazillion of GU…

And there are a bazillion CLI tools, you can't use that defence.

Re: Become Shell Literate

#324

Earlier quoted context omitted.

On top of that, his opening example is so easy if you use a GUI for Git it's mind-boggling. It'd literally be click status column to sort, click top entry, shift-click bottom deleted file, right-click, restore. Done, a couple of seconds without even thinking about it. And somehow this simple task in a GUI inspired a blog post about how useful the shell is. I'm not going to deny a shell is extremely useful, and knowin…

Now do it across 5 projects. Or help explain to all your teammates how to do it. With the shell, the second time you do it is a few keystrokes, if even. Wanna do it across multiple projects, it’s super easy without ever loading any of them in your IDE. Wanna share it with teammates, you simply need to pass a script file to them, and they can do it without having to do anything. And now finally if you need to incorpor…

a) It's not a common task

b) a few keystrokes === a few clicks

Re: Become Shell Literate

#325

Earlier quoted context omitted.

On top of that, his opening example is so easy if you use a GUI for Git it's mind-boggling. It'd literally be click status column to sort, click top entry, shift-click bottom deleted file, right-click, restore. Done, a couple of seconds without even thinking about it. And somehow this simple task in a GUI inspired a blog post about how useful the shell is. I'm not going to deny a shell is extremely useful, and knowin…

That relies on there being a sufficiently versatile gui which isn’t guaranteed. Here’s some features that your example requires which I often don’t see in guis: 1. Tables you can sort 2. Tables you can sort on the thing you actually care about 3. Being able to select multiple entries and act on your selection It’s not too hard to imagine criteria which could make the problem much harder for a gui, e.g. only doing the…

It might not be hard to imagine it, but it's not actually that common an occurrence.

When's the last time you accidentally delete 200 files and needed to restore them? Probably because you were using a shell...

Oh yeah, and if you accidentally delete folder in a GUI? Usually you can just press ctrl-z, undo!

Re: Become Shell Literate

#326

Earlier quoted context omitted.

> People like to pretend that learning shell commands is somehow better because it's more portable, No, it's better because if you aren't doing exactly the workflow an IDE or GUI tool designer has envisioned, it is almost invariably much easier to do it in shell (and then make it a script and then bind it to a command in your IDE or GUI tool, if they support that) than to beat the non-shell tool into, first, doing wh…

I use IDE mainly for code editing and exploration (e.g. jump from usage to definition), for which I can't see how shell is easier. Modern IDEs have shell built-in so when I finish coding, I can just open up a terminal inside IDE to run shell scripts. Effectively I'm getting the best of both worlds. I never knew that I have to follow some sort of rails laid by IDE designers, which I think it's a very common misconcept…

> Modern IDEs have shell built-in so when I finish coding, I can just open up a terminal inside IDE to run shell scripts

Sure. In GP I talk about the value of knowing the shell when you use an IDE, not the value of knowing shell instead of using an IDE. To get “the best of both worlds”, you have to know how to use the shell.

> I never knew that I have to follow some sort of rails laid by IDE designers

You don't, if you know how to use the shell. Whether the shell is integrated or external to the IDE is a side issue.

Re: Become Shell Literate

#327

Earlier quoted context omitted.

macOS tools generally do not match what Stack Overflow tells you.

Ah, yes - I have come across some differences in command-line flags and default behaviors between macOS and the nominally equivalent tools as implemented in Linux or specified by Posix, and sometimes, on Stack Overflow, you will find people answering Mac-specific questions on the Dunning-Krugeresque assumption that it is the same as the others. In general, one should always verify Stack Overflow answers before using,…

> I wonder if some of the differences between MacOS and Linux comes from the former's origins in Mach/BSD via Nextstep.

My understanding was that this is most of it. The problem is relatively basic—macOS uses the BSD versions of most unix tools, which means basic commands like sed sometimes function quite differently!

Re: Become Shell Literate

#328

Earlier quoted context omitted.

You're right. I often think the man page should begin with a few examples, then launch into the neverending list of options. That is no way to learn. In foreign language 101, they start you off with a small group of examples. "Como estas?" "Muy bien. Y tu?" Afterward, they explain the rules of the language (this is a noun, this is a verb, this is how you conjugate for first-person singular, etc.). In fact, this is ho…

> The Linux man pages are upside down. Examples don't come till the very end, if at all. man pages are meant to be a full reference, not a quick tutorial. To get the quick tutorial others have already mentioned cheat.sh [1] and tldr pages [2] is another good resource. [1]: https://cheat.sh/ [2]: https://tldr.sh/

Big +1 for tldr from me. And the commands are effectively a wiki (or maybe it's stored in git). Anyway you can contribute to them.

Re: Become Shell Literate

#329

I can just never get past the arg/flag inconsistency/complexity across commands. Perhaps if the docs started with a simple example of what has been seen over time to be the most common incantation for each command it might be tolerable. But as it is, I spend more time dealing with idiosyncracies of a command than I do expressively piping stuff. Perhaps if Rust had five mutually incompatible borrow-checkers which get…

It's even worse when you bounce between Linux, FreeBSD, and MacOS.

Re: Become Shell Literate

#330

I used to think this way as well, but out of necessity, had to work specifically with a commercial IDE for some time. Turns out, if you are confident learning the keybindings of a robust IDE is worthwhile (e.g. you know that you must use it for some particular project for a decent amount of time) the investment pays off just as well as learning shell commands. A good IDE can do everything a cobbled together shell pip…

"People like to pretend that learning shell commands is somehow better because it's more portable, but unless your work entails working across multiple machines and environments daily, it doesn't matter." It is more portable. No pretending is necessary. It's true. I run multiple computers with different resource constraints and operating systems. I neither have the patience nor the time (not to mention the system req…

OP didn't say it wasn't more portable--just that it being more portable doesn't always mean it's better. Sounds like for your use case, portability is very important and trumps the benefits of an IDE. That might not be true for someone who doesn't, say, run multiple computers.
Post reply on HN