Most active commenters
  • anthk(3)

←back to thread

412 points conanxin | 12 comments | | HN request time: 1.097s | source | bottom
Show context
mg ◴[] No.41085093[source]
The command line is still king.

Whenever I see new coders struggle, it usually is because they:

    - Don't know the context of what they are executing

    - Don't know about the concept of input and output
On the command line, the context is obvious. You are in the context. The working dir, the environment, everything is the same for you as it is for the thing you execute via ./mything.py.

Input and output are also obvious. Input is what you type, output is what you see. Using pipes to redirect it comes naturally.

Not being natively connected to context, input and output is often at the core of problems I see even senior programmers struggle with.

replies(16): >>41085138 #>>41085178 #>>41085239 #>>41085304 #>>41085362 #>>41085446 #>>41085493 #>>41085513 #>>41085614 #>>41085677 #>>41085897 #>>41086268 #>>41086743 #>>41086819 #>>41087168 #>>41097209 #
1. jasode ◴[] No.41085446[source]
>On the command line, the context is obvious.

But CLI contexts are only obvious if the computer user is already familiar with the CLI which biases the learned mind to perceive things as obvious when they really are not.

A lot of CLI commands syntax are based on position instead of explicit argument names.

E.g. creating file system links via CLI has opposite syntax positions in Linux vs Windows:

  - Linux:  ln srcfile targetlink

  - Windows :  mklink targetlink srcfile
If one goes back & forth between the 2 operating systems, it's easy to mis-type the wrong syntax because the CLI doesn't make it obvious. On the other hand, using a GUI file browser like Ubuntu Nautlius or Windows Explorer lets a novice create links ("shortcuts") without memorizing CLI syntax.

This gap of knowledge is also why there is copy&paste cargo-culting of inscrutable ffmpeg, git, rsync, etc commands.

E.g. using ffmpeg to covert a DVD to mp4 by manually concatenating *.VOB files has very cumbersome and error-prone syntax. It's easier to use a visual GUI like Handbrake to click and choose the specific title/chapters to convert.

CLI vs GUI superiority depends on the task and the knowledge level of the user.

replies(2): >>41085490 #>>41085882 #
2. tjoff ◴[] No.41085490[source]
Context isn't the same as syntax?

Yes, command line suffers from discoverability of which different applications (such as ln/mklink) may not be consistent.

It is one of the bigger problems (imho) of the cli but it doesn't go against GPs point.

The command line does have a learning curve (partly because of the above), but it is also quite rewarding.

replies(1): >>41086183 #
3. fragmede ◴[] No.41085882[source]
These days it’s easier to ask ChatGPT for the ffmpeg command line to do the thing you want, imo.
replies(2): >>41087525 #>>41088082 #
4. sgc ◴[] No.41086183[source]
When I start typing a formula in LibreOffice Calc, there is a popup showing possible matching functions, then when I choose the function, the popup shows the required syntax for the function and where I currently am within that syntax. A bash plugin that would do that would be an absolute game changer imho.

The cli excels because it is extremely flexible, with far more options available than a set of buttons could ever display. But discoverability rounds down to 0, and there are footguns. It seems like spreadsheet software has found an almost drop in ui that would greatly enhance the cli.

replies(1): >>41086464 #
5. thinkmassive ◴[] No.41086464{3}[source]
Tab completion can get you much of the way there.
replies(1): >>41086563 #
6. sgc ◴[] No.41086563{4}[source]
it's not the same thing. Tab completion is useful and will complete something you know of. But it does not help you discover something you don't know, or provide you the syntax of the command after it is entered. The problem I would like to solve is discoverability.

It's a 3 part problem: available commands, their options, their syntax. Part one would need to capture prompt input before enter was hit using solutions similar to those found at [1] perhaps the most useful but least complete one there is the one that uses apropos so something like `apropos -s 1 '' | sort | grep calc | less`. Similar solutions would be required for two and three. The roughest and easiest prototype would probably be two tabs in a split screen view, which would allow for selection of displayed matches to then modify the prompt creating those matches in the other tab. But Calc style popups directly attached to your cursor would be more useful still.

[1] https://stackoverflow.com/questions/948008/linux-command-to-...

7. anthk ◴[] No.41087525[source]
When some big shit hits the fan either with ChatGPT or internet connections, the only people able to fix systems without an internet connection will be us, the millenials.

The rest will be prompty fired in the spot.

replies(2): >>41088165 #>>41097215 #
8. Gormo ◴[] No.41088082[source]
Everything is "easy" when someone else is doing it for you. Results are best when you develop and apply your own expertise to a problem, but it's not feasible to do that for every problem domain -- relying on others is often important.

I'ts just that if I'm going to rely on someone else, I'd prefer for that someone else to be one of the people who has developed and applied their own expertise to that problem domain, rather than a statistical model that only actually knows how likely words are to appear in proximity to each other, and has no capacity to validate its probabilistic inferences against the outside world.

9. Gormo ◴[] No.41088165{3}[source]
I've found that as far as generational cohorts go, the most adept people are the late Gen-Xers and very early Millenials -- the people who grew up surrounded by C64s and Apple IIs and later had to fiddle with their config.sys and autoexec.bat files to get their game to fit into conventional memory.

People whose first exposure to computing was in the mid-'90s or later seem to have less depth of understanding of the fundamentals and less experiencing tinkering and using process of elimination to solve problems. I started encountering people who didn't understand certain fundamental concepts and had no exposure to the CLI, but still had CS degrees and were applying for developer positions, about 15 years ago.

replies(1): >>41088770 #
10. anthk ◴[] No.41088770{4}[source]
Yeah, these too. But lots of millenials learnt with RedHat, Debian and they knew a bit of DOS for some issues with Windows 98 and potential recovering from disasters. Still, far more able than the ChatGPT aided people blindly pasting commands into a shell being a recipe for a huge disaster.
11. fragmede ◴[] No.41097215{3}[source]
we had the same conversation when Gmail came out.

a true test for a progammer is to see what they can do on a computer without the Internet.

replies(1): >>41098846 #
12. anthk ◴[] No.41098846{4}[source]
- Debian/Devuan/Gnuinos users with offline DVD's ISOs mirrored under an USB drive: easy mode. Most of the docs are already there, just mount the ISO's as a loopback device and run apt-cdrom add against the mount points.

- Windows user: hell.

Ubuntu/Arch/any distro without full ofline mirrors: hell too.