Mac Users Teaching Command Prompt Needs to Stop

Jun 27, 2020 15:30

I've learned programming from a lot of sources. University, Bootcamp, and countless online courses. There's one problem I see everywhere. Even among the best teachers like Wes Bos and Andrei Neagoie. Command Prompt is still taught for Windows users.

To be clear from the beginning. There's a reason I have a subscription to Andrei's Zero to Mastery. I think it's the best place to learn code. I also keep up to date with Wes Bos's courses which are always top tier. No other courses, Bootcamp, or University beat out these guys in my opinion. But they need to update their knowledge on terminal use.

In terms of University, the usage of command prompt tends to come down to the preference of professors who have been using a mix of Cygwin, Git Bash, cmd prompt, and Vim for decades.

In terms of online course teachers, who are teaching the most modern technologies, it's a matter of Mac users not doing their due diligence. I'll give the University Computer Science program a pass, there shouldn't be an expectation of learning new technology there. But Wes Bos and Zero to Mastery Courses? That needs to change.

Let me give you an example. In Zero to Mastery's Complete Web Developer (2020) course, Andrei Neagoie has a section called "Command Line" with a note for Windows users. It says Windows users should download Git Bash to use with the course. I know, PowerShell users are already shaking their heads. But what is more embarrassing a "P.S." note that says Windows has a preview version of an "actual" terminal on the windows store. This is where Andrei loses all credibility on how to use Windows. The new Windows Terminal is just a UI and GPU engine to use multiple kinds of terminals in tabs. The description makes it very clear.

The Windows Terminal is a modern, fast, efficient, powerful, and productive terminal application for users of command-line tools and shells like Command Prompt, PowerShell, and WSL. Its main features include multiple tabs, panes, Unicode and UTF-8 character support, a GPU accelerated text rendering engine, and custom themes, styles, and configurations.

That application in use looks something like this.

Windows Terminal

From left to right that's a tab for Windows Powershell, Powershell Core (Version 6), Ubuntu with ZSH (we'll come back to that), Command Prompt, and Azure Cloud Shell. Any other similar installed application can be added to your options manually. Note that none of these things have anything to do with the Windows Terminal application. Windows Terminal only allows you to view the shells/terminals you have installed on your machine side by side.

Okay, so Andrei posted a link to Windows Terminal without knowing what it is. So what? The point is still there. The commands that Andrei uses on his Mac don't work on Windows and Windows users need to know the equivalent. Also not true. And they don't even need to download a Linux distribution or git bash to use those commands.

Enter Powershell. Powershell is often called more of a scripting program than a terminal or shell. But it can and should be used as the main terminal for Windows. By Microsoft's own words, "To create the best command-line experience, PowerShell is now the command shell for File Explorer." If command prompt is being taught, your course teacher is teaching you out of date practice.

Powershell gets its use by allowing you to use commands from the old command prompt, the new Powershell script-based commands, and Linux/Mac commands. That's right, with two exceptions, every command Andrei uses in his terminal video for Mac, all of those commands work. You don't have to (but you can) use the Windows alternatives he says you have to use. Going through the list of commands he uses in that video, here's what you can do in PowerShell.

  • List files: ls, dir, Get-ChildItem

  • Print Working Directory: pwd (It might seem like this doesn't do anything on Windows, that's because your working directory is always displayed.)

  • Change Directory: cd, Set-Location

  • Open File: start, Start-Process (this works for executables like sublime_text.exe)

  • Create-File: New-Item

  • Rename File: mv, Rename-Item

  • Delete File: rm, del, Remove-Item

  • Delete Directory: rm -r, rmdir, rmdir -r, Remove-Item, Remove-Item -r

The next time a Mac user tries to tell you to use the command prompt, tell them to get out of 2006 and join the modern development OS, Windows. In fact, inform them that Powershell 6 is open-source and cross-platform, and for the sake of continuity (and using a better terminal) they should download it and teach it, even if they are on an outdated platform like Mac.

If you're given no choice but to use old Linux command line software, just install a Linux distribution on your Windows machine and use them side by side with your real dev tools. Just as I have ZSH running in Ubuntu on Windows in the screenshot above. I'll leave it up to Fireship to show you how to do that.

I'm joking with the Mac hate, there's no problem with using it. But it is frustrating to see Mac users teaching old, outdated ways of doing things to new programmers who may not be aware of the better tools available to them. And instead of frustratingly telling Windows users to use alternative commands in some notes somewhere to the side, it might be better to teach a cross-platform terminal like Powershell 6 that everyone can use and which should feel pretty comfortable to a Mac user anyway.

Back to Home

Created by Ethan Glover