Debuggers...
Warning: the following will be relevant to software developers only. Ignore this post if you aren't one :)
I wish universities offered a required course on debuggers for those in Computer Science program, or at least made the use of the debugger a mandatory task in a heavy-programming course.
Debuggers are fairly simple to use, yet for some reason many programmers still rely on printf statements to do most of their debugging. I think that debuggers course would help students
appreciate debuggers. And, IMHO, that's the key - appeciating a debugger, and realizing that it's usually more efficient than using printfs ! Most students probably don't recognize true capabilities of a good debugger, and how much it can do for them. For example did you know that you can create a watch and have the debugger breakpoint when some variable attains a certain value, or that you can set a conditional breakpoint so that a debugger only breakpoints on a line if a certain condition holds true ? Modern debuggers even allow you to change code on the fly during debugging session - how cool is that ? And in Java, you can connect your debugger to an already running program. Amazing !
So next time you want to insert a bunch of printfs into your code in order to find that nasty bug, ask yourself - "Wouldn't it be easier to use a debugger?" Or, if you are trying to understand a piece of code that you haven't seen before, trace it with a debugger - the learning process will be so much easier !
I wish universities offered a required course on debuggers for those in Computer Science program, or at least made the use of the debugger a mandatory task in a heavy-programming course.
Debuggers are fairly simple to use, yet for some reason many programmers still rely on printf statements to do most of their debugging. I think that debuggers course would help students
appreciate debuggers. And, IMHO, that's the key - appeciating a debugger, and realizing that it's usually more efficient than using printfs ! Most students probably don't recognize true capabilities of a good debugger, and how much it can do for them. For example did you know that you can create a watch and have the debugger breakpoint when some variable attains a certain value, or that you can set a conditional breakpoint so that a debugger only breakpoints on a line if a certain condition holds true ? Modern debuggers even allow you to change code on the fly during debugging session - how cool is that ? And in Java, you can connect your debugger to an already running program. Amazing !
So next time you want to insert a bunch of printfs into your code in order to find that nasty bug, ask yourself - "Wouldn't it be easier to use a debugger?" Or, if you are trying to understand a piece of code that you haven't seen before, trace it with a debugger - the learning process will be so much easier !
Comments
For example you have a complex multithreaded app that runs for a long period of time and at some point during some operation it can crash; it will be very difficult for you to try to recreate such a problem with only your debugger ... often enough such a problem arrises only under extremely rare conditions. In such a case if you don't have logging and your printfs, it will be next to imposible for you to find out what happened. However with good logging you can often figure out the problem just by reading the log entry. This I'm speaking from experience.
Therefore it is useful to know both methods and to find a good balance between the two.
Anyways, you can do everything you've suggested in C++ as well and much more. One good debugger for use in Linux is called TotalView. There you can attach even remote processes! It has good support for multiple processes, multithreading, can lock threads and change the Program Counter in addition to everything you've mentioned.
I don't think that such a course would be good in a good university cause a lot of the features and material can be learned in a few weeks. But I could see something like this being taught in an IT college.
Alex
Also, I would HIGHLY disagree with you with regarding universities not giving students enough opportunity to code! University of Waterloo for example is very flexible and there are enought courses there where you do pure coding, if that is your wish, and there are also some others where you do other things, like design, theory, specs, information system, etc. It is really UP TO YOU to pick the courses you are interested in and learn from them!
I think if a student comes out of a university and can't code then its because he avoided these courses in the university. Also the coop program is highly helpful in providing you with the coding skills you need.
One mistake you are making is assuming that Computer Science == Programming, but that is not true! Computer Science, in fact, is a lot more than programming and is more theoretical then programming which is why there are a lot of options in the university to take the theoretical courses, which I find in general are quite valuable and can often be applied in programming.
In any case you shold not make any assumptions about a general degree such as Computer Science. The proper way to evaluate someone is to have a look at the courses he/she have taken along with other work experience.
I don't know if being a good programmer is the final goal of everyone in CS, but it is something that is not stressed enough in the coding classes. There should be more care to stress good programming practices within these courses.
Basically more care should be taken when teaching the core CS courses to stress the importance of good clean code and how to manage it, maybe the theory isn't enough for students to make the connection. Better tutorials, more emphasis in class, scoring based on these criterias are some ways this can be done.