Live data from Hacker News

In the Beginning Was the Command Line (1999)

web.stanford.edu

111–120 of 271 posts

Re: In the Beginning Was the Command Line (1999)

#111
post #67
post #51

Earlier quoted context omitted.

Thanks :-) but allow me to enlarge, in my poor English: "us" the westerns, we came from those who invented the IT, the modern industry. We are evidently in a declining phase. Evidently someone else try to emerge and actually one of the most prominent new power, China, emerge doing what we have done when we was at the top of the world in industrial, public research, education terms. Meaning such "technical model" work…

I 100% agree, and your points about Chinese tools are particularly incisive. As an aside, but I think relevant and you might find it interesting: A decade or so I discovered Oberon, the last masterwork of the great genius of programming languages Niklaus "Bucky" Wirth. A complete OS, UI and compiler, in about four and a half thousand lines of code. I have it running in various forms. I introduced it to the Squeak Sma…

I know Oberon only by name, I've used (and honestly not loved it at all) some Pascal dialect back at high school, but back then was not real programming and was an introductory very bad organized course so it's hard to tell, I've encountered probably Oberon for a river navigation applications around 10 years ago but I wasn't really involved so I can't say much, I essentially do not know anything but the name, if you have some interesting links to share I'll skim them with pleasure.

In more broad terms I do not put much attention in a specific programming language even if clearly an OS-single-application is tied to a specif programming language, in the sense that there are many, and they are many factions loving one and hating others, the point is offering something usable at user level, like "just type a sexp and execute it" also from an email, because integration means also an immense small diversity and heavy dialogues so innovation. With such model we can keep our supremacy and more important we can't lose it because essentially anything float in a common see.

The main issue to reach such goal I think it's general cultural of the masses, today most peoples, many programmers included, do think that IT means computers, like saying that astronomy is the science of telescopes. Of course computers are like pen and paper, an essential tool, but they are a tool, the purpose of IT is information and that's not a specific technical task but a broad aspects involving essentially all disciplines. Until this is clear for anyone there is little hope people understand the need, power and issues of IT, they'll keep looking at the finger pointing the Moon instead of at the Moon.

The rest came after, even the most basic computer skills came after because to learn we need to be motivated, learning "just because you have to" as a social rule is not productive.

Re: In the Beginning Was the Command Line (1999)

#112

Earlier quoted context omitted.

Reductio ad absurdum: we should all just use an interactive assembler. Then you really are "in the context". There is a level of abstraction that makes sense. What level that is is dependent on your objectives.

My first real programming experiences was done through the browser’s console (JavaScript) and IDLE’s REPL (Python). The short feedback cycle works wonder for understanding instead of struggling to the multistep process of C compilation or Java verbosity. I tried my hands at reverse engineering and using a dissassembler like IDA also gives the same immediacy feeling. Great DX for me is either a good debugger or a prop…

> the multistep process of C compilation

it can be a single make command

Re: In the Beginning Was the Command Line (1999)

#113
post #13

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.…

Yep, I ran a short "introduction to the command line" course for the devs in my team. Afterwards, I noticed that their usage of the vscode terminal was much higher, and folks were more comfortable exploring on their own.

Quick outline of the course, in case anyone wants a starting point:

  * Introduction
    Quick history of Unix

  * When you log in
    Difference between login and interactive shells
    System shell files vs user shell files
    .zshenv for environment variables like PATH, EDITOR, and PAGER
    .zprofile for login shells, we don't use it
    .zshrc for interactive shells
    Your login files are scripts, and can have anything in them

  * Moving Around

  ** Where am I?
    pwd = "print working directory"
    stored in variable $PWD
    Confusingly, also called current working directory, so you may see CWD or cwd mentioned

  ** What is here?
    ls
    ls -al
    ls -alt
    . prefix to filenames makes them hidden
    . is also the current directory!
    .. means the parent directory
    file tells you what something is
    cat displays a file
    code opens it in vscode

  ** Finding my way around
    cd
    cd -
    dirs | sed -e $'s/ /\\\n/g'

  ** Getting Help From The Man
    man 1 zshbuiltins
    manpage sections

  ** PATH
    echo $PATH | sed -e $'s/:/\\\n/g'
    zshenv PATH setting
    which tells you what will be run

  ** Environment Variables
    env | sort
    EDITOR variable

  ** History
    ctrl-r vs up arrow

  ** Permissions
    Making something executable

  ** Prompts
    zsh promptinit
    zsh prompt -l

  ** Pipes and Redirection
    Iterate to show how pipes work
    cat ~/.zshrc | grep PATH
    ls -al > ~/.tmp/ls-output.txt

  ** Commands

  *** BSD vs GNU commands
    BSD are supplied by Apple, and Apple often uses old versions
    GNU are installed via homebrew, and match those commands available in Linux

Re: In the Beginning Was the Command Line (1999)

#114

The capitalist system loves the CLI. That complicated series of commands you just ran? Copy and paste them into the Jira ticket so the junior employee who makes half your salary can run them next time.

> Copy and paste them into the Jira ticket so the junior employee who makes half your salary can run them next time.

Or, more likely: so that you yourself can remember what you did the next time the problem arises. Or your colleague, who is senior, but does not know this part of the codebase or infra well. Heck, you can even write a shell script, automate things and have your productivity increased!

These things will be just as true and useful in some communist FOSS context as they are in a capitalist system.

Re: In the Beginning Was the Command Line (1999)

#115
post #13

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.…

[deleted]

Re: In the Beginning Was the Command Line (1999)

#117

Earlier quoted context omitted.

The command line is king, but sometimes the king is mad. Which is to say, it can be difficult to work with the monarchy when the syntax is shit . And there's a lot of bad syntax out there: overly cute, so terse as to be cryptographic, the straight-up baffling ... Outside of the syntax (which seems to live forever), you have things like non-sane defaults, obscurantist man pages ... the list goes on.

the ability to hit up and edit and retry is such a redeeming feature. repeating the same actions in a GUI with no keyboard shortcuts is an exercise in frustration.

GUIs can have keyboard shortcuts. Have you honestly never pressed Alt+F, x to exit a GUI program or Ctrl+S to save a document in a GUI editor, or Ctrl+Tab to switch tabs in a GUI browser or Tab to move focus between fields, or the context-menu button next to Alt Gr and then a keyboard accelerator key for the menu, or Ctrl+C then Ctrl-P or anything?

Repeating the same actions in a CLI with no readline is an exercise in frustration, but ... that's not what happens most of the time.

Re: In the Beginning Was the Command Line (1999)

#118

> Yet now the company that Gates and Allen founded is selling operating systems like Gillette sells razor blades. New releases of operating systems are launched as if they were Hollywood blockbusters, with celebrity endorsements, talk show appearances, and world tours. I was a kid at the time, but did many people actually buy windows? I know about the ad-thing where the cast of Friends or whatever bought windows 95,…

> I was a kid at the time, but did many people actually buy windows?

Yep! Windows did indeed come with machines, but the upgrades were always a big seller. I remember when Windows 3.1 hit the shelves and seemed to be everywhere. Same with Windows 95 but that one was a tougher upgrade because of the increased system requirements.

Re: In the Beginning Was the Command Line (1999)

#119

> Yet now the company that Gates and Allen founded is selling operating systems like Gillette sells razor blades. New releases of operating systems are launched as if they were Hollywood blockbusters, with celebrity endorsements, talk show appearances, and world tours. I was a kid at the time, but did many people actually buy windows? I know about the ad-thing where the cast of Friends or whatever bought windows 95,…

Yes - people bought it to upgrade, as the step up from dos to 3.1 to win95 was huge.

Re: In the Beginning Was the Command Line (1999)

#120

Earlier quoted context omitted.

The command line is not a "foundational layer" in macOS, that was my point. It exists on the same layer as the GUI does.

The foundation of MacOS is a fully-compliant Unix: https://www.opengroup.org/openbrand/register/apple.htm The GUI is built on top of the Unix foundation and does not stand alone or work without it. The 'FoxTrot' comic made a big deal about this not long after Mac OS X was released: https://www.gocomics.com/foxtrot/2002/02/25

The foundation of macOS contains elements of UNIX (or rather BSD) and the OS is UNIX certified, I‘m fully aware of that. But these are two different things.

For one thing, UNIX != command line.

In the same vein, Windows NT is not based on DOS anymore, even if it has a command line which resembles (parts of) DOS.

Post reply on HN