by coldtea · 10y ago · 0 comments
Not, but it's the master's job to understand that all of his old, hallowed and arcane practices are not necessarily beneficial. Some are just busy-work or cargo-cult.
And that because a tool is "tried and true" for decades, it doesn't mean it can't be made better.
The command line might be handy for what it does, but from a UX perspective it's a mess. Tons of things that could be done to make it better, and bring it to 2016.
Take for example all common UNIX userland programs and change them so that they all respond to the same flags for the same functionality.
Here -- instantly better, and we're still in the CLI realm.
Or make them understand SIGINFO and turn on verbose mode etc midway.
Color-coded output (under a switch) from all tools, not just ls, grep etc.
A common configuration format for all of them. There's nothing something like TOML or JSON+comments couldn't handle, instead of each fucking tool having their own bizarro format and parser, resulting in the bloody mess that is /etc/conf.
Nor is "man" formatting the best we can do in 2016.
I'd even appreciate a "trash mode" for rm as default. Then you do something like "rm purge" and only then it actually kills everything put in between calls. Tons of user documents would have saved that way, instead of "just be careful because that's how we always did things". And of course some --doitnow flag could just delete stuff immediately.
Just a few things out of the top of my head. There are tons of other things...
Edit: of course those things would never happen, because they require central vision and roadmap, and the unix cli userland is just a set of disparate apps from teams who don't speak to each other.
At least FSF could impose some of that roadmap to GNU stuff, but they really don't care, they prefer to pass their time with
I think Apple's new playgrounds and the stuff they showed for kids at WWDC is the future, personally.
Want to teach two languages? Great! Install two entirely different IDEs, teach each one all over again and their differences, or spend hours debugging weird compiler plugin errors every single one of your students will have.
Or in 3 seconds tell them to type 'python' instead of 'gcc' once they already understand what programming actually is.
In general I always think it's important to understand what's actually going on before you use fancy tools that automate it for you. Because when your fancy tools break because of some tiny misconfiguration or change you didn't notice, and they will, throwing your hands up and saying "welp, I guess I'm helpless" isn't good enough and you'll never be half decent, or have any kind of real confidence in your ability until you have at least some knowledge of what's going on under the hood. If someone wants to be a programmer, we are teaching them to be car mechanics, not car drivers. So why not start with the real stuff?
And if someone can't get over their fear of communicating with the computer using words and symbols (i.e. text) instead of point-and-click then they aren't ever going to be a programmer -- better to know and pass that hurdle early rather than later.
People having been coding years on end on modern IDEs like IntelliJ and Eclipse and VS without them "failing" for basic stuff.
And it's not like setting up e.g. Vim or whatever with just some of the niceties an IDE has not challenging.
>Consider teaching a CS class. Everyone has a different machine, of a different age, with a different operating system. Getting all of them on some posix type CLI where you can type 'make' or 'python' is fairly easy and once it's working, foolproof.
You'd be surprised. Try getting them to run Python on Windows and discover all the subtle changes, libs that only play on Linux etc, use the same Unix userland with slight OS X/Linux changes, run that terminal stuff on Windows etc.
Besides, tons of programming teaches classes, seminars, etc use or recommend an IDE.
Ah wait, the integrated debugger has crashed again, so I cannot figure things out. Hey, the thing cannot even open a text data file, because it is not part of the project, whatever that means.
Etc. Most "industrial" IDEs male quote a few simple things way unnecessarily complex.
1. https://github.com/ontouchstart/swift3-playground/blob/39331...
2. https://github.com/thinkswift/TS/blob/296775627b19c4d98eb7fd...
My point is that there is a difference between mastering the toolchains and understanding the deep concepts.
I totally agree that we have to start from somewhere concrete, quote Seymour Papart: "you cannot think about thinking without thinking about thinking about something". However, we should also "focus on the big picture and zero in on the powerful ideas ..."
- http://news.mit.edu/2016/seymour-papert-pioneer-of-construct...
You don't start learning woodworking with pantarouter or a lathe.
Command line (compiler or interpreter) is something that works everywhere and always, and understanding how the environment works prevents the student from thinking magically through clicking buttons in IDE.
> it's absolutely absurd to say, "Well before you can start learning to program, you have to learn these several other domain specific languages and you have to type them, and it has to look awful."
Why do you think `gcc myprogram.c' + `./a.out' or `gcc -o myprogram myprogram.c' + `./myprogram' is "several other domain specific languages"? Because, you know, it's all that is really necessary to start learning C. I don't see learning even a small part of a DSL (shell, I presume) here.
Clicking a button in the IDE is not any different than writing: "foo -x".
They both end up as code being executed. And no, it's not always the case that an IDE's button click ends up in some cli command being executed in the background. There are such things as programmatic APIs to compilers, linters and such.
So nothing more fundamental or magical about the CLI -- it's just another, text vs graphics, based representation.
>Because, you know, it's all that is really necessary to start learning C. I don't see learning even a small part of a DSL (shell, I presume) here.
And where you'd run that command? Wont you "cd" there? Maybe create some directories? Maybe delete some files you don't need? That's shell for you.
And what about build scripts, including libs, etc? An IDE can create those for you automatically, with the plain cli you need to learn to write e.g. a makefile.
And tons of other things besides. You want a debugger? gdb and then learn the flags to attach it, several commands to step around and inspect things, etc.
Oh, far from it. You said yourself later down the thread that IDE needs to anticipate an interaction beside the mouse-click (by exposing some programming interface). It needs work to have that, and that is far from being trivial mechanics. `foo -x' only needs to have this `-x' provided somehow, and it doesn't care where it came from and how it was derived.
Command line does much, much simpler job of exposing underlying concepts of an operating system. The two hard parts about the command line are learning those concepts and learning that most of the time, most of the options are optional and can be omitted. For GUI, many of the OS concepts are hidden, intentionally or incidentally, but they are still going to bite if one doesn't know them.
> And where you'd run that command? Wont you "cd" there?
This is part of the operating system's concepts a student needs to learn anyway. A working directory is still a necessary thing, except with GUI you have no fsckin' idea where your program is executed, so good luck opening any file (unless you use absolute path, of course).
> Maybe create some directories? Maybe delete some files you don't need? That's shell for you.
Oh, so you have just vanished file managers so many people use? Those suddenly stopped working for somebody who happened to started learning programming? Why do you think a student needs to manage his files with shell once he starts writing programs, instead of doing things as he always did, in GUI?
You can't automate clicking buttons nearly as easy as you can munging text streams.
That will break a large chunk of scripts that use rm. Say someone with sufficient clout implemented this, dumped the information into some release notes, even made it widely known via various internet forums.
Inevitably, what will happen is that we get a split: some who do not want to use the "improved" tool as they have other more pressing concerns, and others who view it as progress.
If anything, there is already a ton of fragmentation even in such basic utilities found in coreutils (BSD vs GNU differences, not immediately available on Windows, etc).
And the funny thing is that even if unity is practically achieved for some time, someone will want to scratch a new itch, repeating the cycle.
Sure, that's why I talk about compatibility etc lower.
As I wrote, the best way imho would be to create new versions of the old utils, with changed prefixes/names, and have people slowly migrate to them.
It's not impossible, people can and do adopt new cli utils.
The old ones could still be there for the compability layer (for old scripts etc), but new stuff could be written in the new ones.
And while we're at it, a new shell too. Even zsh is 1990's technology for 1990's needs.
>And the funny thing is that even if unity is practically achieved for some time, someone will want to scratch a new itch, repeating the cycle.
That's how you get better stuff though, with cycles.
Not with religious adherence to backwards combatibility.
The problem is most of those cli userland tools only had one major cycle, when the old UNIX/BSD userland got remade as GNU, and added new switches, options etc.
Contrast with how better OS X is compared to Mac OS circa 1988 or Windows 10 compared to Windows 3.1.
This is an assumption that is not necessarily true. In the short term, there are plenty of examples of places where it is not true. As for this being true "asymptotically", that is a hard to verify assumption.
What is true is that cycles result in something new. New does not necessarily mean better.
The examples you give below are examples where the cycles have worked; there are examples where it has not.
Any example?
Because cycles (and I could have said "iteration") is what got us from bone tools to spaceships...
>The examples you give below are examples where the cycles have worked; there are examples where it has not.
That doesn't mean much. Even if a process (e.g. iteration) doesn't always achieve the desire result, it can still be the only way to achieve those results.
E.g. asking a person out. It might not always work, but it's still the only way to go on a date with them.
> A common configuration format for all of them
Easier said than done. Some applications don't require the complexity of JSON/TOML, and it's best for them to use a simple and regular language to make tools like cut/sed easier to use. Others naturally lend themselves to scripted configurations, in which case a full-fledged scripting language makes sense. Others yet require rich object configuration specifications, in which case JSON/TOML/YAML makes sense. I don't think there can be one configuration file to rule them all.cut/sed are usually used for the program's output, not their configuration files.
And if there was that common configuration format, you wouldn't need cut/sed or any such crude tool for the configuration files either, you could have a universal conf-edit tool, that could read the raw config files and output the configuration in whatever formal (XML, JSON etc) and convert it back in, search for specific entries, set specific settings, etc.
>Others yet require rich object configuration specifications, in which case JSON/TOML/YAML makes sense. I don't think there can be one configuration file to rule them all.
Even so, there can be one configuration language for an awful lot of programs, that don't have those special needs, and there isn't one. Instead it's a mishmash of every kind of custom parser.
But modern FOSS corporations are mostly hands off -- they don't care for such things, they sell support and enterprise services (e.g. RedHat), and others (e.g. Canonical) do some stuff, but lack resources/motivation to dig deeper, and even when they do stuff, they alienate "hardcode" macho types who protest "this is not the way we've always done this".
It's sad, because there are great ideas for tons of things to improve on a "UNIX v2" and "POSIX NG", now that we know what 21st century computing environment and modern needs are (in 1980 when those tools where designed internet was rare and slow, mobile wasn't a thing, the terminal didn't have colors, utf-8 didn't exist, and tons more stuff besides).
E.g. adopting something like Nix for package managing.
Or this, which is a patently sanier file system structure for multi GB disks and modern needs: