Friday, September 09, 2011

Visual Studio

I am teaching CSC 101 - C++ Programming I for the first time this semester.  It's a busy semester.  I'm also teaching assembly language for the first time.  Fortunately I prepared for the assembly language class fairly adequately in the summer.

I decided to bite the bullet and use Blackboard which is Southern Miss's approved on-line instruction tool.  I am preparing materials and quizzes for both my C++ and assembly classes.  In addition I am preparing lab assignments for the CSC 101 Lab class.  That's a whole lot of Blackboard.  In the past I have used Moodle as a an organizational tool for all my classes.  Blackboard seems to be roughly equivalent in capability to Moodle.  I prefer Moodle, but that may be biased based on experience.  One definite advantage to Moodle was that we run it on a local computer which is very seldom overloaded, while Blackboard is external and there are fairly common small delays.

I have previously decided that I would use Visual Studio for a Windows-specific version of my assembly book, so the experience learning to use VS will be somewhat beneficial to me when I tackle the Windows book.  I have yet to decide whether I will use masm, nasm or yasm.  I haven't tried any of them yet, but the deciding issue may be how well it integrates with the VS debugger.  I expect that masm will be better, but I don't yet know.  I would prefer nasm or yasm since they are simpler and I already know enough about them, but masm may get the nod due to utility.


I discovered last night that VS handles console applications like I would prefer using Ctrl-F5 rather than F5.  With Ctrl-F5 it does not use the debugger.  In addition it adds a "Press any key to continue . . . " prompt to the console window after the program exits.  This eliminates the need for using pause or cin.get() or any other nonsense to run a program.

This morning I tried the debugging using VS.  Basic debugging is trivial.  You set a breakpoint on the first line of the main function by left clicking in the gray strip to the left of the line of code.  Then you start debugging with F5.  Use F10 to single step and F5 again when you are ready to complete the program execution.  The debugger shows variables automatically so beginning students definitely should use the single stepping.

I added discussion of debugging and screen shots to Blackboard to document debugging and demonstrated it to my class this morning.  I think this will help them quite a lot.

We've come quite a way since I learned programming with keypunch machines are card decks.  It is far easier to get feedback from the computer now.  I don't really need debuggers much for C++, but I definitely want my students to use one.  I have found the gdb debugger to be critical for learning assembly language.  I don't know if I would ever be so confident of my assembly skills to quit using a debugger.

No comments: