I think Apple's new playgrounds and the stuff they showed for kids at WWDC is the future, personally.
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.
You can't automate clicking buttons nearly as easy as you can munging text streams.
Many GUI apps have some embedded scripting capability (for extensions, batch processing, etc).
The same could be generalized to use and combine not just one through it's special language, but all of them from outside.
That's e.g. what Apple's OSA dictionaries do enabling you to script GUI apps (if its developers bothered to expose its commands as programmatic APIs).
And if Windows and OSX and Linux devs talked between them, the same commands could work in all platforms for the same app.
You could also use something like a visual pipeline (as in Automator) to combine functions and move results between arbitrary apps (think "GUI pipes"), do the whole scripting from the CLI in some scripting language, send messages to the app (a la Rest), etc.
This is also true for web apps of course -- they're GUI based (e.g. Gmail, Mailchip) but lots have programmatic interfaces, via REST and co.
Of course it is inherent. You need to actively fight it if you want it gone (i.e., if you want GUI scriptability). For shell, you automatically have the scripting capability.
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?
It can be really trivial through, which is the point. Defining OSA dictionaries, for example, was never something that took major effort. The fact that people don't care about those enough to make it a standard feature in GUI frameworks is a cultural thing, not a technological limitation inherent in the API.
That said, sure, CLI programs give scriptability for free.
But that stops when you need long-running session scriptability -- there you essentially have to pass messages to an already running cli program, and that's done the same way as you would have handled passing messages to a GUI program.
That's true whether you do it with a "telnet to the program" like interface, a "client" interactive style like e.g. psql, or even low level POSIX signals (which require a handler out of the program flow).
>This is part of the operating system's concepts a student needs to learn anyway.
No, it's not.
First, not all people studying a programming language are or care to be CS majors. A student could just use the GUI file manager for an eternity...
But as long as you drop them to cli for compiling etc, they also need to learn shell and other such stuff. An IDE would have handled all that for them.
> It can be really trivial through, which is the point.
No, it will not be trivial. It can be easy to use, but not trivial. Whenever you hit GUI, all the mechanics (i.e. internals) suddenly becomes complex. What the heck are "OSA dictionaries", what data is inside them, what remembers them and how does changing them from outside of the original process work?
> That said, sure, CLI programs give scriptability for free.
> But that stops when you need long-running session scriptability [...]
Command line tools rarely are long-running things you need to interact with.
>> This is part of the operating system's concepts a student needs to learn anyway.
> No, it's not.
How so? Suddenly one doesn't need to understand what the current working directory is? How to work with files then? Of course it is necessary to know those concepts. It's just that GUI hides a lot of them, so dropping to more basic tools hurts so much because of all complexity that was hidden springs suddenly.
> But as long as you drop them to cli for compiling etc, they also need to learn shell and other such stuff. An IDE would have handled all that for them.
But then they need to learn much about their IDE, which is as large area as basic proficiency with command line, except that knowledge can't be easily composed with anything other, and once they leave the IDE, the knowledge becomes next to useless.
The only thing that could be seen as benefit is when the student learns what icon to click when, without understanding what is done behind the scenes, but then you easily can have the same effect in command line.
It seems that you insist that it can't be trivial, but you're not familiar with OSA and how e.g. Cocoa handles scriptable GUI apps.
OSA is Apple's scripting architecture for Cocoa, and with "dictionaries" (e.g. XML definition files) you can expose to a scriptability layer (accessible from AppleScript, Javascript, Python and all kinds of apps) any class or element in your app, quite simply. You don't have to change the internals of your Classes even.
This is not available in all GUI frameworks, but what I'm getting at is that this is not some inherent limitation of writing GUI apps, it's a limitation of current frameworks and the lack of thought it was given to this.
> But that stops when you need long-running session scriptability [...]
> Command line tools rarely are long-running things you need to interact with.
All kinds of deamons and servers are command line too, not just things like ls and grep. And these you want to interact with over their long-running lives. Same goes for tools with heavy initial startup time (e.g. a statistics tool that needs to load some data set, etc).
It's due to a lack of foresight/coordination (and "worse is better" mentality) that we don't have a unified scripting method for short term cli-tools, long-running cli apps, and GUI apps (and if we had ones, it could easily be extended to Cloud apps for the ultimate in automating and pipelining!).
>How so? Suddenly one doesn't need to understand what the current working directory is? How to work with files then? Of course it is necessary to know those concepts.
You can know those concepts at the GUI level (including abstractly). No need to know "cp", "rm", "ls -la" and other such text-based interactions with them. In fact there are computers that don't have these at all (most smartphones, the iPad, etc), and tons of Windows and OS X users never care for them anyway.
>But then they need to learn much about their IDE, which is as large area as basic proficiency with command line
Yes, but that knowledge is specific to their task (which is to learn programming).
"cp" and "ls -lah" and "rm" are not -- they already know another way to perform those tasks.
> [...]with "dictionaries" (e.g. XML definition files) you can expose to a scriptability layer (accessible from AppleScript, Javascript, Python and all kinds of apps) any class or element in your app, quite simply.
There you go. The mechanics of how this works is non-trivial. I would say it seems quite complex at this point.
Trivial would be if all it was to this scripting was "just this simple thing", like executing a program exactly the same way as always, but with provided command line parameters this time. Now you say "Python", so it must be first implemented by the author of GUI program, then exposed in "e.g. XML definition files", and then something (Cocoa, as you say) must transport some messages/calls from user's code to scripted program's code (how? through some kernel way? user-space bus? something different?). How this is trivial mechanics?
>> Command line tools rarely are long-running things you need to interact with.
> All kinds of deamons and servers are command line too, not just things like ls and grep. And these you want to interact with over their long-running lives.
But daemons are not command line tools. Command line is just a way to start them under unices. Under Windows it's a totally separate type of programs ("Windows services"). Even aside from that, daemons are not normally called for one-off tasks, but to provide services. This means you already need a communication channel for such a daemon.
> Same goes for tools with heavy initial startup time (e.g. a statistics tool that needs to load some data set, etc).
And what do you need/want to script in this statistics tool that loads plenty of data while it loads this data at its startup?
> You can know those concepts at the GUI level (including abstractly).
Current working directory? ROTFL. The whole point of GUI is to hide this concept, and you tell me one can learn it from GUI?
> In fact there are computers that don't have these at all (most smartphones, the iPad, etc),
Sorry to break your little utopia apart, but "most smartphones" run Linux or generally work with hierarchic filesystems, which is totally opposite of "no current working directory".
>> But then they need to learn much about their IDE, which is as large area as basic proficiency with command line
> Yes, but that knowledge is specific to their task (which is to learn programming).
It's not specific to programming, it's specific to their tool for learning programming.
> "cp" and "ls -lah" and "rm" are not -- they already know another way to perform those tasks.
And that's why I don't insist to use them or even learn them. What I insist is to learn how the compiler is called, what to feed it with (text/plain, with any editor, not just heavyweight IDE), and how to execute freshly produced binary.
Well, if by trivial you mean "totally effortless and thoughtless" then not. But I don't think that's the correct mental mode to create CLI interfaces either.
>But daemons are not command line tools. Command line is just a way to start them under unices. Under Windows it's a totally separate type of programs ("Windows services").
Command line is any headless program. And you can start Windows servers from the command line too.
>Even aside from that, daemons are not normally called for one-off tasks, but to provide services. This means you already need a communication channel for such a daemon.
That's narrow thinking.
First, e.g. "grep" also provides a service of returning matching results. Whether it does it once-of or as a deamon (one could easily imagine a grep deamon, not unlike Solr or Spotlight) is irrelevant with respect to its scriptability.
It's only because we don't plan for it, that we have this artificial restrictions -- "that's a deamon, you can't script it like that".
Besides, regarding "This means you already need a communication channel for such a daemon.", that's a different channel than the scriptable one, because the latter would include stats, configuration etc.
A web server has a channel to do "GET / HTTP/1.0", but that's not the same as a chanel allowing you to e.g. "print current connected IPs", "reload X configuration file", etc.
>Current working directory? ROTFL. The whole point of GUI is to hide this concept, and you tell me one can learn it from GUI?
No, the whole point of the GUI is to give a graphic representation of those concepts, not to hide them. It hides absolutely nothing (except things that don't make sense in a GUI, like the CLI hides stuff that don't make sense in a terminal, eg. the graphical representation of an jpg file, which a GUI can immediately show in its listing).
In fact one can trivially create a restricted "ls" style program that shows (on the cli) far less info than what the Finder or Windows Explorer does.
You seem to conflate the CLI with the "canonical representation" of what actually happens in the OS/FS etc. But it's just a textual representation of it, nothing more.
What actually happens is a series of process starts, method calls, and system calls.
Whether you say it by printing stuff out (like early computers), in a cli (like UNIX systems), in a GUI, or even in VR or "PC-to-brain interface" in the future, it's the same underlying thing.
>Sorry to break your little utopia apart, but "most smartphones" run Linux or generally work with hierarchic filesystems, which is totally opposite of "no current working directory".
That's totally irrelevant to what I wrote.
My point is about those platforms not having a CLI as a user accessible object -- but only providing a GUI representation -- and users getting by just fine with that. Including the vast majority of OS X and Windows users who don't venture into the terminal at all.
>And that's why I don't insist to use them or even learn them. What I insist is to learn how the compiler is called
Again, you conflate the cli interface to the compiler to some canonical way about how "the compiler is called".
The compiler is called in many ways.
The cli is one, it's programmatic interface is another.
In fact both the gui window "run compiler with X, Y, Z options" and the cli command command "gcc -X -Y -Z" in the end just end at the same function, that starts the actual process.