Live data from Hacker News

Ask HN: What am I missing re: fascination with command lines

news.ycombinator.com

1–10 of 15 posts

Ask HN: What am I missing re: fascination with command lines

#1
I consider myself to be a hacker. A fairly good one in fact. But lately something has been bugging me. The command line is making a comeback.

Recently I've been really intrigued by node.js. It has been a freaking pain to get an instance up and running. Joyent? make a curl command line post(That doesn't seem to work). Git? Issue yourself a key via command line. Finally I get into duo stack and then I get a guide with about 25 steps of command line commands.

It is 2011. WTF? Back around the turn of the century we used to have these things called installers that would keep people from having to do the same damn thing over and over and over. Or type. We create these great clickable symbols that were organized into hierarchies that were great for both teaching by way of layout and for getting things done. I think we called them menus.

I've done some digging around and found this insightful post about it: http://news.ycombinator.com/item?id=1407278

...but you know what? I call phooey. As much as it is great that you can mix and match at the command line, a picture is still worth a thousand words.

So tell me hn, what am I missing. Am I fooling my self calling my self a hacker if I use gitgui? (three click and I see exactly what is going where...why is typing 5-6 equivalent lines into the command line better?)

Re: Ask HN: What am I missing re: fascination with command lines

#2
A UI is great if it does exactly what you want it to do. But if not, and you want to customize at all, you're stuck. While if you're working on the command line, you can script any behavior you'd like.

A command line approach is also far superior for remote operation, repetition, combining with other tools, etc., because you can script the interactions and control flow.

Re: Ask HN: What am I missing re: fascination with command lines

#3
For me, command lines are like delegating a task to somebody else: "Find me all the temporary files older than a week and delete them".

In a GUI, I'm doing the task myself: "Hmm, where are the temporary files kept? OK, which are the old ones? I can probably delete these. Wait, here's some more, etc."

As with delegating tasks to people, both approaches have their uses (and pros and cons).

Re: Ask HN: What am I missing re: fascination with command lines

#4
post #2

A UI is great if it does exactly what you want it to do. But if not, and you want to customize at all, you're stuck. While if you're working on the command line, you can script any behavior you'd like. A command line approach is also far superior for remote operation, repetition, combining with other tools, etc., because you can script the interactions and control flow.

I'll give you that the flexibility of the command line can be a help if you're really trying to do something outside the lines, but I'll disagree with the second. If we were in 1998 I'd agree, but with the remote desktop tools we have today there really isn't much of an advantage unless you are bandwidth limited.

Re: Ask HN: What am I missing re: fascination with command lines

#5

For me, command lines are like delegating a task to somebody else: "Find me all the temporary files older than a week and delete them". In a GUI, I'm doing the task myself: "Hmm, where are the temporary files kept? OK, which are the old ones? I can probably delete these. Wait, here's some more, etc." As with delegating tasks to people, both approaches have their uses (and pros and cons).

Also, I'm finding myself using Vim more, in preference to editors like Visual Studio. The Vim approach is to work out what you want to do, then type the sequence of codes that makes the computer do it for you. The traditional approach is to cursor and tab around, editing the file directly.

Re: Ask HN: What am I missing re: fascination with command lines

#6
post #2

A UI is great if it does exactly what you want it to do. But if not, and you want to customize at all, you're stuck. While if you're working on the command line, you can script any behavior you'd like. A command line approach is also far superior for remote operation, repetition, combining with other tools, etc., because you can script the interactions and control flow.

If I might rephrase geophile, above: a command line (most of them, anyway) has a grammar, complete with flow-of-control constructs like if-then-else, while loops, for-loops.

You can express more with a grammar than without one. For example, you can express palindrome strings with a grammar, you can't with regular expressions.

We can tail off into philosophy by talking about "generative grammars" allowing you to create new ideas, and this may be what geophile says about "[G]UI is great if it does exactly what you want it to do. But if not, and you want to customize at all, you're stuck." I agree with this sentiment.

Re: Ask HN: What am I missing re: fascination with command lines

#7
The command line is the most flexible way to automate day to day tasks. Yes, a graphical installer makes things easy-once. Need to change the names of multiple files in a directory? Need to delete files that match a certain type, without hunting and pecking? Want to grab every jpg from a webpage? Doing these tasks on the command line is trivial compared to pointing and clicking for every single instance.

There are many benefits from using the command line interface to software. Often it is a trade off between flexibility and speed versus learning and thinking. It takes time to build up a solid knowledge of commands and options, and effort to recall them, but once that skill is acquired, it can save a lot of time.

Re: Ask HN: What am I missing re: fascination with command lines

#8
Command-lines are faster and more flexible than GUIs, because you define your own workflow - you can chain commands together with the unix pipe, pass arguments to commands that are the result of other commands via the backtick and a lot more cool stuff like that. Also, you can type faster than you can point and click. I prefer to keep my hands on the keyboard where I need them rather than having to reach out for the mouse, which is really far away if you think of it - it's 20cm aprox.

Besides, there's a hacker component in using a cmd, because it teaches you how things really work instead of covering that up with a pretty interface that does the job for you.

If these reasons didn't excite you, then maybe you are simply not a cmd guy - which doesn't discredit you as a hacker, I guess. Hackers build things, no matter what their tool of choice is.

Re: Ask HN: What am I missing re: fascination with command lines

#9

The command line is the most flexible way to automate day to day tasks. Yes, a graphical installer makes things easy-once. Need to change the names of multiple files in a directory? Need to delete files that match a certain type, without hunting and pecking? Want to grab every jpg from a webpage? Doing these tasks on the command line is trivial compared to pointing and clicking for every single instance. There are ma…

Ok...so where do I get started. I've seen a lot of command lines over the last few weeks and nothing in them gave me the impression that there was any sort of logic or automation going on. The all look like just one thing is happening. (And that is one of my strikes against them is that they seem to completely lack context)

Re: Ask HN: What am I missing re: fascination with command lines

#10
I love the command line because I started at a unix hosting company. It is important to be able to work effectively on remote systems. I can't think of very many production servers that have the option of plugging a monitor and keyboard into (or remote desktop).

I consider command line skills to be a bare minimum for programmer competency.

Post reply on HN