News for hackers. Stuff that matters.
Re:Become Shell Literate by voidhorse on Saturday December 12, 2020 @09:01PM (#25403649)
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 pipeline can, often in two keystrokes instead of N trial and error command inputs because you forgot, yet again that, e.g. while `grep` takes a pattern argument before a path, `find` does the opposite--in spite of POSIX there's an incredible lack of UX standardization when it comes to unix tooling.

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. Most of us do most of our work on one machine, in one environment, so at the end of the day, it really comes down to preference. Personally, I do prefer working in the shell, but if you prefer working in a modern IDE, don't let anyone fool you that you're somehow wasting time or being less proficient than you could be in a shell--if you took the time to learn the IDE keybindings and the IDE is on par with anything Jetbrains puts out, you're not losing in efficiency at all and possibly making gains when it comes to certain tasks.

Re:Become Shell Literate by dragonwriter on Saturday December 12, 2020 @09:09PM (#25403692)
> 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 what you want, and then making it easily repeatable.

It's also more portable, which, contrary to your description, is very useful for most people, because even if there are some dev-only tasks that “I can only do it in the IDE” is fine for, for many things you may also want to do in a CI pipeline, on a deployment box, or other places where your IDE isn't running. Shell scripts generally work there.

Re:Become Shell Literate by tracyhenry on Saturday December 12, 2020 @11:27PM (#25404305)
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 misconception by people who dislike IDEs.

Re:Become Shell Literate by pjmlp on Sunday December 13, 2020 @03:20AM (#25405124)
Shells inside IDEs are an idea that goes back to Xerox PARC workstations, the UNIX folks just have an hard time grasping that in spite of urban myths, there aren't other ways to achieve the same.

Even better, because IDE integrated shells are many cases graphical REPLs with additional interaction capabilities and graphical abilities.

As for the travel into memory lane, here out of 1977,

https://en.wikipedia.org/wiki/Xerox_Development_Environment

You can have a nice view how it worked, by following the Wikipedia links, or checking the presentation on Mesa/Cedar, which was the evolution of XDE as Mesa evolved into Cedar, and one of the latest version of XDE as well.

"Emulating a Xerox Star (8010) Information System Running the Xerox Development Environment (XDE) 5.0"

https://www.youtube.com/watch?v=HP4hRUEIuxo

"Eric Bier Demonstrates Cedar"

https://www.youtube.com/watch?v=z_dt7NG38V4

And naturally Smalltalk-80 and Interlisp-D enviroments that precedded it,

"Emulating Smalltalk-80 DV6 on a Xerox 1186 (6085 Daybreak Development Kit)"

https://www.youtube.com/watch?v=dpjRZnUw8MU

"The Interlisp Programming Environment", 1981

http://larry.masinter.net/interlisp-ieee.pdf

The lack of teaching of the computing world outside Bell Labs leads to a UNIX cult, unaware of the progress that was actually already available in the 70 and 80's, but unfortunely failed to pick up due to several reasons, so in the end there is this idolatration of the UNIX shell.

Re:Become Shell Literate by dragonwriter on Sunday December 13, 2020 @07:56PM (#25412139)
> 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 by filmgirlcw on Sunday December 13, 2020 @01:08AM (#25404661)
You missed the point that it’s about user preference. The shell works better for you, that’s great.

My setup is specifically crafted between my text editor (that has a terminal that I use all the time) and a few GUI tools that I’ve got customized and scripted. I like a mix of shell and GUI. That’s my preference.

You’re right that it isn’t as portable as my dot files repo (and I have one of those too), but I do actually have it set so I can quickly restore the whole config on a Mac and restore the text editor portion from Windows, or really any machine with a web browser.

If you are constantly using different machines on the regular, yeah, being good at shell commands makes sense. But it still comes down to personal preference and people who like other methods aren’t inferior.

Re:Become Shell Literate by 1vuio0pswjnm7 on Saturday December 12, 2020 @10:33PM (#25404083)
"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 requirements) to install an IDE on all of them. However each one has an OS that comes with a POSIX-like shell, e.g., NetBSD's sh, FreeBSD's sh, OpenBSD's sh and Linux's sh, which is derived from NetBSD's sh.

The author of this blog post begins his demonstration of shell wizardry with the "history" command. This command does not exist in POSIX sh. On NetBSD I use "fc -l 0". Go figure, it is more portable (nevermind fewer keystrokes). The scripts I write in NetBSD sh run on FreeBSD, OpenBSD, Linux, and a number of other OS without any modification. I do not have learn multiple shells to do work. On BSD, I also use the POSIX-like scripting shell (sh) as the interactive shell.

The best part is I do not have to install anything, it has already been included, no worries about system requirements. All these OS require a POSIX-like sh. None of them require an IDE.

Re:Become Shell Literate by lswainemoore on Monday December 14, 2020 @03:45AM (#25414809)
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.
Re:Become Shell Literate by scarecrowbob on Saturday December 12, 2020 @09:27PM (#25403783)
"Personally, I do prefer working in the shell, but if you prefer working in a modern IDE, don't let anyone fool you that you're somehow wasting time or being less proficient than you could be in a shell"

I totally agree with that sentiment.

"[...] unless your work entails working across multiple machines and environments daily"

That situation might be a lot more likely than you'd think. I started out doing WordPress, and that's still what mostly what makes me money.

But now that I am using 30-40 different machines that host 3-400 sites, each with their own installs, and knowing how to do stuff efficiently with the shell is super useful.

To me, that situation feels kinda unlikely, but at the same time dang it's nice to just ssh into a machine and know what I'm doing.

I have coworkers and clients who just can't do certain kinds of tasks or troubleshoot stuff with certain kinds of tools because they just don't have the CLI knowledge.

So while I generally agree with your post, I will offer an alternate idea to balance it: if folks are thinking that learning how to use a shell is a waste of time because they can do everything in a GUI, if they took the time to learn the shell at a a level of most of the things they use every day in an IDE, they are "not losing in efficiency at all and possibly making gains when it comes to certain tasks."

Re:Become Shell Literate by coliveira on Sunday December 13, 2020 @01:40AM (#25404787)
Yes, the IDE is supposed to be faster for the things it was designed to do. That's the whole reason for its existence. But the shell allows you to do much more than your IDE was supposed to do. If you don't learn it, you're confining yourself to the boundaries set by the IDE.
Re:Become Shell Literate by hibbelig on Sunday December 13, 2020 @02:36AM (#25404978)
And vice versa! The IDE will show me the inheritance hierarchy. It will help me find places where a method is called (and knows to skip like named variables and other methods that happen to have the same name).
Re:Become Shell Literate by pjmlp on Sunday December 13, 2020 @03:22AM (#25405130)
The IDE as designed at XEROX PARC, and in most Smalltalk, Common Lisp, Java and .NET ones, has a shell as part of its features, there are no boundaries.
Re:Become Shell Literate by coliveira on Sunday December 13, 2020 @01:28PM (#25408806)
But if it includes a shell, you still need to learn the shell, don't you? It doesn't matter from where the shell was called, a real terminal or an emulation.
Re:Become Shell Literate by cjohnson318 on Saturday December 12, 2020 @11:34PM (#25404332)
If you work with mechanical or electrical engineers, then you're going to run into Windows machines pretty quick, and then you need to convince them to install minGW to run your shell scripts. Sure, shell scripts are portable between Mac and *nix, but you're leaving out a large elephant.
Re:Become Shell Literate by filmgirlcw on Sunday December 13, 2020 @01:12AM (#25404678)
Hopefully the next rise or WSL, Windows Terminal, and the OSS PowerShell will help that.

I’ve anecdotally noticed more people using or willing to use PowerShell in some scenarios, now that it’s at parity on Mac and Linux (there are a few things in old-school classic Windows PowerShell that don’t work on Mac/Linux but the future direction and support is all x-platform) and it’s certainly easier to get a Linux shell running in Windows than ever before.

Disclosure: I work at Microsoft but not on any of these tools.

Re:Become Shell Literate by eeskildsen on Sunday December 13, 2020 @07:03AM (#25405991)
Cross-platform PowerShell is fantastic. It's one of the first things I install on a new Linux box nowadays. I don't think I could go back to a string-based shell. Objects are so much cleaner and easier to manipulate.

Plus you get a huge standard library out of the box with its .NET integration.

It's really impressive what Microsoft has done with it.

Re:Become Shell Literate by addicted on Saturday December 12, 2020 @11:45PM (#25404376)
I used git bash and it worked just fine.

But now you can use Linux subsystem for Windows. I don’t have much experience with this so I’m not sure how well it works in practice but most people seem to rave about it.

Re:Become Shell Literate by rubatuga on Saturday December 12, 2020 @11:57PM (#25404423)
More than once did I type ls -lah into a command prompt window to be sorely disappointed.
Re:Become Shell Literate by pjmlp on Sunday December 13, 2020 @03:23AM (#25405133)
Powershell has an ls alias.
Re:Become Shell Literate by astrobe_ on Sunday December 13, 2020 @05:31AM (#25405591)
Depending on your needs, the Windows port of Busybox might do the trick.

Personally, I don't like the shell that much. As others pointed out, it is a consistency-lacking set of programs that often do only trivial tasks (by design).

A proper cross-platform scripting language such as Perl, Python or Newlisp. The latter is very much like Busybox : it packs a lot in a small single executable (plus it is a Lisp-like language so the syntax is simple and the documentation is good).

Re:Become Shell Literate by antb123 on Sunday December 13, 2020 @10:16AM (#25407089)
Ironically 2 years ago they would have been running unix workstations and due to 2 or two software vendors they have been forced onto windows.

Architects also can use Mac's only part of the time. A lot of software just isn't available for anything other than windows (Rhino etc).

Re:Become Shell Literate by lenkite on Tuesday December 15, 2020 @12:13AM (#25427254)
Git bash is something that nearly every engineer installs nowadays on windows.
Re:Become Shell Literate by antb123 on Sunday December 13, 2020 @10:21AM (#25407128)
Shell commands really have lasted... I mean if I think of the computer skills that I learned as a teenager that I still use today

1) shell commands

2) sql

3) vi

4) some programming languages c, pascal(?), basic(?)

Everything else has changed multiple times. Maybe that means its worth investing on learning them.

Re:Become Shell Literate by renox on Sunday December 13, 2020 @09:09AM (#25406646)
The thing is sometimes it's faster to goes to the shell use a grep -r/ag than to wait that 'jump to definition' does its job.. Depends of course the language and the project, but it's true for me at my work big C++ project.. CLion is awfully slow to start, VSCode starts fast but often I can find things faster in the shell than in the IDE :-( so I use it mostly as a dumb text editor.
Re:Become Shell Literate by lenkite on Tuesday December 15, 2020 @12:11AM (#25427242)
Does your IDE run inside a 500MB linux container ? After cloud adoption, I would have difficulty finding software developers whose work does not entail running across multiple machines and environments. (Ok, the community of scientific researchers is probably exempt from this but they are a minority).
Re:Become Shell Literate by Siira on Sunday December 13, 2020 @06:16AM (#25405774)
From my experience, the capabilities IDEs and unix tools offer are mostly orthogonal. Also, your arguments against consistent UX has the solution of just writing a simple wrapper around the offending tool (or using newer ones, e.g., ripgrep and fd). `tldr` also tells you the correct interface quickly.