views:

243

answers:

13

Hi,

I'm teaching an introductory class to brand new computer engineering students. This week I'm going to teach basic MS DOS commands and batch files (and a few weeks later unix). Last year some students were whining that "it wasn't necessary anymore". Since I insist on teaching it, I have some reasons in mind. But I'd like hear you guys' opinions. What reasons can I use to convince them before I start?

thanks.

Ok, after several answers now I'd like list my reasons to teach basic DOS commands and basic batch file usage.

  • First of all it helps to understand how things are happening behind the scenes. This will be useful with many courses in the future such as OS and Network.
  • A good start before learning Linux. Then, why not Linux first? Because most of them have never used anything else except Windows yet. (A few weeks later I'll teach Linux and virtual box)
  • Do not underestimate batch files. This is also a good introduction for UNIX shell scripts.
  • They are also learning C programming on Windows. So they can use some commands with system(); function in their code.
  • For the rest of their life in a way they will have to perform many tasks without using GUI.
+2  A: 

Never underestimate how useful batch files can be. Around a year ago I used to use them for several little tasks such as automatically copying backup files over a network. They can be very useful.

Daniel Snowden
+8  A: 

Will this be something they will use? If not they will probably forget about it, or learn it without knowing why, maybe hating it, and that you don't want.

I think they will end up using powershell (if not a *nix shell), so why not teach that?

Alberto Zaccagni
+1 for powershell
Thilo
+6  A: 

There are good reasons for learning working with the command line - it is so much faster than any GUI for so many tasks - but DOS really does have a distinctly antiquated air to it. That's not to say it is antiquated - cmd still ships with every Windows for good reasons - but students need the feeling they are learning something new and cool.

I would focus on Linux for teaching the command line - nobody can say that's not relevant in 2010! - and deal with the DOS shell and its (more limited) possibilities and differences as a part of that.

Pekka
+3  A: 

First, MS DOS doesn't exist in modern windows - it hasn't since Win2k/WinXP What you mean in the Windows Command Line. There are a number of great uses for it, but you may find it easier to teach them to create .cmd scripts and run them from the "Run" dialog.

my reasons for using the command line in windows are as follows:

  • ipconfig /flushdns
  • ping

Aside from that, I rarely use the command line in windows. If I need to do anything in a batch process, I'll ssh into my linux server and do that.

Powershell may be better, but I don't use that (as I said, I have linux available to me) so I can't comment on that really.

phalacee
A: 

Maybe one day your windows will crush so if you know the basics of MS-DOC you can save some files from your computer before you format your disk. Or maybe you can fix your hard drive. If your are a developer you can use MS-DOC commands to generate some file... Is very helpful in some cases.

Andrei Bularca
For all of this, a Linux Live CD would be better suited. Now that would be a good thing to teach (basics of boot sequence and hard disk partitioning).
Thilo
A: 

Learning anything is useful, however I wouldnt enforce it on them, there are a lot of great command line tools still available for use, and sometimes its simpler to write a simple batch file to do some tedious tasks. DOS isnt exactly a hard thing to learn so I wouldnt spend much time on it but simply teach some fundamental DOS commands and point them to some references where if they wish to further their knowledge then they can.

kyndigs
+3  A: 

In windows you could also teach them Powershell...

Carles
+2  A: 
  • Considering that more and more computers (including mobile phones and servers in data-centers) are based on Unix or Linux,
  • Considering that the core of your class is Unix and Linux,
  • Considering that Cygwin gives access to Unix command line on Windows,

  • But considering also that MS-DOS may sometimes help,

I would teach the other way: Unix as a starter and a main course, then MS-DOS as a side note.

mouviciel
+1  A: 

Here's some reason why you should drop the idea of teach DOS (cmd.exe) in this present era.

  • Lack of data structures such as arrays/dictionaries/hashes.
  • Lack of String/text manipulation functions and capabilities.
  • Lack of Date arithmetic capabilities
  • Lack of maths capabilities. only able to do maths on integers.
  • Lack of other programming constructs like while loop, etc
  • Because of lack of such features, one usually has to create workarounds, so much so that the batch code ends up messy and inefficient.
  • and many others etc

Some better alternatives,

  1. Linux shell.
  2. vbscript
  3. powershell
  4. C
  5. Python.
ghostdog74
I'm not going to teach DOS for a semester. Just for this week's class which takes 2 hours.
hrzafer
+3  A: 

As phalacee above said: "MS-DOS doesn't exist in modern Windows". The Command Prompt in Win2K/WinXP/Win2003 is different with original MS-DOS. I think MS-DOS is almost (if not absolutely) antiquated and unworthy to learn, unless for someone who wants to understand the Microsoft OS evolution path.

However, for Windows users, the cmd still should be learnt. Following are the reasons in my opinion:

  1. Command Prompt is the basic CLI shell on Windows. Many utilities (e.g. ipconfig/ping/netstat/sqlcmd for SQLServer, etc) can only be used in command line.
  2. Batch(.bat) or CMD(.cmd) script is useful to lots of simple automatic jobs -- although its functionality and syntax are both unly.
  3. Some additional toolkits can be used to enhance the ability of cmd, such as Cygwin, Sysinternals, Windows Resource Kit Tools, etc. They need knowledge on cmd.

The section 15 (Tip 21) in the famous book The Pragmatic Programmer explained why command line should be learnt.

On Windows 7, PowerShell seem to be a better choice than cmd.

Feil
A: 

Additional ideas:

  1. For students in Computer Science major, learning programming on Linux/FreeBSD is much better than doing these on Windows. First, open-source OS is cheap; Second, these UNIX-like operating system is well-organized and open so that beginners can acquire more knowledge and techniques. In this subject about command line, we can see the *NIX shell is more powerful and beautiful than Windows cmd.

  2. For programmers or system administrators working on Windows platform, cmd (or PowerShell) is necessary skill. We can write cmd scripts to do some simple automatic jobs. For complex tasks, we can choose VBScript/Python/Perl/AutoHotKey and attach them together with cmd.

Feil
A: 

Quote from hrzafer:

"They are also learning C programming on Windows. So they can use some commands with system(); function in their code."


I agree with this point. Not only the "system()", but also "int argc, char *argv[]", "return/exit", etc.

It's better to start learning programming with CLI. Use a text editor and the command kit of compiler/debuger/profiler rather than IDE, students can understand compile process, substance of source code and executable file, and the interaction between a program and operating system shell.

Feil
A: 

I would start immediately with Linux/Unix. While you say they have never used Linux before and are used to Windows, I doub they've ever used DOS/command line much if at all. If you're talking about true MS-DOS with 8.3 filenames, config.sys/autoexec.bat, memory limitations & driver hassle, you're just going to be wasting their time on something that is not going to be of much benefit unless the the vast majority of your students will be developing for legacy systems. It's going to be worse when they start getting good with DOS and then have to jump over to Linux which will look like an alien planet compared to DOS.

Windows command line might be good to learn, but ultimately they should learn programming fundamentals and then they can apply it to many scripting languages like BATCH, BASH, Powershell, etc...

Klinky