Live data from Hacker News

Become Shell Literate

drewdevault.com

161–170 of 341 posts

Re: Become Shell Literate

#161
post #29

Someone should write "become IDE literate" as a response to opening of using vim with no extensions and using grep a lot. I've been using editors that are language aware since at least the late 90s. Depending on the language they'll show me all references, take me to the definition or declaration, stack those jumps so as I follow the links I can pop back a level to where I was. All of this is instant. 1000x faster th…

I've been using a lot of typescript lately. The ide support in vscode/tsserver is very complete, but it is NOT fast. As an example, it frequently takes multiple minutes to use find references. Rg or git grep with fzf are both hundreds of times faster, and are easier for me to navigate. (Obviously language aware find references is much more powerful, but with carefully named variables it's acceptable to just use rg.). Sometimes, even a simple "go to definition" results in a 45 second hang. (This is on a 2019 Macbook pro)

I've also used intelij idea with Java, and while it was much smoother than anything in the typescript ecosystem, it's definitely not faster than using grep.

Re: Become Shell Literate

#162
I agree that a programmer should know how to do things with shell, but when I read: > In my workflow, I use Vim as my editor, and Unix as my “IDE”.

I immediately remember how great are Jetbrains IDEs. I just can't imagine how someone could refactor code with such accuracy and without hurdle just using Linux vi or any cli tool...

Re: Become Shell Literate

#164
post #2

cpio is the better tool for the job in the last example, compared to tar. You don't have to use xargs, for one. It's safer to use `find -0 | cpio -0o` because it can handle weird filenames that contain newlines or other spaces.

File names that contain newlines??

Yes, just one of the numerous pitfalls you always have to be mindful of when using Unix shell commands.

Re: Become Shell Literate

#165
Sign me up for someone who hates the shell. I've always tried to write scripts in Python or even C++ is so much easier than bash, awk, etc. Bash has no repl, no unit tests not debugger its anachronistic. Don't get me started on emacs.

Re: Become Shell Literate

#166

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…

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…

[deleted]

Re: Become Shell Literate

#167
That pipeline sure does look convenient. Let's see how it will handle a path with spaces.

  $ git status -s | grep '^ D' | awk '{ print $2 }' | xargs git checkout --
  xargs: unmatched double quote; by default quotes are special to xargs unless you use the -0 option
  $ git status -s                                                          
   D "g h i"
I'd be lying if I said I was surprised, to be honest.

Re: Become Shell Literate

#168

Earlier quoted context omitted.

Where did I fault anyone, where am I gatekeeping? I'm talking about the befits of knowing more stuff. I'm not arguing against IDEs, I'm only arguing about the benefit of also knowing other stuff. Better tools: I'm very interested in, what I would in lieu of a better term describe as, Bret Victor's ideas and the example of Swift playground. At the same time, I'm very sceptic against everything that isn't a simple, hum…

By framing the IDE as a crutch, that's very much in the gatekeeping category.

For a lot of people, the IDE does end up being a crutch. I was one of those people, and I can honestly say that over reliance on IDEs really held me back. I became a much stronger programmer when I ditched the IDEs for most tasks. I'll still use IDEs for a few select things, but overall they tend to hide a lot from you and you end up learning the IDE instead of the concepts of whatever language or framework you're working in.

Re: Become Shell Literate

#169

Earlier quoted context omitted.

Cool. Still, a lot of people start out programming with complex IDEs and end up being unable to run their code without the "play" button of their IDE. Starting out, or only ever leaning an IDE is also hiding a lot of things from you. For me, knowing the shell isn't about IDE vs. shell tooling, it's about, whatever you use, be aware and knowledgeable about the foundation and being able to do stuff even if there is no…

>> Still, a lot of people start out programming with complex IDEs and end up being unable to run their code without the "play" button of their IDE. Yep. Another thing I hate is IDEs that build their own project files that tie you to them. A good IDE works with standard tooling, not as a replacement.

I could not agree with this more. I've worked on projects with some unholy combination of (gnu) Makefiles and VS Solutions. I've never "got" Visual Studio and have always found it very jarring -- but I mostly don't use windows much, and that always feels like it has a way of thinking that is...very orthogonal to mine. KDevelop has honestly been the best "not in your face" IDE I've personally found. I mostly do not do any MacOS programming, but when I have occasionally played, I've realised that xcode is brilliant but it seems like it utterly reinvents itself every major revision number. Eclipse, something I rarely-if-never used has sunk from a popular zeitgeist without a trace. Many of my colleagues (in a medical imaging setting) use jupyter, RStudio or Matlab, occasionally venturing into julia.

The winds shift, and the ship of progress sails a direction that is difficult to chart, but vim....vim never changes, and for that I am very glad.

Re: Become Shell Literate

#170
post #165

Sign me up for someone who hates the shell. I've always tried to write scripts in Python or even C++ is so much easier than bash, awk, etc. Bash has no repl, no unit tests not debugger its anachronistic. Don't get me started on emacs.

> Bash has no repl, no unit tests not debugger

Bash scripts are generally very short. If you need unit tests and a debugger you probably should be using something other than Bash. But saying you hate the shell because it's bad at something it was never designed for is silly.

Post reply on HN