I am currently teaching a Java course. It is at a community college. The faculty considered Visual Basic to be a prerequisite (apparently, VB has some very limited OO support, although I personally have no expertise in VB). The worst part about this is that a VB programmer can write most basic toy programs by drawing them on the screen. And getting them out of that nice pre-digested world can be quite frustrating.
I really think the students should learn C as a first language. Teaching the syntax plus all the oo stuff is just too difficult (especially in a six week summer course). I would rather have had more time to concentrate on the syntax, and what is going on behind it, than trying to wrap inheritance, polymorphism and runtime binding in with it as well.
What I would really like to do is teach a C course where the last portion of the course talks about OO design in C. Once you've done inheritance in C, and the student understands how difficult it is just to support a simple single chain of inhertitance, then they can appreciate what the C++ and Java language bring to the table, plus they can understand why C++ tries so hard to work with MI whereas Java eschews it.
A real big problem I have with teaching Java as a first language is that the user gets no direct experience with the common data structures. Try asking the linked list loop interview quetion to someone who's never had to implement a linked list. Heck, the Java book I'm using talks about writing network code and windowed applications before even discussing a data type more complicated than an array!
As for assembly language, I learned it before C, but consider this to be optional. I think you can really get some great ideas about how the machine works by deconstructing C code and seeing how the compiler turns C into assembly. This is probably just my predisposition towards embedded development talking!
> My point is that, in fact, C and C++ aren't
> even very similar. A lot of people assume that > learning one means learning the other, or at
> least most of it. It is not so.
C and C++ do share a syntax. The keywords, the arithmetic operations, the breakdown of a line into l and r values, the grouping of blocks using {}. I've found that a programmer who has learned the syntax from C, has only to grasp the fundamentals of OO design to take the leap into C++ (provided the can dump their procedural programming baggage from C). This is how I learned C++, and I can only say I wish I had done it right AFTER learning C.
In this respect, I would almost lump C, C++ and Java (the language) into C/C++/Java. Its when you start looking at the libraries available in Java that it begins to distiguish itself from C and C++. This, and of course, the runtime.
I'm currently teaching Java. Most of my students do not know the syntax, since (not my choice) Visual Basic was deemed as an appropriate pre-requisite. I long to teach them C. I long to teach them about linked lists, memory allocation, non-safe arrays. I cannot do this, we have no common ground on which to tread.
I cannot tell them how nice the library support for most major data structures is, because they have never had to code one for themselves. They could care less about the fact that they have garbage collection, because they do not know what it is like to keep track of these things yourselves.
Perhaps the assembler fans said the same thing when C took off. Still, I think C makes for a nice base for which to begin teaching computer science, as long as more modern programming languages are introduced soon after so the student does not get stuck in the non oo programming model.
I am currently teaching a Java course. It is at a community college. The faculty considered Visual Basic to be a prerequisite (apparently, VB has some very limited OO support, although I personally have no expertise in VB). The worst part about this is that a VB programmer can write most basic toy programs by drawing them on the screen. And getting them out of that nice pre-digested world can be quite frustrating.
I really think the students should learn C as a first language. Teaching the syntax plus all the oo stuff is just too difficult (especially in a six week summer course). I would rather have had more time to concentrate on the syntax, and what is going on behind it, than trying to wrap inheritance, polymorphism and runtime binding in with it as well.
What I would really like to do is teach a C course where the last portion of the course talks about OO design in C. Once you've done inheritance in C, and the student understands how difficult it is just to support a simple single chain of inhertitance, then they can appreciate what the C++ and Java language bring to the table, plus they can understand why C++ tries so hard to work with MI whereas Java eschews it.
A real big problem I have with teaching Java as a first language is that the user gets no direct experience with the common data structures. Try asking the linked list loop interview quetion to someone who's never had to implement a linked list. Heck, the Java book I'm using talks about writing network code and windowed applications before even discussing a data type more complicated than an array!
As for assembly language, I learned it before C, but consider this to be optional. I think you can really get some great ideas about how the machine works by deconstructing C code and seeing how the compiler turns C into assembly. This is probably just my predisposition towards embedded development talking!
> My point is that, in fact, C and C++ aren't
> even very similar. A lot of people assume that > learning one means learning the other, or at
> least most of it. It is not so.
C and C++ do share a syntax. The keywords, the arithmetic operations, the breakdown of a line into l and r values, the grouping of blocks using {}. I've found that a programmer who has learned the syntax from C, has only to grasp the fundamentals of OO design to take the leap into C++ (provided the can dump their procedural programming baggage from C). This is how I learned C++, and I can only say I wish I had done it right AFTER learning C.
In this respect, I would almost lump C, C++ and Java (the language) into C/C++/Java. Its when you start looking at the libraries available in Java that it begins to distiguish itself from C and C++. This, and of course, the runtime.
I'm currently teaching Java. Most of my students do not know the syntax, since (not my choice) Visual Basic was deemed as an appropriate pre-requisite. I long to teach them C. I long to teach them about linked lists, memory allocation, non-safe arrays. I cannot do this, we have no common ground on which to tread.
I cannot tell them how nice the library support for most major data structures is, because they have never had to code one for themselves. They could care less about the fact that they have garbage collection, because they do not know what it is like to keep track of these things yourselves.
Perhaps the assembler fans said the same thing when C took off. Still, I think C makes for a nice base for which to begin teaching computer science, as long as more modern programming languages are introduced soon after so the student does not get stuck in the non oo programming model.