Java as a CS Introductory Language?
First, tulare queries: "I'm currently a student at a small university whose CS students are required to attend two terms of Java programming courses before moving on to other OOP languages. My personal feeling is that Java is clunky, ugly, and runs much too slow on most platforms. The official CS department position is that Java is pure OOP (as opposed to C, for example), and furthermore, Java is extremely widely used at this time. Now, I may be stirring things up a little here, but just because everyone does something one way does not neccessarily mean that something is being done the best way. What I'm asking is to hear reasoned opinions on the following statements:
- Java is a fine development language, and it will help me as a programmer to learn it.
- I'm right. Java is a fad, not worth much more than the Windows OS in terms of quality, and my CS faculty is doing me a disservice by cramming it down my throat.
- There's a little truth in both the above statements."
While on IRC, I was discussing this issue a bit with other editors and Chris DiBona happened to have some thoughts on the matter, his words follow:
When Cliff mentioned that a Java in education story was going to be posted, I asked to weigh in on the topic. I will not talk about the suitablity of using a non-free language, as I'm certain that will be discussed in the comments and is not a trivial issue.I don't think that Java, or any Object Oriented language, would be suitable for an AP Computer science class. I don't think it serves the needs of students looking to fully understand the internal workings of a computer, which is in my mind what an AP computer science course should be directed towards.
C is a language that has been designed to be very close to the hardware, and its ideosyncracies and power reflect that. Through this relationship, C reflects the realities of the hardware your programs run on. Memory management, low level process and I/O control are all things that a computer scientist should understand at a very low level, to better aid in future programming and debugging no matter which language is chosen or inflicted upon said scientist.
In contrast, Java has been designed to take such concerns away from the programmer. Memory management? Low level IO? These are not the droids you were looking for.. (at least not without an RMI written in another language) That's okay too, that isn't what people want from Java and it isn't what it was designed to do.
And that is exactly my problem with it being applied in a computer science course designed to teach CS fundamentals. In short, since I believe that AP CS courses should focus on the low level architecture of computing, Java is an inappropriate language for that course.
When is Java appropriate? In your college sophomore comparative languages course, or, alternatively, in an OO course or two, but it shouldn't be used as the keystone language for any CS program. Please don't take this as me saying that Java is neither useful or important in it's own (non-free) way, as it clearly is. However, in my opinion, It should be considered an adjunct subject to a serious program in Computer Science.
Really, if you want teach students "how to program" and not tie them down to any particulars, which should be the case, then go the route of all the major technology schools, teach Scheme. You can really tell by the end of scheme who are the "real programmers" and who are simply the weekend Perl hackers. I actually started at one school, and they taught C as an intro language. These kinds of schools are designed to feed you right into the IT industry and write code for insurance companies. My other school, when I transferred, used Scheme. Attacked "how to program" from a completely different angle, and actually taught programming techniques, not how to overcome syntax problems. Java and C++ are good second programming course languages, and then only to learn OO programming, now tie you down to learning syntax. I say if you feel your school is trying to teach you specific technologies and not theory, you should probably head else where, if you have some self respect. Scheme is great because syntax is simple, yes lots of parans, you'll get over it, considering it is really the only non alpha character you will be using, you'll be fine, and if you're programming soundly, you shouldn't run into any problems.
Java is like Perl, VB, or Tcl. Nice for high level scripting and rapid prototyping, but too much of a resource hog for real apps.
Besides, C pointers, I've found, makes for a nice way to shakeout the "I wannt learn programming so I can buy a nicer car." crowd.
One of the important lessons I've learned from Java is to program to the interface, and in the same theme but more generally, to keep things extremely modular. The first time I plugged in a new CORBA ORB at runtime, and then again when I chose which XML parser I used at runtime, I was floored. This can be done in any language but I think its easiest with Java.
It is definitely easy to go from C++ to Java - which argues that those learning a C++/Java-style language should start with Java and _then_ go to C++, even if its part way through the course. Why not? How would this be worse than starting in C++ right away? Why tie yourself to any language - choose the right tool for the right job.
Shrug off the mantle of shame, and reject the concept of the One-True-Language.
(And yes, I use and know both vi and emacs.)
Use scheme (or another Lisp-variant) ...
An introductory CS course should concentrate on the elements of programming:
- expressions
- procedures/functions
- elementary design methods: tree structures,
elementary datastructures, recursion (not very well understood by most programmers ...)
To do this efficiently, you should give the student the freedom to think about these paradigms and not about some syntactic sugar ...
'Structure and interpretation of computer programs' by Abelson and Sussman should be used in _any_ CS education.
But of course, the industry needs Java programmers ...
First which assembly language do you want us to learn? x86? 68000? arm?
Let's be serious, you don't want people to know how a x86 or a 68000 works. We are talking about beginners classes here. Sure it's nice to know CPU works but you won't learn programming by learning assembly.
Programming IS about high level language. I believe no one should rely on a specific language to learn programming. You should first learn logic. It doesn't matter which language you have to begin with. People shouldn't ask he question in tose term because it's why people who learns programming with a specific language, then "think" in its language no matter what language they're using.
But You have to be aware that different languages have different philosophy, and hen you should learn to use the language/philosophy that fullfill your needs the best.
". Industries that are network bound (ISP's, ASP's, Portals, etc.) don't really care about how much the CPU is choking because the network is the bottleneck. I have a feeling, once the network is no longer the bottleneck, Java either better get fast quick, or it's going to be going back to C/C++ for speed. "
Not to nitpick, but, as network speed increases, wont processor speed increase, and youll always have a situation where the bandwidth is the bottleneck? Im sure someday we'll all have fiber to our desktops, but at that point my 12000mhz pentium 8 will still not be the bottleneck.
what is WIKIWIL?
Reasons for teaching Python:
* interactive mode
* 100% OO
* functional programming as well
* teach Runtime thinking
* great hooks into all GUIs and COM
* multi-platform
* Python is already being taught in several high schools around the U.S.
Reasons __NOT__ to Teach Python:
* most languages arent as highly dynamic.
Remember: your talking about introductory course for CS. In the introductory you are talking about sorting algorithms, beginning OO concepts, and control structures. Python does all of that and is very elegant. Being able to have people type in stuff line-by-line in a proper interactive shell (dont give me this perl shell exec rubish) is instant gratification and they can explore object behavior.
In dynamic languages, inheritance is simply a reuse technique. You very seldom need to reuse two compeletely different classes.
LOGO is THE best way to learn how to program. Sure it sounds stupid, but I learned logo in first grade, and it set me on a course of learning that led me to be the satisfactory programmer I am today. I am still the bomb at logo, and I challenge anybody to find a better way to teach kids to program. As for High school, what is wrong with VB? Sure it cost money, but MS practically gives it away to schools, and it teaches the fundamentals of both Object Oriented and Procedural programming, and gives the programmer visual design control.
Open source is only useful if you speak computer
At the university I'm attending Java is taught in first year and in second year we do a crash C++ conversion. I've noticed that learning Java has not fully taught people to program - they are largely unable to handle things like memory management and pointers (although the lecturer didn't exactly help that).
My opinion is that the first language taught should be a high level language like Java (not necessarily OO; I get the impression a lot of universities now believe programming==OO) because it makes debugging easier. Debugging is an acquired skill and debugging assembler code is nasty, even for experienced hackers.
However high level languages are usually limited (e.g. Java) and students should be given a real language as soon as they are ready. Java can be very frustrating when you know enough about coding to want features like pointers to pointers and templates and not be able to. Lower level languages also teach other skills like memory management and forces the programmer to understand what is going on under the hood.
I also think that forcing OO down people's throats and forcing them to use it all the time is not necessarily a good thing: OO is powerful but it is also a crutch. There are situations where OO is simply not appropriate (e.g. device drivers) and people need to be able to program without OO as well.
Before the car, I'll wager your child had a tricycle/bigwheel first. And then a bike. And probably skateboards, rollerskates, maybe even a scooter. Only after that did he go to a car.
Well just as pilots don't start with a 747, programming should start with simpler languages to teach basic concepts first.
How can you teach basic loops, functions, predicates, etc, when students have to F**K with trying to create a window, a display context, and waste more time messing with the GUI and other stuff they don't ubderstand yet just to get the output from their fibonacci program? You could give them a template I suppose, but that's a distraction to the novice coder and if he messes up the template unknowingly, it creates headaches for you and the student.
C has 35 keywords with only two (preprocessor #include and printf) needed to write their first program. After the basics are acquired, THEN you can move to Java or C++.
If we're talking about a good starting point for programming, it's usually the same answer as in other disciplines: start simple. Show some of the easy capabilities, and then peel back a layer, so to speak, to show what goes on under the hood.
I agree, but when you need lots of bulk to write simple programs... you're starting with the wrong language. C is not necessarily an "under the hood language". It can be (this is why C scales so well to advanced programming), but doesn't need to be to start writing simple programs.
As a follow-up, one of the huge advantages of a functional language like Scheme, Lisp or ML is that they have a read-eval-print loop. Otherwise, the first thing you have to teach students is how to do I/O, and I/O is always different from everything else. In Pascal and (classic) C, the print statements weren't even expressible in the language!
In a functional language you properly learn first how to compute things and only later how to put them on the screen.
Procedural languages force you to learn how to put things on the screen first, which is a big detour from the important stuff.
Also, functional languages make it easier to learn recursion, which is a key concept in computer science and mathematics. From recursion, it's easy to understand iteration, but the opposite is certainly not true.
This whole thread is the most unfettered stream of horseshit I have seen in a long time. Hardware is software, frozen in metal. Hardware design flaws and crashes aren't nearly as rare as you're letting on, even in mass market CPUs from large manufacturers.
I agree completely. I think C is a nice middle of the road approach for an intro class. Surprisingly, for Slashdot, the Java people seem to be in the majority.
Are people forgetting that most code is still procedural whether it's in a OO language or not. Objects are made up of procedures.
C is a small language that has a good abstraction over the hardware without hiding everything.
C++ and Java are huge languages. C++ is multi-paradigm(procedural, OO, and generic). Java has so many class libraries I would be completely lost if I was just starting off.
The point I'm trying to make is that c is a small enough language that the student can pick up most of the language in a couple weeks, and then the Professor can concentrate on the important stuff - decomposition, modularization, abstraction - without the student being bogged down in the details of a huge language
Lets not forget that most of these students are computer science majors. Why do you want to hide everything from them?
C and C++ more intuitive?
You have to be kidding.
Steve Michael
Yay! Someone talking sense.
I want to weep when I see academia rushing into a "teach one language" model of instruction. A great way to churn out mindles code monkeys, but one can get that from a Dummies book.
Sadly, most of these dicussions are driven less by a concern to give students a grasp of theory, and hence the intellectual tools to deal with a variety of problems in a variety of languages, but a desire to cram the language du jour down the throats of all and sundry (witness the battle to get Python as the "education language").
Really, what language you use in those first few programming classes is a secondary concern. You don't take those classes to learn the language (although that is a side effect), you take those classes to learn the fundimentals of programming, which apply to almost all computer languages (BASIC not withstanding). Once you learn the fundimentals, learning whatever language you need, be it C, C++, Python, Perl, Java, Lisp (not as much, functional programming languages are generally different enough from procedural languages that they require another class to use correctly).
I say, use whatever they are teaching, and if you don't like it then pick up another language. It's a lot easier to learn a programming language than it is to learn how to program.
My only concern is trying to shove too much syntax down the throat of first year students. Full blown OO languages tend to require a bit more typing than something like C for the trivial projects that students do, which may turn off some people (I know in my high school, the Pascal class lost 3/4 of it's slow typers on the second day. Worse, in high school almost everybody types slow.)
I guess you might want to avoid "bad habit" languages as well, like BASIC and possibly Perl. I'd also shy away from anything that the average windows user hasn't heard of like Scheme, Python, Modula II, Ada, or APL. You probabally want to chose something with good free or cheap compilers as well. Ada95 may be a nice language, but your school won't be able to afford the licenses for the compilers under Windows.
Down that path lies madness. On the other hand, the road to hell is paved with melting snowballs.
I read the internet for the articles.
The univeristy of arizona (UofA) has been doing this for a few years (originally w/ java 1.0 I think). The first 2 required classes are all done in java. I don't think this was wholly bad. Mainly because first we didn't have to (and didn't use at all really) the fact that Java is ment to be OO. It was introduced and used near the end of the second class for projects, but not empisized. The other strong point (which the Prof disliked actually, since he was very much an OO person) is that Java has similar syntax to C and C++. The other smart thing to UofA did was realize that java is NOT useful for lots of things too. The recommended next classes were 'Introduction to UNIX' and 'Systems Programming' which was taught in mips32 asm with SPIM and then C. This has changed slightly to emphisize C more as students still had problems doing C well.
All in all, I don't think Java is a bad langauge to use for an introduction, but it should be followed up quickly by C or C++.
It is hard to see what is "S" in "CS" these days in USA. People are expecting to learn "the Language" because so they can get job fast and find their place "in bussinness". I am failing to see anything academic in this. Reminds me of people in local telco, of engineers whose primary function is to understand technical documentation and turn customer phones on or off on management demands. And turn them fast and crafty.
While I don't like Java (I am from Wirth's camp, using Modula-2 and Modula-3 as primary languages, but also C and Java for some projects) I really appreciate qualities Java brings to C family of languages. Most important - Java is high level language with very little compromise - if any. Almost perfect for OOP learning - Sun really had to think public/private/protected scheme better - and tens of timer better for learning than anything C. For learning of concepts and not of tool.
Speed will come in time. I am not using it, but I have every reason to believe in potential of gcj - potential to make as fast programs as are C or C++ ones.
http://opencm3.net, http://www.nongnu.org/gm2/
Out of all of the other languages I have ever studied [including C, C++, TCL, Perl, PHP, Forth, Scheme] Python is by far the easiest to pick up and use right away.
It's something you have to experience yourself to truly appreciate how easy it is to pick up.
If I ever had to teach someone how to program, I'd definitely introduce them to Python first. The concepts are easy to grasp without having to sweat all of the small stuff that could otherwise be extremely distracting and only dilute the main ideas.
I don't know about the department that you attended but the students in mine were in little position to deal with automata theory as juniors, nevermind freshmen. Even then, it was a slow painful process.
Starting out with Turing would certainly separate the men from the boys however...
A Pirate and a Puritan look the same on a balance sheet.
--
Computers are getting faster all the time, but programmers won't unless they can use languages which take care of some of the housekeeping for them. It is this more pragmatic philosophy which underpins Java, not to mention most other modern languages.
--
I would disagree with the statement that AP Computer Science should teach students about low-level workings of a computer. Instead, the AP has always been about teaching a kind of rigorous thinking that can be honed through programming. To that end, I think that the work of Felleisen, et al (see http://www.htdp.org/) to bring Scheme to young students is wonderful. Though personally, I think that a static-typing approach is more useful. I say, teach AP CS in a language like SML or OCaml.
--
The first thing people should learn is how to reason about programs and data. Learning C will teach you about the internal structure of a computer (which is certainly necessery for a well rounded computer programmer or computer scientist), but it will not teach you to write beautiful programs. By using a language that is very high level and expressive enough to describe your problem domain in a rigorous manner, instead of concentrating on details of memory management, and other low-level details, beginning students will have a better understanding of programming.
--
But you miss the point of this discussion and Knuth's motivation in using MIX (and MMIX). Nowhere in TAOCP does Knuth advocate MIX as a first programming language. TAOCP is in no way an introductory textbook, and it is almost exactly the opposite of what a student exposed to CS for the first time needs.
The reason that Knuth uses MIX as his implementation language (note also, that all algorithms are presented also as informal text, and as pseudo-code) is because Knuth wants to reason explicitly (and very thoroughly) about the efficiency of his algorithms, as a result, using a language cluttered with high-level constructs would make it difficult to do exact calculations.
In most day-to-day programming, a big-O analysis of your code is sufficient (90-10 rule: 90% of your running time is in 10 percent of your code... so you shouldn't be extremely picky about optimizing all your code on a first pass... just optimize the critical path once you identify it), and the sort of rigor that Knuth goes through is not as necessery (but it's wonderful to be able to look it up in TAOCP).
In addition, Knuth uses MIX as opposed to some existing language because he knows (see the introductory chapters on MIX in volume 1) that a language-du-jour would almost certainly make his book unreadable in a few generations, so he goes through an extra step of defining his own consise language in which to reason about costs.
(But there is no silver bullet, apparently: a few decades later (ie now), he's in the process of changing to a language that is more in line with what todays computer scientists and programmers can understand (assembly languages on RISCy architectures versus assembly on mainframes)).
--
The CS course I did (several years ago)included a unit on CPU logic design, as well as assembler.
I think it really gives you a good understanding when you get to know how the CPU actually processes the code. Of course, CPU complexity has increased so much over the intervening years, that my limited understanding is far from the whole truth, but I still find it useful.
Politas
As one example, the airline industry still uses mainframes heavily, and on the UNISYS mainframe side of life FORTRAN is still a primary language for application development. The Flight Operations system I help develop for and maintain is almost completely written in FORTRAN. The key to educating a new programmer, I think, is to give them some exposure to several languages. That way, they can adjust to new things (or in our case, old things ) after they leave the educational environment and enter "The Real World"...
--
-Rich (OS/2 Warp 4 and Linux user in Eden Prairie MN)
Mainframe/UNIX Bit Twiddler and long time Windows/Linux Hobbyist.
The Theorem Theorem: If If, Then Then.
Oh, how I agree. In my university:
We were taught procedural programming in Modula 2 -- because it enforces good practice.
We were taught functional programming in Miranda -- because Miranda doesn't let you sneak in procedural paradigms by the back door (although Miranda only really clicked for me after a Lisp course taught by a better lecturer -- Lisp *does* let you sneak in procedural tricks).
We were taught OO using Eiffel -- because Eiffel is a pure OO language that doesn't tempt you into non-OO constructs (as C++ might).
--
This was around 1995, when Java was quite new -- I recall our OO lecturer saying that maybe Java might soon become a suitable language for teaching OO but that it was too soon to tell. In my limited experience of Java, I suspect that it would make an excellent teaching language (I tried to persuade my IT-teaching girlfriend to use Java as her language for teaching programming -- school politics with regard to installing software on the system put paid to that idea).
At university there were no end of students whingeing at the lack of real-world stuff they were learning: one student memorably complained that the word "Novell" was never mentioned in a complete networks. Likewise, many wanted to learn real-world languages such as C (which we did, later). Those people were and are wrong. If you have a good grounding in the theory, adapting to the real world is easy. The reverse is not as easy.
--
But after thought I would have preferred Java as my first language.
Why? Because having it as a first language will give you a good headstart to work on different things later. You can do EJB, learn to use it in depth so you can use it for your first work.
Ok, we are talking about learning but why not learn something that you can use later? Java is strict enough that you can do good OO programing, and a teacher giving you good advices can help avoid some caveats.
C++ and C are good languages to learn programming but very bad ones to learn OO. Which BTW does not mean you can not write OO programs in C or C++
Black holes occur when God divides by zero.
Never Java, and I always thought, "Oh, year, that's like C++ except it's slow and cross-platform". Now I am doing mainly Java (with some EJB) and C++ and I am sad about all the time lost not knowing Java.
Besides, the first language you learn (aside from Basic, mine was C) is very important for what you will really learn. I have been doing C++ because it was a good evolution over C, but let's face it, it would have been easier for me to do all my IA programming in Java instead of struggling with the unreadable syntax of Close and the memory corrupting C++.
By the way, I still consider that real men do it in C++ (but clever ones, do it with EJBs in Java ;o)
Black holes occur when God divides by zero.
... is it vocation skills, transferrable skills based on concepts, or the inner workings of a computer.
If it's about OO programming, I would go with Java. C++ is a complicated language, and doesn't force OO. In addition, C++ will also distract from learning OO as the student will have to fiddle around with other unrelated implementation details, such as make files, wierd linker errors, etc. If you're learning OO, spending most of your time learning a specific language is rather silly (and C++ can be a very time consuming language to learn).
Personally I prefer learning the concepts and transferrable skills. I can apply these in many situations and they will last longer through out my career. The practical stuff I can learn on the go, and I doubt that school will ever be able to teach that sufficiently anyway.
do they use "american" (standard qwerty) keyboards and change the keyboard layout combos to support the additional characters
...Actually, both, assuming you're only talking about Western European languages. Usually, non-US keyboards have three extra keys, an extra bucky bit key (often labelled AltGr), and extra glyphs on the remaining keys. Accents are usually the result of pressing a dead key (i.e., a key that doesn't cause the cursor to move) and the letter you want to place the accent on. Most of these keyboards use the standard QWERTY layout for the letters; AZERTY has already been mentioned elsewhere. Punctuation and other characters rarely follow the US keyboard layout.
If you don't have an ISO language-specific keyboard, though, you can simply change the keymap to provide additional functionality. Windows provides the US-International keymap, which changes the right Alt key to AltGr, and the quote/doublequote, backtick/tilde and 6/circumflex keys to dead keys. Using AltGr on various keys generates additional characters that cannot be produced with the dead keys alone. More recent releases of XFree also have a us-intl keymap that's almost a clone of the Windows one, with a few slight differences. In my experience, this setup is a lot more efficient for programming than using an ISO keyboard.
In Soviet Russia, Jesus asks: "What Would You Do?"
Those who want to use assembly for a first language are obnoxious gits who get off on sadomachism; it's HARD to learn the principles of programming when you're fighting the system. Sure, it may turn out higher-than-average quality students, but that because all of those who didn't already know what they were doing (or couldn't find a mentor) bailed. Even with all the concepts of programming and decent coding habits, folks still find that assembly code isn't their cup of tea. Assembly as a first language should be considered 'education by attrition'.
C is pretty close to assembly (it's been called a high-level assembler -- indeed, if you disable optimization, you can put blocks of assembly statements into a one-to-one correspondence with C statements), and therefore suffers from most of the same flaws.
Those who want to use C++ aren't much better, and are perhaps slightly more sadistic. C++ is far too complex, ugly, nasty, and error-prone to inflict upon someone who's trying to learn how to program.
Pascal is a good first programming language. It's restrictive enough to offer structure for the new programmer, while expressive enough to solve the sorts of assignments one finds in introductory courses. The biggest complaint about Pascal is that it is "too restrictive", but that's an asset in a first programming language -- it provides motivation for the student to learn _other_ languages. Once you know Pascal, learning C isn't all that hard, and the additional freedom of C is exciting, rather than frightening.
The problem with Pascal these days, it seems, is that more of the implementations are wrappers around p2c, which means you have all of the old C problems cropping up in unexpected places (try naming a Pascal procedure 'main' and then compile it with p2c). Thats simply not nice.
Other good first-languages might be scheme, or forth -- powerful enough to get across the basic concepts, but with enough motivation to learn *other* languages. (In fact, scheme AND forth are good languages to learn by CS students
Alas, Pascal, scheme, and forth are all 'unpopular' these days, and are no longer considered 'reasonable' languages to learn first.
Smalltalk would be a great first language, but it really requires a good mentor, and/or a group of people interacting closely, in order to explore the huge library of existing classes. This might not be a bad way to learn a language, but it's kinda hard to test the concepts.
Which leaves Java as the natural replacement for Pascal/Scheme/Forth. It's politically acceptable, and it's not as bad as the alternatives (especially C++ -- which was the other "serious" contendor[1]).
There's nothing wrong with learning more than one language -- in fact, it should be a requirement. If you can learn the concepts, then learning a reasonable language shouldn't be difficult (if it is, you didn't learn the concepts very well). I don't thing that CS should be a 'learn a language for a job' kind of degree -- that's what Tech schools and the IT track in the Business school are for. A CS graduate who can't explain what an Automata is, or why O(n^2) is better than O(2^n), or provide an example of when you'd need a mutex....is nothing more than a fraud.
[1] I taught two semesters of "Introduction to Programming" using Java. The alternative was C++[2], as Pascal was being "phased out".
[2] C++ sucks. I've done enough programming in the language to come to the conclusion that every major design decision was chosen poorly, or was forced by previous design decisions. You're better off writing structured programs in ANSI C.
Pick One: http://www-rohan.sdsu.edu/~stremler/sigs/sigs.html (Note - disable Javascript first!)
Today's students will probably do thir best work in a language similar to Java, but with better support for the things that Java is bad at. This language does not yet exist at all.
It will use many of the same language features that languages that currently exist have, though, and this is what it is worth learning. Of course, its features which are currently available are available in different languages, so it's important to learn multiple languages.
For OOP, I think that Java is a good tool. Possibly Scheme would be better if you wanted to present the full range of possibilities, since there are theoretically significant features that Java lacks (e.g., singleton instances). Of course, in order to be particularly good programmers, people need to know more than just OO concepts, and that means they'll need to learn a language that's good for teaching those concepts.
In practice, currently I would suggest C for actual programming, including OOP, unless you need platform-independence or you need libraries that exist only in another language. But I wouldn't want to try *teaching* OOP with C; you really want to have a language where the OO syntax is obvious and explicit.
It's not the language's fault if the idiots you work with don't know what they're doing. Maybe you need to find a new crowd.
The first real language used in the CS curriculum (the first class uses a made-up language that theoretically has no compiler or interpreter) is Java. The reason is simple: Java is OOP without being obstructive about it (*cough*Smalltalk*cough*), and it's a pretty good language. The theory goes that it's easier for students to learn OOP first, then learn procedural (and functional, etc.) programming. In my experience, this seems well borne out... most people I know who learned procedural programming first really struggled (in some cases, still struggle) with OOP. Those who learned OOP first had no real problem picking up procedural.
I think a lot of posters here are ignoring the fact that no sane human would teach an entire CS curriculum in one language or even one paradigm. It's also worth noting that we're not talking about teach a language so much as we are about using a language in the course of teaching computer science concepts. Maybe it's the GT student in me, but I find that an important distinction.
I've mostly forgotten Java. I've also forgotten a lot of C specifics, and I can barely remember what little C++ I learned. Smalltalk is something I'm happy to have dropped from memory. I once knew BASIC, I've seen some FORTRAN and some COBOL, and at some point I even knew MOO.
I've forgotten most of these languages because I can. When I sit down to read them (as I occasionally do) or to use one (as sometimes happens), it takes me little to no time to get back up to speed and get to work. The reason is simple: I was taught the ideas that form the basis of computer science and of computer programming. The languages were just tools, and still are.
I could understand this if you were actually using C or C++ in a procedural manner. This type of step by step programming is much more intuitive and conducive to learning.
:)
Other than that, there's absolutely nothing about C++ that is more intuitive than Java!
There are already tons of implementations of the JVM and the Java compiler, in case you hadn't noticed. Sun has a very very extensive language specification published, and anyone is free to implement it, no strings attached.
The trick is that to make Java useful for most things, you need the very extensive libraries that are copyrighted by Sun.
But this is just the same thing as C#, isn't it? C# is made to bind tightly to the Win32 API set and to .NET. Having the C# language standardized will mean relatively little if all of the API's that C# code depends on are not standardized. And Microsoft has *always* laughed at anyone who suggested that they should 'standardize' their API's.
- jon
- jon
Ganymede, a GPL'ed metadirectory for UNIX
I think smart kids will handle the transitions to more difficult languages okay. Programming in BASIC involved 'taking too many things for granted', perhaps, but every new language you learn should have something new to teach you anyway, or else why bother?
- jon
- jon
Ganymede, a GPL'ed metadirectory for UNIX
After having applied to several universities for Computer Science admission, I then toured around Ontario (Canada) going to look at each university. I had read in the various information booklets each university sent me that they're "keeping up with the fast-paced industry of tomorrow" or some synergetic BS like that. In order to do this, they now use Java almost exclusively when dealing with programming. Although I have no experience with Java, I found this fact odd. I was sure that C, or even C++ would be beter suited for the task of general programming references and what not. Java seemed more like something that could be a second, third, or fourth year elective.
SO, wanting an answer to "Why Java?", I thought I'd ask the Profs. of Computer Science while touring the University of Waterloo - which supposedly has the most superior CS program in the Country, and is world renowned (which I feel is grossly over-exaggerated). So I ask the profs "Why Java?", and they quickly respond "Because that is where the industry is moving." I immediatly knew I didn't want to go to U of Waterloo (which was later reaffirmed by the math nerds charging into the auditorium singing "m-a, m-a-t, m-a-t-h, math rocks!")
Anyhow, I figure any university who teaches something primarily (and it must be primarily, since that was their first and only answer) because the "industry" is doing it, is a university unworthy of my time, energy, and hard earned dollars.
I say forget about the fucking industry. Teach me the fundamentals (which I don't believe Java is the proper tool for), teach me the theory (see previous parentheses), and I will adapt. You don't need to be taught to use Java - or any other language for that matter - to know how to program. Understanding the language, its syntax, and other characteristics is trivial. It's knowing how to properly design a program and decide which tools are the best to implement your solution that matters.
This approach of Java because the industry is doing it is indeed a disservice. Maybe not to those of us that have experience going into university, but to other students fairly new to programming or even computers in general. Using Java all the time will produce graduates who think Java is the best and the only way.
I find it difficult to believe that industry is moving into Java a whole lot. I have yet to see a large Java project/product. I find it difficult to believe that any business would overlook other languages if an applicant knew Java. And I would find it very difficult to believe that any business would hire a graduate from an establishment that teaches Java because that's the direction in which industry is moving.
-kidlinux.
Yep, but if you're writing assembly without having the datasheet available for the target CPU, then you're immediately onto a losing proposition, and you might as well stick to C...
"The invisible and the non-existent look very much alike." -- Delos B. McKown
I'd argue that unless you understand assembly, you don't fully know how registers work. I haven't had to write any assembly for over 10 years, yet with every single line of code that I write, I'm thankful that I could if I needed to. I'm sure you're a very competent programmer, but empirical evidence from 20 years of coding shows me that without fail, coders that don't know assembly are unable to progress beyond competence into true greatness. Not that greatness is actually needed for 90% of coding tasks, but nonetheless, those with a background in assembly are without fail better coders.
As for when it should be learned, I disagree that it should be a first language, but it should be mandatory in any CS course at some point. but
"The invisible and the non-existent look very much alike." -- Delos B. McKown
As I see it, University (College) is about education not about industrial training. You shouldn't be taught specific tools at university rather you should be taught theory.
Many people see it this way, and I can understand it to a certain degree. But you should also consider that learning a programming language to a level where you are REALLY productive and wont regret what your wrote 6 months later takes years. I think I reached this point in Java after 1-2 years (fulltime programming), C++ probably needs much longer - I cannot claim that I reached this point.
IMHO C++ is no language that is easy to learn, but if you are are writing software 40 hours a week you will soon appreciate its large feature set (and maybe even the compact syntax). Java's lack of features like templates/generic programming, macros or multiple inheritance has both advantages and disadvantages. The advantage is that the language is small, easy to learn and it does not have any features that an inexperienced or tasteless programmer can misuse.
The disadvantage is the lack of expressive power resulting of this. Basically Java encourages Cut&Paste programming, which is a maintanance nightmare, a major error source and the root of all evil.
In Java you cannot write something once and then use it for different types, so you start copying the code and modify it slightly for each type. In C++ you can write it once and use templates.
The same problem is code that repeats itself only with slight variations that cannot be expressed with functions. This mostly occurs in regression tests, and can easily done with macros in C++. In Java you will start to copy&paste...
When people need multiple inheritance with several non-abstract classes in Java they start to implement an interface and copy&paste the code. Sometimes this is also done using a code-preprocessor, like some CORBA implementations did. In C++ you just multiple inheritance.
"I've had some conversations w/ friends of mine about this very idea. I think that assembly should be the first language taught in CS. To be a skilled programmer, you MUST know how a computer works at the fundamental level. Teaching java to beginning programmers only encourages sloppy programming, despite any admonitions from profs"
And if tomorrow a new CPU is released that doesn't have a von Neumann architecture? How does the person whose fundamental thinking processes w.r.t. application developement were structured by assembly adapt to that?
Personally, I would go a step farther. One of the reasons that ordinary human beings have so much trouble using software is that the programmers are far too close to the details of the machine architecture.
sPh
I have to disagree. It's important for the new coder to be able to do something and have it work - few things are as discouraging as not being able to get anything to run, at all, especially for younger kids.
It's important to give them some positive reinforcement right away before saddling them with the complexities of having to manage their own memory, build their own hash tables, etc.
I'm not saying those things are not important to learn, they are, but it's like learning to swim by being tossed into the deep end of the pool. Better to let them take baby steps into the shallow end and then work their way into deeper water as they get more comfortable and skilled.
Anyway, count this as my vote for Python as the intro language.
I rather think the issue is do people want an introductory language for computer science or an introductory language that is going to be useful for getting jobs as programmers (software engineering, development.)
If one is teaching the pure theory side of OO, then something like Smalltalk is going to make more sense, perhaps. (Depending on what you want to teach, theory-wise.) C/C++ would be the worst because they are closer to the machine/hardware.
If one is teaching for the more practical/engineering side, then C/C++ and/or Java is going to make more sense, depending on your perception of where the job market is going.
I've had some conversations w/ friends of mine about this very idea. I think that assembly should be the first language taught in CS. To be a skilled programmer, you MUST know how a computer works at the fundamental level. Teaching java to beginning programmers only encourages sloppy programming, despite any admonitions from profs.
I learned Eiffel as my first OO language, and it rocks, ok it's slow a little even to compile when you are 50 compiling a program on the same server at the university :) :)
After that I learned C++ and WTF is this language? it's not a OO language, it's just a language with classes added. I remember the first C++ compiler was just C++ to C translation, and a normal C compiler was launched to compile the code.
Now I do pure C and I love it
--
"Science will win because it works." - Stephen Hawking
...mainly because Ruby's OO model is dynamic. (Perl's is, too, but as a "first language" it is problematic.)
Much of this "Ask Slashdot" seems a little unfocused: Some people are answering with the assumption that a "first language" is a CS major's first programming language, while others are assuming the class will be attended either primarily or partially by those in other disciplines.
To me JAVA makes sense for the second case, but not for the first. With a good IDE, beginners can get up useful programs with a basic understanding. But it is not a language I would ever choose once I knew the others (OK, in certain cross-platform environments, maybe) for really tough projects.
Ruby breaks through this barrier because it works for beginners who really need a glue language without limitations (Python, Perl or Ruby) as well as for people who are going to be pushing the limits of OO before they are through with their careers.
But the Ruby book (linked in the parent) demonstrates a problem with using OO for new programmers: Which comes first, the OO chicken, or the basic programming egg? How do you teach what OO is without having some basic commands to demonstrate it with? And how do you teach basic commands in an OO language without doing it object-orientedly?
I don't think this problem is insurmountable. But it may be more important than choosing a language. (In fact, the object-oriented ZOOs so offensive to Steeltoe may be failed attempts to do this.)
The final question which needs to be addressed by people deciding about JAVA in first-year classes (or Ruby for that matter) is: What PRECISELY do you mean by "object oriented"?
Perhaps because I have been around so long, I see OO as a dynamic concept. It has changed over time and really only reached its maturity with the publication of Design Patterns. I fully expect it will change still more in the future.
Some languages (JAVA, C++ and Python) take a very accurate snapshot of the current thinking on OO and implement it very well. Other languages (Perl and Ruby) assume that OO will evolve and give you the ability to implement as much of object-orientedness as you'd like.
An interesting question is whether aspect-oriented programming (boy, do I hate that name) will become a part of object-oriented programming or whether it will be considered a separate paradigm. Ruby is the one of the few languages that implements aspect-oriented concepts (like mix-ins) and it also allows programmers to choose where they want to work on that spectrum. (You can ignore aspect-orientedness, you can use the features offered by the language itself, or you can modify its aspect-oriented features into whatever becomes the next definition of the new paradigm.)
All of this makes it an excellent choice for the CS majors starting a basic class which needs an OO language.
One drawback with Ruby (which may actually prove a boon to beginning CS majors) is the lack of a large library like CPAN or the C libraries. Although it is growing, the Ruby Archive is nowhere near as comprehensive as CPAN. While this may be occasionally frustrating, it offers CS majors a good way to make a name for themselves. (There's nothing like applying for a job and finding your prospective employer uses a module you wrote. Voila! Instant reference.) All you have to do to make a name in the Ruby community is go to CPAN, find a module which has no counterpart on the Ruby Archive, and port it to the Ruby idiom. Of course, if Ruby fizzles, that still won't get you a job. But at least you can tell some Perl employer you know the module well enough to port it.
Eternal vigilance only works if you look in every direction.
I'll agree with that. Procedural programming teaches the basic concepts fairly well - and makes a good starting point for learning OO stuff later on down the road.
I started learning how to program in BASIC back when I had a brand-spanking-new TI994A. I was about 5 years old. All I really got out of it was the ability to really mess with the TRS-80s we had in grade school.
Then I started picking up a bit of C. By the time I was gheaded to college, I had a fairly good grasp of the basics. Pointers and the like were still a bit confusing, but I was at least comfortable with if/else, for, while, and various variable types.
I'd also started down the road of *thinking* in terms of procedural language - which i believe is the biggest stumbling block new programmers have - not being able to conceptualize and break down a problem into pieces that can be programmed.
Intro to programming in college _was_ C, so that worked out well for me =) Learned a lot more about pointers - a _lot_ more.
Left college when the money ran out - started dabbling in HTML and Perl. Eventually got myself mixed up in MySQL and PHP - which led to my current job as webmaster for a small but growing and suprisingly stable startup.
Languages I use today (ranked by usage):
Perl
PHP
::grin:: )
No C, other than side-projects of my own. I'm spending a lot of spare time getting up-to-speed on C++ (mainly for the OO stuff), and have considered Java, but haven't gone there yet. I'm pretty sure my next language will be Python.
With a background in C, I picked up PHP and Perl without too much of a problem - I'm sure the same can be said of moving from C++ to Java. I haven't quite figured out where Python fits into all this yet (that's part of what intrigues me about it
I disagree strongly. A CS program should teach several languages, and the issue of whether those languages are popular or not should be irrelevant; rather, the languages should be chosen to be the ones that best facilitate the teaching of the particular course. A non-mainstream language actually has a small advantage for the first year intro to programming course, since it means that few students coming in will already know it and be bored out of their skulls.
I agree that one of the languages learned during a four year CS should be strongly mainstream (probably C, the current lingua franca of computer languages), but if a four year CS student can't pick up several languages during that period, something is wrong. In my alma mater's CS department, computer science students learn four new languages during the second year alone (Eiffel, C, Prolog, and MIPS assembly) for the required classes. In third and fourth year, which are all electives, most classes require learning new languages as well. With a strong foundation on a good teaching language in first year, upper year CS students should be able to learn new languages fairly easily.
Python makes an excellent language for teaching beginners. In no way should its lack of popularity be held against it in that role, save possibly the lack of introductory CS textbooks using it.
I can't believe I'm saying this ( after a fair amount of time spent cursing the titanium-strength type system ) but Ada isn't a bad choice for teaching programming concepts.
Upsides include a strong and explicit type system, verbose and readable syntax, free implementations via the GNAT system, and good support for programming in the large concepts.
Now I'm aware of the downsides, and a lot of ppl feel that a basic programming course should use a language that's lower level (ie C). But I'd think a Programming course would focus on the abstractions of programming, and the underlying architecture issues should somewhat seperate.
BTW, I'd be leary of C++ as an intro to programming. The interactions in C++ can be subtle and nasty - I got bit by a lot of unexpected behaviors when shifting from Java to C++. I think Java makes OO cleaner to read and understand, despite it's shortcomings WRT other languages.
Anyway YMMV - some things I'm glad I only have to learn once - C++ is one of them.
Oh, and BTW Ada's relative obscurity these days makes it a level playing field in a classroom filled with ppl with diverse backgrounds.
----- My opinions are my own, etc, etc.
For a long time, I've thought that it might be fun for the students to learn programming using robots. Students would write software that reads data from stdin and writes to stdout, and controls a robot that moves around in a virtual environment.
The idea here is that the hardest part about freshman programming courses is not the material, but rather getting the students motivated to learn. By making it fun, creating a challenge, and perhaps offering a small prize for the best robot, I believe that students will learn the basics of the language much quicker than by writing mindless menu-based "hello, world" variants.
Additionally, by using stdin and stdout to control the robots rather than a specific API, students who already know a language can use that language, and students who don't already know a language can learn the one that is being taught in class. And it doesn't really matter which language is taught; C/C++ would probably do just as well as Java, or Lisp, or perhaps even Ruby.
One such environment is RealTimeBattle. It's written in GTK, so it should be reasonably portable (though I don't seen any Win32 ports on their webpage). There are a number of other variants out there, too, including GNU Robots, though that uses Guile for its language, so it's not as flexible.
Java is possibly one of the best tools for teaching programming. Note that programming is radically different from "computer internals". That's the kind of stuff you should cover in other classes spanning much more time than one or two classes.
First off, I spent a lot of time in college working in the computer labs and helping other students debug programs. Some of the biggest problems these students had was with pointers. Java, of course, doesn't have them. This is ideal for learning how algorithms work. See, students shouldn't care about internal pointers and stuff. Debugging and run time errors in Java are great! By default, the JVM will tell you where your error is at run time.
** Martin
I am certain the same outcry was heard when folks switched from Pascal (what I learned in CS in early 1990's) to C++.
My advice to you: get over it. Even if Java is a fad (which is not), its operators and control statements are so much like C and C++ that once you have mastered one of them (like Java), switching will not be terrible. You should spend your time learning how to solve problems using software and not get hung up on the details of a particular language.
Or forget everything I just said and do everything in LISP.
--
"In the land of the brave and the free, we defend our freedom with the GNU GPL."
"You're gonna need a bigger boat." - Chief Brody
I've been teaching "Introduction to OO" and "Introduction to CS" for some time now. Here's my personal view on this matter.
The basic question is this: "should introduction to CS be taught in OO or non-OO languages?"
My answer is a resounding yes. I believe many of the readers of Slashdot had first learned programming in line-numbered BASIC (like I did), or in Fortran, or C. Does this mean anyone learning programming should start from low-level concepts and advance to high-level ones? If you decide to begin in low-level concepts, why C and not assembly? Sure, from an industry point of view, there's no much point in programming in assembly, but if you want students to be close to the machine and understand how it works, it is a better choice.
Naturally, this is hardly what you want from first-time programmers. Starting with OO is a better choice.
The problem is, most of us learned OO programming after we have mastered procedural programming. Teaching OO programming to people with no programming background requires a certain shift of viewpoints. It is not "There are no functions, only member functions", but rather "The state of the program is represented by objects. Objects have methods, i.e., operations that can be invoked on them." And so on.
When taught properly, OO is not more difficult to teach to beginners than procedural programming.
The next question is, "Which OO language should we teach first?". Ideally, I think the answer would be Eiffel. However, none of the places I taught in (including the Open University and IBM Academy in Israel) gave me that option. What people find acceptable is either C++ or Java.
C++ is evil. Twicely so for beginners. Yes, I know I will be flamed for it, but this is my personal opinion. Java is so much easier to teach, and use. It is so much easier to find bugs when array index bounds, for example, are tested with every array access. This is true for experienced programmers, and ten times as true for beginners. It is so much easier to think about algorithms when you do not have to think about memory management. Again, this is true for experienced programmers, and ten times as true for beginners. And so on.
The main downside of using Java, for beginners, is the needless complexity of reading input from System.in (a.k.a. "stdid"). My personal solution to this problem is that at the first stages, the students simply write programs that accept input from the command line arguments (only). Using System.in arrives only later. I find this approach superior to the "black-box" approach some other tutors are using ("This is how you read input from the keyboard. You'll understand it later").
- Tal Cohen
> Pascal was good because it had constraints, and was well structured.
Of course, a part of this is that Nikolaus Worth, the creator of Pascal, actually designed it as a teaching language. The original compiler was supposed to be pen, paper, and the student's mind. As such, it's a great language for teaching structured programming.
Pascal's successor, Modula-3, was more designed with OO in mind.
I think Ruby would be a better first language. It has a more normal (C like) syntax. It has the power of perl It is fully object oriented. 1.to_s() works (try that in java) Its available for Windows and Linux.
-- Linux Consultant
Well, that's been the British practice throughout most of Britain's higher education...and it cost them dearly, historically speaking. A brit (Perkin) created (by accident, he was looking for artificial quinine) one of the more important inventions in the modern world (the coloured dye, which eventually led directly to plastics (also a coal-tar derivative)), and the British culture of "higher education isn't something someone does for work" pretty much through that head start right down the drain...the winners in the new chemistry technologies were the Germans, where education WAS considered something for the practical. In particular, color plating and color photography was a German invention that the Brits might have had a lead on otherwise...(Source: James Burke's Connections)
But as I said (and I was talking about American Universities, where the competition to get in can be harder at times, 'cause it isn't practically set-in-stone by some test one takes in the 4th grade...or do the Brits still do that?)-- the Balance is what's important. The theory languages are good for teaching good programming and design and all that, but there's no reason that the practical, business-hyped languages should be ignored -- teach BOTH of them and you've got the prime candidates for a fresh-outta-college job.
--
You know, you gotta get up real early if you want to get outta bed... (Groucho Marx)
"But remember, most lynch mobs aren't this nice." (H.Simpson)
-- Joe
If a BALANCED education, in liberal studies as well as the field of industry one intends to specialize in, wasn't important, then college wouldn't be important and the american tech industry would all be based around people who are "Computer Learning Centers" graduates.
I'm not talking about higher-education being 100% directed to getting the job, but it is almost 100% NECESSARY to get a good job, especially in the IT industry. Just having a head full of theory and languages that one will never use again (and liberal studies along the way) is NOT going to necessarilly be useful in the competition to get a decent job (competition that is increasing in today's .com-deaththrows) -- some experience (classroom is usually enough) in practical languages used in the modern world is also important.
Companies won't take a "generic c.s. grad" without practical experience in a language that company uses -- they'll only take the "exceptional c.s. grad".
It would be nice if we were all exceptional and all could just study the finer theory of things, but its not that way -- schools don't get 100% exceptional students (not even the ivy league), and their curriculum should reflect that and provide means by which their average students are in some ways prepared for getting jobs in a competitive market. Teaching practical programming languages like Java, C++, Python, Perl are means to that. A smalltalk-educated student will have a learning curve to learn Java that a company may decide isn't worth paying for when another candidate already has Java experience. They'll only take the smalltalk one if his overall record is exceptional as well.
--
You know, you gotta get up real early if you want to get outta bed... (Groucho Marx)
"But remember, most lynch mobs aren't this nice." (H.Simpson)
-- Joe
Yes, Java has the ability to "bypass" good OO design (as does C++), but if the teacher makes the programming assignment conditions include not using those proceedural cheats, then the student MUST learn the theory too, and walks away with both theory and practical application.
--
You know, you gotta get up real early if you want to get outta bed... (Groucho Marx)
"But remember, most lynch mobs aren't this nice." (H.Simpson)
-- Joe
Remember I wasn't talking about those who "learned Java", but those who learned Java as part of their university c/s program who will have a slight advantage over those who didn't. Read between the lines, people, I didn't say "java programmer" meaning "one who only knows java" -- i was referring to the c/s grad who knew java as well as all the rest of what normally goes into a c/s degree (as opposed to the one who only had theoretically "correct" languages that aren't used as much in the real world, like smalltalk or eiffel). sheesh.
--
You know, you gotta get up real early if you want to get outta bed... (Groucho Marx)
"But remember, most lynch mobs aren't this nice." (H.Simpson)
-- Joe
Nice sentiment, but regardless of the "ideals" of education, when one gets out of college, one expects (screw that -- NEEDS) to get a job, and given two straight-A students, one with a lot of theoretical-application languages under his belt, and the other with not so many of those, but having known Java since his freshman year, the recruiter will pick the Java programmer, 'cause it means his company can save money having to train the programmer.
And any University with a reputation for letting the education get in the way of future employment for their students is gonna start losing students quickly.
Its nice to "learn", but the truth is that since the 1960s and the G.I. bill, one goes to university because the degree is a requirement for getting a job, not to "learn". And that isn't gonna change anytime in the near future.
The theoretical and the practical-for-today's-world should be considered hand-in-hand. I value the theory I know from my C.S. degree very highly...but I wouldn't have gotten the good job I wanted without having had C++ in college.
--
You know, you gotta get up real early if you want to get outta bed... (Groucho Marx)
"But remember, most lynch mobs aren't this nice." (H.Simpson)
-- Joe
Largely due to a misguided OO-fad pressure, university CS departments forgot their reasons reasons against C in the first year and adopted C++. The argument often went "but it's a relevant language, and industry wants it!" Thus academia, like many companies at the time, made an unprepared mass transition to C++ (in the mid-90's more than 67% of departments used C++ in the first year). Thus the pedagogical issues with C were compounded by the added complexities and pitfalls of C++. Worse, virtually none of the new C++ instructors had any clue about how to leverage the OO paradigm whatsoever. At best, they taught "Modula-C", and at worst you got students in senior level OS classes asking "do I need to write a class for this project?" Finally, the faculty teaching higher level classes in these departments generally didn't retrain either. What many CS students don't realize is that a good four-year program isn't just a disconncted collection of classes. The students should be gradually ramped up in their design and implementation skills throughout their program. But the faculty suddenly had a design (non-OO vs. OO language) and language (via gross misunderstanding of C++'s tools) disconnect with the students. Disaster.
Beyond all that, there are specific reasons to choose Java over C++ as a first year language. First: C++ has no object library, Java does. Yes, now after many years, it sort of has the standard template library, but for anyone with experience with languages like Smalltalk or Java, the STL is too little, too late. If you need further convincing, take a look at Brown University's first-year program, and what the students are able to accomplish both from a pedagogical standpoint and from a look-what-I-made! standpoint. The first year is run by Andy van Dam (yes, of Computer Graphics fame) and is a fantastic model for excellent OO instruction. Also check out University of Virginia's program -- and if you can get the opportunity to hear Jane Prey (on the Board of Directors of the ACM's Computer Science Education SIG) talk about their program, take it!
I taught a variety of CS classes over a period of several years, and was (am) very interested in the best techniques available for teaching our the mathematics and engineering of our discipline. All of this experience suggests that the introduction of C++ to the first year created a *major* problem for Computer Science -- I'm glad to finally see it phased out for a clearly better language.
My first programming language was C, using a great book I found abandoned in the detention room when I was in high school. It was called Beginning with C, and it was definitely geared towards beginners. It had a whole chapter on the hardware aspects of a PC--cpu, memory, i/o, etc--and then went slowly into the language itself. The book was really good at teaching how the syntax and functionality of C goes almost hand-in-hand with what's actually happening in hardware. And its this point that languages like Python and Java miss when used as a teaching language. I started with C and went on to learn scores of other languages over the years, from VB to Perl to Python and Java. And I guarantee that each was that much easier to learn simply because I had a solid understanding of how things worked internally. I certainly think that OO has to be part of any good CS program, or at least introduced in an AP class, but it definitely shouldn't be the cornerstone of one.
Perl - $Just @when->$you ${thought} s/yn/tax/ &couldn\'t %get $worse;
Is it possible for an entire topic to be a troll?
In scientific computing, speed is paramount. Most people use fortran. Many would like to get away from fortran because it's over thirty years old, and has none of the nice features of newer languages. But for non-CS people, C++ is not something you pick up on a whim. C++ is by far the most complicated language around. The world of scientific computing, I fear, will be stuck with fortran forever because of its lower learning curve, and because of the fact that The bastards have stopped teaching C++ altogether. Java, while nicer in some regards, does not easily lead to picking up C++ (mostly, I think, due to templates and STL). Taking an intro java class and using fortran works though, because the language constructs needed for fortran are few, and certainly contained as a (small) subset of java.
So I think teaching java is a horrible turn of events for we mere mortals. It has too many variants, is not (and will not be) standardized. And most importantly, most places only have one language class. That language should be the one that is most common, and contains enough language elements to allow people to easily transition to most other languages. Going from C++ to java is easy. Going the other way is nearly impossible.
Maybe when more compilers correctly implement the C++ standard the situation will improve. These days it's very hard to compile on different platforms because different vendors implement different subsets of the standard. That, and they have to make STL errors readable. A newbie is not going to sift through a page of horrible looking errors from a single template mistake, just to find that none of the errors tell him what (or where) he did wrong!
--Bob
1^2=1; (-1)^2=1; 1^2=(-1)^2; 1=-1; 1=0.
Java most certainly isn't too slow or resource-hungry for most applications. If you look at the typical code generated by your average Java programmer vs. your average C++ programmer, you'll notice that the Java code will be faster and better to maintain.
It also isn't necessarily such a bad education tool. You could go into the inner workings of the JVM, look at the bytecode, the stack-based architecture (very useful model in CS) and garbage collection strategies (Lisp or Smalltalk, anyone?).
Its use as an education tool, rather than an applied programming training course, is questionable though. C++ certainly isn't a very nice model. Smalltalk would be a lot more interesting to study as a 'pure OO' language. C fills the gap between high-level OO-languages and bare metal assembler nicely. The entire range should be taught, using fairly appropriate educational languages. Hey, there are schools out there that teach BASIC and COBOL, and I bet there will be some that teach C-blunt, so don't slag off Java...
You shouldn't look at it so much as what language (singular) you should teach, but what languages (plural). Jave is a great language for an intro course, because it removes some of the stumbling blocks that make C/C++ difficult and frustrating for the student, while letting them concentrate on the basics. (Ie design, thinking abstractly, implementing an algorithm.) It doesn't matter that it is too slow/bloated/lame base classes/whatever. That isn't the point!
By the time the CS student graduates, they should have experiance with a wide variety of languages... after all, the programming language is just the tool you use to get the job done. Even if you go on to get a job working in just C, you'll benefit from being exposed to other languages. The student should see everything from assembly (at a minimum, write some program involving recursion in assembly), to functional languages (ML), to lisp.
--Rob
Amen.
As part of my CS major, I took courses using Turing, Ada, C, C++, Scheme, Prolog, 80x86 assembler, 68k assembler, and assorted toy languages for various other purposes. To make things even more interesting, not all languages were taught to us. Some profs spent a few weeks on a language while others would hand out a page of notes and expect you to pick things up on your own. We also had to deal with the various Unix flavours that we used depending on the course and what terminals we could get a hold of. Having to port to the profs reference platform induced some serious last minute assignment panic on more than one occasion.
Largely because of those experiences, I don't consider platforms or languages to be an issue. If I need to learn a new language to make something happen, I learn it.
People worry too much about programming languages. They're tools. Use what works and discard what doesn't. Emotional attachment to a tool is an unhealthy sign.
c.
Log in or piss off.
I have to agree. (Though I'd add Lisp and Forth (or PostScript) to the list just to round out the programming paradigm experience.)
For those of you old enough to remember life before OO, remember how the early OO advocates were fond of smarmily remarking that OO required an entirely different way of thinking, and was therefore a big jump from procedural/imperative code? That runs both ways. Now that the schools are producing people who never wrote a non-trivial program in a non-OO language, I'm increasingly having to work with people who have severe mental limitations when it comes to problem solving. Procedural-only programmers tend to create tight but obscure and hard-to-maintain code. OO-only programmers tend to create overcomplicated, overengineered code. The best programmers I know can handle both design methodologies, and their code tends to be efficient, modular, clear, and easy to maintain.
There is no knowledge that is not power.
--
Proud member of the Weirdo-American community.
I Have taught three CS1 classes at the university I went to, two as an instructor (coteacher) and one as the "head" teacher.
My experience says that for CS1 you have to choose a language that completely hides away computer internals and focuses on syntax and semantics. Having to deal with hardware complexity is too much for the first class. Remember that a surprising amount of those taking the class have never ever used a texteditor before.
IMHO the best language for teaching CS1 is python. This is a very well designed language that makes you do stuff with very little hassle. The first CS1 class I taught was using python and it worked brilliantly.
The two others I did were using Java and this is somewhat harder. Take a look at a hello world:
public class Hello {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
This is a disaster compared to the python
print "Hello World"
All those who are crying "any skilled programmer must know the internals of a computer -> force them to start with C or assembler" are wrong because this attempts to teach everything at once. For a CS1 you should be happy just teaching every basic construct of normal (imperative) programming languages.
I don't believe OO is a good idea for the first one either, because noone can truly appreciate OO before they have a course on OO analysis and design. So hold the OO to this course.
in lumping C & C++ together? is it just because they have similar names? C & C++ are as different as C & Java, yet you never see
"wanted: C/Java developers"
"my favourite language is C/Java"
if you mean C, say C. if you mean C++, say C++.
or lets just rename C++ as D.
Why is it that many people who claim to support standards have such atrocious spelling and grammar?
That being so, my prediction would be that OO courses as a groundwork for programming would discourage students from pursuing the 'science' in 'computer science.' People say it's difficult to go from procedural to OO -- imagine going the other way! And more than one contributor to this discussion has stated outright that he/she does not want the programmer 'tainted' with the procedural paradigm. In other words, in the OO mindset, ignorance is the preferable state.
It seems to me that a lot of the push toward OO is based on the hidden premise that OO makes it possible for dumber people to be competent programmers. By straightjacketing the programmer, it not only 'frees' the programmer from issues like memory management and hardware manipulation, it 'frees' him or her from the necessity of thinking deeply about the processes he or she is invoking. I'm not saying that OO programmers are dumber than procedural programmers, I'm saying that most of the reasons given for preferring OO (such as above) in fact lead in exactly that direction.
From the standpoint of the market, this makes sense. Every business will be glad to pick up a programmer more cheaply. But, I don't think it makes sense in terms of the serious student who wants to become a programmer. Most individuals who become race car drivers start out with their heads under the hood, working on their own rods. They know cars inside and out. I think that is a good metaphor for the experience of mastering computer science (or any other discipline). You divide your time between cursing under the hood and grinning behind the wheel. Eventually, you wind up in control of the wheel and give off the cursing to someone else. Who, mayhap, will follow in your path.
mp
"The secret to strong security: less reliance on secrets." -- Whitfield Diffie
Java is a good primary language to teach in MIS, but not as a replacement for C/C++ in CS. Most CS-type work will not be done in Java. Much of the new MIS work, traditionally done in Cobol, will be done in Java if newly implemented.
You can't get more object oriented than Smalltalk. The IDE is what all the CASE and developer tools want to be when they grow up.
The only systemic failing that Smalltalk has is that contained objects only know about their containers if they are explicitely made aware and passed in a reference at instantiation time.
Java is a wanna be. C++ is even worse. The rest of the languages and development environments are left standing on the shore.
Use Smalltalk. You can find a free version at http://www.squeak.org/
Go try it out. But be warned, you'll be utterly spoiled by it.
MSBPodcast.com The opinions expressed here are my own. If you don't like 'em... Think up your own stuff.
To add on to this little subthread another fine thing that makes learning with Python nice is the interactive interpretor. Don't know how something will work, exactly? Fire up Python and just play with it until you understand it and then plop it into your script.
-- Grey d'Miyu, not just another pretty color.
*I* took it a couple of years earlier, when it was taught using scheme. The professor sucked (Sam Kamin, you suck. How you were chosen to replace Friedman as CS dept head, I will never understand.) Luckily, I had a decent TA (Ian? I forget) and managed to pull one of the few A's in that course.
While I have not used Scheme since, or any other functional language, I really feel that I gained much useful knowledge about recursion and programming in general from that, my first programming course. It was followed with a poorly done, 1 credit hour class in C++, where we really learned C for about 2/3 of the course and C++ for the last part. I think that if the C part was better done (every programmer should be exposed to C and to C++), the sequence of Scheme and C would have been an excellent introduction. Perhaps throw Java in on the side for a later introduction to data structures class, so that there are ready-written data structures to use for instructional purposes. Teaching Java as a first language just seems very bad to me, though. I don't approve of teaching VB as a first language, either, for similar reasons.
By the way, "brmiller", how've you been? :)
our graduate TA's like java since the classloader lets tudents write their projects as a class that gets accessed by an autograder. Java can resrict us from cheating by preventing the loading of certain classes, etc.
Simple 100% OOP (vs. C++)
Good strings (Pointers, malloc(), static sized arrays all suck)
Widely used
Cross platform
Free
Extremely comprehensive cross platform base libraries
Uhh, we need more CS/CE majors, not less.
fool! parallel algorithms may also non-terminate.
Maybe we should have two curriculums.
Computer Science would be all about algorithmic entropy, Turing theory, quantum computing, reversability, information theory, artificial intelligence, and all that theory-side stuff which makes great researchers but poor developers.
Software Development would be all about languages, methodologies, OOP, OOA&D, design patterns, administration, databases, and all that practical-side stuff which makes great developers but poor researchers.
Then, if you're in one major and want to know a little about the other, you take a minor in the other.
I guess all that means my opinion is that in the CS curriculum that we have today, if you want to teach the fundamentals of computers, start with computer architecture. Then move to Java for the knowledge that will serve you well in industry.
At my school, the University of California, Santa Barbara, all CS classes start with Java.
The first two courses you take are Java, then you move to C/C++.
As a teaching language, Java makes a lot of sense for introductory languages. Here are some reasons:
1. Compilers are free (no cost) and are available on Windows/Mac/*nix. This is in contrast to C and C++. Using a free C/C++ compiler on Windows is a pain and there is no such thing on the traditional MacOS.
2. Almost all the machines in my CS department are Suns. You don't think Sun would give you a deal on hardware if you promised to use Java do you? This happens all the time in CS departments.
If the first thing you saw in CS was pointer arithmetic, would you be scared? I'm sure a lot of people are. Java insulates that a bit so you can get a handle around OO without having your mind totally boggled...
The Java API is pretty complete, which helps learning basic concepts without having to roll your own all the time... This is good at the beginning of the learning process...
JavaDOC is great. The whole API is thoroughly documented. I have yet to find an STL doc that is as good as the Java API JavaDoc.
Basically, I think that Java is a good starter language but there is NO EXCUSE to neglect C/C++.
-Hunter
RateVegas.com - Vegas Reviews
There are a few practical concerns about teaching that the students, and others, do not often take into account. First is the question of accreditation. Universities, in order to be taken seriously, must be accredited by a recognized accreditation organization. Otherwise, Joe's University would be handing out Master's Degrees via email. Wait, bad example, I get those emails all the time. Of course, the degrees are not worth the ink in the email. Since our accreditation requires that we teach at least two high level programming languages, we have chosen to do the first course in Java and the second course in C++.
Java - Enforces object-orrientation, simplifies the process of learning object-orriented techniques by abstracting a lot of the details. We get their feet wet with Java because with applets, the students can see dramatic results quickly. It helps also that the syntax is very similar to C++.
C++ - Now that we have taught them a strict object-orriented language, we turn them loose with a language that not only makes it easy to shoot your foot but often encourages it. At the end of both courses, students have two languages that are suited to different tasks.
Once those languages are out of the way, students move into Data Structures, Assembly and Operating Systems programming. Most of our courses after the "Big Five" programming courses, are not targeted to a specific language and the student decides the proper choice for what they are doing. In fact, even the Data Structures and OS programming courses are pretty much non language specific.
Often people try to focus on learning a specific language. In a university, we strive to not tie anyone to any specific language or architecture. Our job is to teach concepts, theory and practical applications of knowledge. We offer courses that provide tools for students to use the the quest of that goal. It is up to the student to decide what is best for them and for their particular need. If, after the first couple of courses, we only allowed people to program using Java on a Sun UltraSparc 10, we would not be serving our students well. On the other hand, the same applies if we only allowed them to use C++ on a Redmond box.
I often tell people that I cannot teach them Java or C++ or any other language. I have around 45 hours of lecture per semester and have class sizes of 80 students. I can facilitate their learning Java; however,in that time frame, actually teaching them the full capabilities and intricacies of a language is impossible. I teach loops, conditionals, classes, methods, arrays, inheritence, abstraction, events, exceptions, etc. I use Java to faciltate that teaching because it handles all of these things in an elegant and efficient manner.
Many attempt to look at the first CS course as a language course when it really is not. It is a concepts course and helps to aclimate new students to life in a university computer science department. The language is chosen to meet specific goals, one of which is to meet accreditation requirements. The other, more important, factor is to provide a language that facilitates the learning of what is needed in the first programming course.
Java matches our goal in the first course. It does not clutter things with referencing and dereferencing of pointers, it does not allow the student to break object-orrientation, which is one of the primary concepts we teach. We allow them to shoot their foot in the next course.
So, in closing, the language of the first course is important in that it is what facilitates the actual things that are taught in that course. BTW, check out This article about MIT's "Rethinking CS101" project. Very informative.
--- This is my sig. There are many like it, but this one is mine. ---
Setting his threshold to 5, Sparky eliminated most of the trolls on /.
First you take intro to Java (if you need it, most don't)
Then you take data structures in Java (which ultimately becomes GUI construction techniques in Java, despite how hard they try.) People who have never programmed fail since they either are A) not fast enought at GUI design or B) cannot comprehend the idea of the linked list.
Then you take functional programming in scheme. People who can't handle recursion and functional thinking fail.
Then you take computer architecture, in which you write MIPS assembly and design a CPU. People who at this point still can't understand what a computer _really_ does, fail.
From thereon you advance through stuff and less people fail out. I think it's probably a decent system since there is a steady drop-out rate, as opposed to people doing computer architecture or scheme first and everyone jumping ship at once. The first two Java classes basically get you warmed up in coding and try to get you thinking about data relationships and stuff.. things which are very important when doing scheme and even when designing a CPU. The data structures class, if taught in C or any other language, would have the same purpose and would not delve into the things Java does automatically like memory management. CS classes are not about learning the language, they're about learning the theory and concepts behind using the language. You eventually do learn the things that are absent in Java like MM, but they are taught in a different context, on the hardware level.
--
So, have they bothered with a 'select'-like statement, or is it still 3000+ threads for a server with 3000 cllients?
IMHO, Java is NOT industrial strength. It is fine for many things, but for what I want to do, C++ is still it. It will never be as fast as C++. All those nice run-time optimizations being applied to Java work for C++ too, if anybody would bother. Of course, since C++ is generally tons faster, nobody has yet.
As for worrying about all that icky memory stuff. I want to worry about it. My programs are faster and better designed for it. I think it would be highly amusing to plop down a Java programmer in an environment where careful memory management was crucial to successful execution. They wouldn't know their heads from their arses.
It's possible to do memory management in Java, despite the garbage collector, but it isn't as easy, and nobody feels they have to with the nice, warm, fuzzy garbage collector wrapping them up.
I think Java is fine for many things. I've watched its development and maturation with interest. I actually made a good stab at porting JVM beta 1 to my platform (UnixWare). It's just not the wonderful be-all and end-all language you make it out to be.
It also makes me extremely nervous that Sun still has such tight control of it.
Need a Python, C++, Unix, Linux develop
The main advantage of Java over C and C++ (and the reason why C and derivations are discontinued as teaching tools in my university) is it's relative platform-independence. When you want to test the programs that people have written at home, it's a real pain in the ass to get their Borland C++ programs running under Linux, you know. This disappears with Java.
If you are teaching anything other than strict ANSI C, and using anything other than GCC (so you can give it to the students) or to be platform specific as most are (VisualC++) this is a non issue.
sorry, but if you allow any student to turn in anything that wont compile under GCC or visual C++ then you are doing that student a dis-service.
Do not look at laser with remaining good eye.
Personally, if you want to teach core computer operation then you need to say away from any OO language. There are many many programmers out ther that have no clue how the hardware works. (What registers are you using for that math operation? I know, we don't have to anymore! but that is no excuse) If you look at software in general over the past 12 years we have steadily went from applications that do the job to bloated monsters that do 90 billion things that 90% of the customers don't want. now add to the fact that the code is bloated as hell because we don't have to be careful anymore.. (256Meg is standard on a low end pc now... why should I actually delete that meg of unused code?) and now with processors at insane speeds we dont even have to optomize anything anymore.... A standard bubble sort can be used and noone will be the wiser because that 866mhz computer waits for the Hard drive or ram longer than it takes to sort.
we either need to kick all the CS "professors" out of the colleges or smack them in the heads, because all they are generating is sloppy programmers that write sloppy code and use sloppy techniques. The best example I ever witnessed was a CS professor proclaiming that embedded processors would fade away because they weren't powerful enough to run a program that was compiled from an OO language.
Whatever..... Many of my non-OO, C programs fit in less than 2K... and if I need speed I use assembly, a language you have to learn on your own now.... and was my first introduction to programming in college (assembly,fortran,basic,C/C++ was the progression bac in the olden days)
but then I work with computers that have a maximum of 64meg ram to use as system ram and filesystem, and operate at 66-200mhz sometimes without FPU....
Do not look at laser with remaining good eye.
As someone who uses many languages in the course of the day, Java included, I might be able to offer some information.
This is dead on. I wish that I learned OOP properly in college. Learning C and other procedural languages actually hurts you in the early stages, because you have to unlearn tactics.If I were teaching someone OOP in college, I would start with a "pure OOP" language, such as Python or Java, and a book similar to Design Patterns. I sure wish I learned this way.. Design Patterns came out after I graduated and it pretty much changed the way I thought about OOP overnight.
That's not to say that C++ doesn't have its place. It can be fast, and it can be very flexible. However, in an academic environment other priorities are simply more important. Garbage collection is key. Trust me, you don't want to be up all night tracking down a memory leak when all you need to do is implement a certain algorithm. Also extemely important is a free, cross platform development environment. (No, C++ isn't as strong here as java or python due to library implementation differences). I consider C++ a very dangerous language to start learning with because it's so easy to slide back into C. Until you get to the point where you can understand what the consequences of that are for your project, it's a giant boobytrap waiting to snare the unwary.
This is a very popular but shortsited viewpoint. Java is stronger than it has every been in the past. It's still in heavy growth mode, with more libraries and extensions being developed for it than I can keep pace with these days. It's going to continue to evolve for quite some time. As the JVMs continue to improve in performance, and CPUs continue to double in speed, the performance difference between Java and C++ is going to become less and less. It's already at the point where I run large java applications like Jext (thank you very much Roman Guy!) on my pentium-III 600 without any noticable slowness.Java is a very good investment. It's not the best OOP language in every area but it may be the most well rounded. It's certainly not going away, and you can get a lot of useful work done with it.
Java seems to enjoy better support for the corporate world than from the open source community. This is largely because Java is so useful to corporations and they're ready and willing to develop and pay for enterprise class extensions that most lone hackers would consider boring or overkill. Java isn't a zero sum game, however, and there is plenty of room for free software to thrive. I'm glad the the Apache crew recognize this- their Xerces XML parser and their Servlet engine are excellent, excellent examples of free java software. www.gnu.org also lists a large number of useful java libraries and applications. The time is ripe for someone to bring Kaffe or similar free JVM / library up to speed.
If you do decide to get into Java, I would recommend you learn python as well, and then use the embedded scripting language jython (www.jython.org) from within your java apps. It's a killer combination.
The trouble with Python is that it isn't a mainstream language. A CS program should really only teach a few languages, and as such the ones that are taught must be choosen carefully, and be fairly mainstream. That means that in order to cover the biggies (C/C++ and Java) there is a big incentive to use one of them for the intro. As I pointed out, both are fine, except that people tend to shove all of the OO crap onto into programmers when they use C++ or Java, and that C/C++ require pointers and memory management. If you can avoid the bad bits, both will work fine. It's easier to avoid the OO in Java than it is to avoid the OO, pointers, and memory management in C/C++, and therefore Java is a good choice.
Now, I really think you must agree that Python is NOT a mainstream language at all. Very few people know it compared to Perl, Java, C/C++, or Pascal. Heck, there may be more old Cobol programmers than there are Python programmers. It is a nonstandard, rarely used language. If you teach it as the intro language, you have taught your students something that they may not use much again, as nobody else knows it. You then also still need to teach them a "heavy" mainstream language, and may not have time (even in 4 years) to teach them another mainstream language.
Don't get me wrong, I am very impressed by Python. For my high school CS class, for a final project me and a friend wrote a fully-featured MUD. The teacher was worried that it was too much to chew, so to prove that it could be done, my friend did in real quick in Python. It took him 12 hours.
Together we spent the next 4 weeks to not quite fully reimplement it in C++. That says some bad things about C++ and some good things about Python.
Until Python has many many more users, though, I don't think that it is a good choice for an intro language. On the other hand, if someone is considering learning Perl, Python is a very good alternative. (BTW, Perl would be a terrible learning language. New programmers need structure, and while it is possible to write pretty Perl, it is way too easy to write very very ugly Perl).
Da. Stimmt. Very true. You are very right that variables, flow control, functions et al. are what are important.
The problem is that most CS departments don't like teaching languages. Therefore they must use a real (read: very powerful/widely used) language (C/C++/Java) for the into courses, so that later on, when students are doing more real-world things, they already have the language skills to do it.
Now, the first programming course I took (in high school) was a semester of C, then a semester of C++. Personally, I think that this is one of the best ways to go. C doesn't have any of the fancy OO stuff. It encourages you to use loops and function calls. It isn't some "pure" language (Smalltalk = pure OO, Lisp = pure functional, etc), and can therefore be used to teach a variety of styles. Porcedural-type programming is the simplest thing for a beginner to understand, but they do need to be introduced to recursion and OO too. C is a fairly solid, usable, simple language and allows such.
OK, now for the disclaimer. I said simple. There are 2 topics in C that are not simple, and I wish that there was a version of C where they were unneeded. Pointers and memory management. A lot of people find learning C difficult for the simple reason that pointers and memory management are confusing complex topics, and very integral to effective use of C.
Disclaimer part 2: I said usable. Another problem with C is that you can't do neat shit with it right away. Beginners want eye candy. They want to do something impresive, without too much difficulty. C is bad at that. No fancy graphics. No easy network code. None of the nifty things that other languages make fairly easy and removed from the hardware. You say that libraries aren't important for the first 3-6 months. I'd revise that to say teaching libraries isn't important for the first 3-6 months. But if you can provide some code that lets your students easily do something cool (they write maze-solving code, you write a graphical frontend for them), then they are more likely to stick with it.
Given that, I think that Java isn't that bad of a choice. Yes, Java is OO, which is a count against it as a teaching language. But it is garbage collected. It also has no pointers. These two things are very very nice for an intro language. I know that when we started pointers/memory management in HS, we lost 1/4 the class (and they had to take a drop). At the semester (where there was no drop penalty) we lost half again. The lack of these difficulties makes Java a very tempting choice. Also, Java has all of the eye candy one could possibly want, and then some. Yes, it isn't good to teach all of those fancy libraries to beginners, but giving them code that lets them use some of the fancy stuff is good encouragement.
Now, Java is OO. Most people teaching it as an intro language introduce the OO features. This is probably not good. But just because it has OO doesn't mean you have to use the OO. So there is some magic "public class fooclass{" stuff around all of your code. And instead of "int main(){" you have "public static int main(String []..." garbage. But you can still pretend that it is functional, or procedural, or whatever. Like C, Java is a hybrid language.
So, you say language features are unimportant. Fancy features are unimportant, but the simple features of
- Garbage collection
- No pointers
- Hybridness
make Java, IMNSHO, a decent choice of an intro language.Oh, and I'm not talking entirely out of my ass. My first CS course in high school was in C, but the intro college course I took was taught in Java. CS 101, while it did focus more on OO than I thought healthy, was a very good intro class nevertheless. The labs had a lot of provided code, and then ask you to fill in simple methods for it to work well. Overall, an excellent course, if a bit slow for someone who already knows how to program.
I guess it sums up that Java isn't a bad language to teach in, but that you need to teach it correctly (no OO, no libraries) for it to be good.
Well, no wonder you don't feel comfortable coding C++ anymore. :)
"Do you expect me to talk?" "No, Mr. Bond. I expect you to die!"
Highschool and/or intro to programming classes should start with the basics of how a computer works, some theory, and into to a couple different languages. I'd suggest short stints in C, PHP/SQL/HTML, and Python to start. Then after the intro classes you can take a more in-depth approach and add things like C++, Java, and Asm.
At what price learning? At what cost wisdom? The price is a man's peace of mind, and the cost is his life.
Programming languages that try to make programming to easy tend to be slow to use and a lot more work in the long run than just learning to program well. Programming in human-language is painful. You'll find the human language very unspecific. You often won't get what you meant. It's at least as bad as using visual programming techniques.
At what price learning? At what cost wisdom? The price is a man's peace of mind, and the cost is his life.
Therefore, I now prefer either more systematic languages like Eiffel, or script-like languages like Python - the first for their higher level of abstraction and cleaner design, the latter for their greater ease of use and wider field of applications.
I completely agree. Eiffel was the languaged used in a year-long algorithms and data structures class I took last year. One of the things that I took away from that (other than that ISE EiffelBench is a fucking annoying compiler) was an appreciation for the clean, simple syntax that Eiffel has. In particular, its method of handling inheritance is a dream.
And as for Python, it's up there with Eiffel on my favourite-languages list. Automatic garbage collection and indented syntax? Awesome. Once you code in Python for ten minutes, you'll get over the lack of braces. Besides, braces are just yet another annoying C-ism.
And BTW, over here in Germany the high dependence on symbols such as {} or [] or /**/ is a didactic problem in itself because these aren't so easily reached on a German keyboard.
You really should consider getting a better keyboard. I mean, if you do any amount of programming, you should be using a keyboard that makes programming easier, not harder. You could probably pick up a generic US keyboard for cheap, or maybe look into one of those happy-hacker keyboards. I've heard those're nice.
I know it's a heretical stance to take, but I'd say that to teach OOP concepts, a visual language would be best.
It took me a while to get my head round OOP in the first place, but working in windows, when you can instantly show the subclassing of a textbox into a purple textbox (for instance), it's very easy to get the basic concepts across to people in a non-abstract manner. Having got those concepts across, it's then very easy to move onto non-visual languages and apply the concepts you've learnt.
_____
My Journal
Secondly, this is exactly the point of high(er) level languages: To eliminate details that are better solved by the machine, or previously by someone else.
Yes, it is, but I question whether schools should make programming too much like driving. Consider this: drivers who understand the workings of their cars are always better drivers than drivers who understand "wheel turn, gas go." Drivers who understand how the car works understand why you don't accelerate the car by flooring the gas pedal. They know why you change your oil periodically. Their cars last longer and work better.
So it is with programmers. Those who know how the machine works know why memory allocation is slow, and reusing blocks of memory is faster than allocating new ones. Those who understand the preprocessor know why defining a frequenly used value or code block will produce faster code than those who only know object fields and functions. People who understand low level operations recognise good programming practice better than those with experience only in high level language because they've had to. Their code is more reusable, more readable, faster, and less prone to bugs.
Back when I was an undergrad, different sections of Intro Programming were taught in a variety of languages. Different engineering departments allowed their students to take different languages, but the only section that all of the engineers could take was 2/3 Pascal and 1/3 Fortran. It was definitely a weird combination, but I thinked it worked out pretty well. Learning 2 languages right away makes it easier to pick up other languages on your own later. Plus, Fortran was still (and probably is still though C/C++ are making some headway) the dominant language for engineering/hard sciences.
So anyway, Java might work OK, in some of the situations above, but I'm not sure that having a particular language that is the dominant one taught in introductory classes is the best option
--
Preventive War is like committing suicide for fear of death. - Otto Von Bismarck
FORTRAN continues to be a valuable language in science and engineering. It's worth knowing if you're a scientist, although an interactive system such as MATLAB or Mathematica is probably better suited for exploratory use. For heavy-duty number crunching, FORTRAN is still an excellent choice.
As far what is better Java, C or C++, it really depends on your application. I would not right an OS in Java, but C or C++ would be better as both could give you far greater speed improvements. JSP is a good way to go for writing web applications, and if it ever gets standardized (hint hint sun Microsystems) then it could be even better. Certain applications Java is not well suited for, but others it is great. Anywhere where speed is a real issue, C is better.
I don't want a lot, I just want it all!
Flame away, I have a hose!
Only 'flamers' flame!
Toot my own horn here. Toot toot.
C first. Yeah, yeah, assembly: I think it is more valuable to teach something closer to a paradigm students can cope with before you go that low. Show them the C, then use -S to show them assembly as you teach it to them. Use Motorola assembly: I learned 6800, 68HC11, 6805 (? I think) and there's 68000 or 68040 as well. Show them MIPs assembly and let them use SPIM. After using C, the students will have more appreciation for seeing translations of their code. Stay away from x86 assembly, or just use a tiny subset: shit, how many instruction weirdnesses does x86 assembly have anyway? Stack-based floating point? Eewww! No one uses x86 for embedded or real-time work, anyway.
Have them re-write some of their C stuff in assembly. Look at compiler-generated code w/ various optimizations to really make the idea of optimizations like loop unrolling sink in. Make them write an OS in assembly (hell, I did it) to teach them about hard stuff.
Also, C plays nice with pretty much every other language, and you can get compilers, debuggers, editors with nice syntax support, stuff like lint, and all kinds of crud as support. Everyone knows C: you can ask your grandma for help with your code. In addition to support, multi-language programming is much easier w/ C and other stuff (Ada or Fortran, not so much Perl from what I've seen): Ada has pragmas, and Fortran just does the Right Thing.
Then damage them irrevocably with C++. Don't get me wrong, I like C++ in many ways, but mother of God, that's one big ass language. Some of the problems you can run into with virtual functions and templates and similar things are just plain *hard*. You will learn to DESIGN programs first with C++ if you want to avoid killing yourself later.
Also, if you're actually going to teach C++, and not just C w/ classes, you need to use the STL. Hell, I'm just getting deep into that now (on my own time: we never used it when I was in school) with the 'STL Tutorial and Reference Guide (2nd Edition)', while reading Bjarne's 'The C++ Programming Language' at the same time, and it could almost give you nightmares. So not first, but you *need* to know C++.
From what I've seen, Eiffel is cleaner, and might be good as a teaching language, but I'd prefer to teach straight from what students will eventually use.
Next, you teach them Perl. The syntax will make them cry, but you can slap them hard and then them home to work on it. Once they've learned to use hashes and are beaten with 'use strict' and 'perl -w', they will understand the power of higher level languages. Dunno Python, but the idea of a white-spaced conscious language sends shivers up my spine. My God, how will vim find the beginning of a block? Pretty-printing embedded in a language? Shudder.
Java is not for use in the kind of work I do: we do real-time simulations and low-level systems work. I've read a little bit from an old copy of the Tiger book, and maybe in the world of commercial applications it would be useful, but for bespoke work like happens here (we're a hardware company), it's useless. Hell, we have to squeeze speed out of our systems anyway we can.
Smalltalk is an excellent social skill ;-)
The language smalltalk enforces most of the OO paradigm. It suffers from the same gross mistake as Java, no multiple inheritance. MI is not needed very often but when you need it you should not have to resort to various clunky workarounds
Try Eiffel it supports and enforces the entire OO paradigm.
What does widely used have to do with good teaching :-)
C++ is probably the most widely used OO language, but it sucks as a teaching language.
C is the worst teaching language one could think of and not even appropriate in the context of OO programming.
VB is extremely well used but it's debatable if it is an OO language (or even a programming language
Smalltalk enforces the parts of OO that it supports so it is an OK teaching language.
Eiffel supports and enforces all parts of the OO paradigm and is an excellent teaching language despite the fact that it is not videly used.
The University of Illinois at Urbana/Champaign has been using Java in the introductory CS class since the spring term of '98 (when I first took it... before that they had been using scheme). The first portion of the class (at least back then) dealt with basic programming syntax and how to do loops, etc. Then it moved on to the OOP philosophy and started dealing with classes.
The course homepage for CS125 is: http://www-courses.cs.uiuc.edu/~cs125/
The next class required of CS majors is CS225, which is a data structures class taught in C++. The first couple of days of the class are spent going over the difference between C++ and Java (most especially stuff on pointers), and then later they move in to data structures and algorithms.
The course homepage for CS225 is:
http://www-courses.cs.uiuc.edu/~cs225/
He said, "You'll be able to tell your grandchildren that you helped assemble the first NT supercomputer," and I cringed.
At UCL, where I am a postgrad, the CS undergrad course migrated a few years back from teaching Miranda (a functional language), C++ and MIPS assembly to just Java and MIPS assembly to the undergraduates as their programming languages.
What they have noticed is that the students are much less competent programmers now than they were before.
This has been attributed to the over-emphasis of OO design to the extent that it is hard for the students to see traditional flow of the programs.
They are considering restructuring the course again.
However Java offers what very few languages do. That is "write anywhere", "run anywhere". Students can write programs on their own machines and run them on any of the department's machines such as Linux, Solaris, Irix, Windows. These programs can have GUIs, can use TCP/IP, can do lots of things that require platform specific libraries with other languages.
So students can write much more "interesting" programs with Java without worrying about platform problems.
But they don't learn about memory allocation and more important deallocation, and how to pass parameters (and how parameter passing works) etc. that they would learn if they were taught C.
I would advocate students learning assembly, C, how to write a compiler (and so learn what actually happens when they write a program), and then for software engineering purposes to use Java (they should be able to learn it themselves once they go through an OO course).
The very things that make Java so useful for getting work done, are the things that make it a bad choice for learning fundamentals. Use a lower-level language that has pointers, doesn't have garbage collection, etc. C, Pascal, or even assembly would be good.
---
As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
I started out with C and then moved to C++. I never was able to master C++ to an elite level. I was always blown off by its complexity.
I was just about ready to give up until I came accross perl. Perl was simple and easy to learn. I quickly got good at it and started going into more advanced OO perl programming. Now, I have a great perl job.
I believe I do better starting out with a simpler language and with limited tools than with a more complex language like C++.
But this is just me and I know I'm not the only one out there. It's not that were too stupid to learn it's the way we are being taught is wrong.
I know Perl is slow like Java so I focus on my algorithms to improve speed and I make it modular to work with others and to reuse code.
I'm a better programmer because the language is simpler for me to learn and grasp.
So I'm sorry for the C++ guys here but I agree with the Java crowd here. It's better to start with a simpler language than with a complex one.
"If a show of teeth is not enough, bite
Some people will only take one or two programming courses in their college careers. These people need a course which teaching them what programming is about. Java has some very nice features which can give people an introduction to programming.
CS majors will take other programming classes. C and C++ are appropriate for more advanced work. Introductory students shouldn't need to know about pointers in order to write programs. There is plently of opportunity to learn about the internals of computers in more advanced CS classes for those with the inclination.
Many of the points raised in the other posts just don't matter in an introductory class: inefficient, know more about the hardware, used more often. Jave lets people write basic programs that tell people how to make a computer (in fact many different kinds of computer) do something -- anything -- in a language that has some real world applications and is not just a theoretical exercise. That's all that counts. And Java fits that bill.
I have discovered a truly marvelous sig, unfortunately the sig limit is too small to contain i
I'm sorry, but I don't consider AP CS a very valuable teaching tool for learning real computer science. APCS is a total load of crap. It teaches a fluffed up curriculum with little to no real applicable value. This is why most colleges don't accept AP computer science credit, because when you learn AP computer science, you learn little more than the syntax of APs version of C++. I imagine it will be the same with Java. I learned 2 years of AP computer science from a "Teach yourself C++ in 24 hours" book. This doesn't say I knew anything about writing halfway decent code, just that I could write shit that ran in some form (and I made an A in the class and a 5 on the AP test.)
AP, in its current form, doesn't even really get into OOP in C++. Inheritance, virtual members, pointers to functions, derived classes, etc. aren't even covered. It basically just brushes over the fact that "A class is a struct with data hiding and functions." The first year of AP Computer Science barely introduces structs, much less basic concepts like FUNCTIONS.
Doug Lea (well known C++ programmer and writer; teaches at SUNY/Oswego)
Kevin Sullivan (U. of Virginia)
A couple of less positive articles from Australia.
An article at O'Reilly.
Stupid job ads, weird spam, occasional insight at
Part of the problem with C++ is that you can cheat. What I mean, is that you have already done C then you can program in C++ without really taking advantage of any other object orientated programming techniques. Java on the other hand is a much more orientated language and since it is portable you avoid platform specific issues. Java also provides a rich API for doing many different tasks, so this not only helps in learning to program but also in accessing different open APIs.
Smalltalk is the real object-orientated language and the reference to them all. The only problem with Smalltalk is that it is percieved to be a dead language, though this in academic environment is not always a bad thing.
When I was at uni I was taught prodcural, functional, object-based and object-orientated programming. One thing that I got out of that is that there is no such thing as an ideal language. You have to look at the task at hand and decided which approach works best.
At the end of the day the best language for the job depends on what your target is.
Jumpstart the tartan drive.
The majority of "programmers" use visual basic, so it is probable that the majority of programming jobs also use visual basic. Also C and C++ are two distinct languages, making the jump from C to Java is no more difficult than the jump from C to C++. Also UW does not run a trade school. And finally Java is more accessible than C++, easier to find install etc.
Woe be on to them, all who rise against poor people, shall perish in a the end. Buju Banton
abdulwahid said "Consequently, he doesn't know what a pointer is"
Your company hired a programmer that does not know what a pointer is. Maybe they should invest in a more intensive interviewing process. We were taught this crap in first year and my school sucked. Or maybe they should stop hiring tradeschool grads expecting univ quality.
Woe be on to them, all who rise against poor people, shall perish in a the end. Buju Banton
I tried to learn java on my own and was unsuccessful. Later on I tried python and not only had great fun with it, but learned enough to write several useful programs. I'm not qualified to judge java as a language, but for beginners it's not fun and python is much better. I think you could learn more java by first learning how to *program* with python and then learning how to program using java - at least you'll be done with hardest stuff and java's inelegancies won't be as scary.
-- ATTENTION: do not read this sig. It doesn't say much.
I learned basic, then pascal (kind of), then C, then C++, then Java, then a bunch of other stuff.
It seemed like a natural progression.
My brother learned Java first, and he asked me many questions to which I deferred, "you really oughta learn C." Then he learned C, and his world has changed. "Suddenly everything makes so much sense, Sir Spanky," he said to me.
-- Spankmeister General
My personal feeling is that Java is clunky, ugly, and runs much too slow on most platforms
Clunky and ugly? Compared to what? The language is pretty clean OO (as opposed to C), and clean and simple (as opposed to C++). This makes it an excellent candidate compared to those two languages for learning OOP, right? Your last point about runtime performance has little to do with how useful it is as a teaching language. Believe me, if you are going to be serious about programming, you are going to learn plenty of languages, but few are as clean and suitable for OOP education as Java.
As I post this, numerous posters have already suggested C/C++ as their choice as a first language. This leads me to believe that they have little experience with at least one of the two languages, since they seem to believe that they are so similar that they should to be mentioned together in this context. C is almost a subset of C++, but C++ is much more expressive, much bigger and much harder to learn for a novice CS student. Being a good C++ programmer is definitely not the same as being good at C, and the other way around.
Finally, I think both of them suck as a first language, because they don't let you focus on you OO design and program logic - Java is much better for that. We are talking introductory stuff and first language, so lets concentrate on the important stuff and save the complications of reality for the next course.
I'm right. Java is a fad, not worth much more than the Windows OS in terms of quality, and my CS faculty
./ camp have finally come to the point, where they no longer bash Windows from the technical stand point, and with good reason. Anyway, there are lots of other reasons to bash MS and Windows, so I suggest you train you gun at something worth the ammo.
I think most people in the
What language is used matters very little. In school you're learning fundimentals. Good programming practices. These should be transferable to any modern language. The purpose of a good CS program is not to teach you a language that will help you find a job, but to teach teach you to apply the good programming practices that you've learned to different languages.
That said, Java is a fine language to learn in. Simply because java is not as widespread as say C++, does not mean it's not a good teaching language. IMHO, the ideal teaching language would never be used in the real world, to encourage students not to have a crutch language.
While I think Chris DiBona makes some very valid points, but, I do think teaching C as a introductory class lends the student to adopting it as a crutch.
Great programmers can quickly pick up other languages and apply the techniques they've learned to those different languages.
Chris DiBona twice slams Java for being non-free, and in some ways it is. However, it is worth pointing out that there are Free and useful implementations of Java. GCC 3.0 will be out in a few days and it will be the first official GCC release with full Java support. GCJ has made tremendous strides the last half year in terms of sbility, completeness, and features. (As the original and still active author of GCJ I admit to some bias.) The most "visible" limitation is that functional GUI libraries, but then your typical introductory CS class doesn't have much need for GUI programming. I myself am using GCJ to compile Scheme to native code, and using it to write Apache modules (still very experimental).
First it was Pascal, then all the Unis switched to C, then to C++, now to Java. One cycle is hardly complete before the next one starts; those eager freshpeople getting Java now will discover that it's old hat by the time they graduate, and the wheel will start another turn.
For my money, use something simple like Pascal or C to introduce the basics, and then introduce OOP after a good semester of abstract data types.
Alternatively, do like a lot of schools and use Scheme, so you can teach beginners to 'think' rather than to 'program'.
--
Sheesh, evil *and* a jerk. -- Jade
Is that, in order to learn CS, you should learn
a) Modula-2
c) Smalltalk
d) Scheme (or lisp)
Then graduate to applied languages.
C, C++, Java, etc...
QUOTATION DIVISION.
Teach them COBOL first. Then threaten them with a lifetime of doing that, if they don't learn Java/C++ well enough.
MESSAGE BODY DIVISION.
The only problem with that is that I don't think you can really appreciate the clunkiness of COBOL unless you've already got some experience in a good language. Someone who has zero programming experience just might not have the gut-level aversion to COBOL that comes with time and experience.
Personally, I'm glad that I spent that semester studying COBOL. It's pretty interesting as a historical relic, it let me learn a lot about punch cards, and it taught me to steer clear of the stuff in the real world.
SIGNATURE DIVISION.
NAVIGATE WEB BROWSER TO http://ishmail.prmsystems.com/hh.html .
While it is hard to judge your own programming prowess, it is easy to say which language helped you better understand programming basics and particulars. I am no different. I don't consider myself an extraordinary programmer, but I concern myself with design and elegance more often than not, because now I find myself in the midst of big projects a lot more often. My take on this is that Java is ugly, but it is fine. If you know (or a teacher tells you) what features of a language are useful and elegant and which are not, you will become a good programmer. And Java has enough good features to fill an AP CS course.
1. Java is not that slow. In the Tibetian philosophy sense of the word, comparing your running time against an ideal program that does the same thing in Assembly/Linux/C/etc, we are all slow! But I have seen examples where a good Java compiler would do incredible things like String interning to a naive diff engine and the running time would be twenty times faster than the same naive program in Python or C++. GUI's are slow in Java, but that is not the language's fault, but rather the whole AWT/Swing hierarchy.
*Note: C++ would likely to be much slower too if it was compiled into bytecode.
2. Unless your assembly language supports types, there will soon come a point where your students will need to leave the warm womb of MIX/MIPS/RISC/x86. And I *AM* talking about extensible types here. Something with inheritance, interfaces, generic types (to be incorporated into Java from GJ), etc. All that C++ had to offer when it came out was Classes, and everybody jumped on it, because finally you could write better libraries and API's with method access control, even though it looked like a garbage truck was dumped on the clean sanctity of C.
*Note: the whole idea behind object oriented design is that you can extend the functionality of your program without changing existing code, but by extending the object type to cover more functions. That sounds like bloat, but that's when good design practices come in.
3. Java syntax could use a lot of work... Well, no argument here. There are a bunch of C things I'd like added to Java. Type synonyms is one. I know a lot of people will disagree with me here, but I'd like to see typedef's. But that's life. In good CS departments profs teach functional languages like Lisp, ML, Eifel, with great success. Some amazing programmers virtually speak great designs in ML. But eventually they have to leave their functional heritage in favor of Java and C++. Most of the time it is simply the political pressures of the workplace.
All in all, Java is not the best language to start out with, but considering that you always have to learn something else and move on, it is by far above average. It prepares you for the brave new object-oriented world out there. And once you realize all the brain-damages of Java and learn to sidestep them, you will be more aware of the same in other languages. I must mention though that I am in favor of Java *ONLY* with the condition that it will lead toward other languages in the curriculum.
*Note: I really, really want some feedback to my comment. However, I am going to say right now, that I will ignore any rants with the "Java ruined my life" flavor. If you honestly believe that learning Java first made you a bad programmer for life, you should get a friendly hacker slap some sense into you. Giving him/her (I wish there were more female hackers) your latest piece of code and asking for critical feedback should be the first thing you do when you wake up tomorrow.
Cheers,
Mike
I was thinking of how to intentionally fail my drug test... It would make a good memoir story someday.
1. High-level. Contrary to Mr. DiBona's assertion, most of computer science is looking at higher levels, not lower ones. Sure, there's the obligatory computer fundamentals, but what's more important is what's done on top of the fundamentals -- databases, algorithms, AI, what have you. Java allows the student to quickly learn the basics of programming without having to simultaneously learn machine fundamentals, which they'll pick up later. (Not the case with C.)
2. It's free, in the monetary sense, which is important for high schools and small colleges. (Not the case with VB.)
3. It's real; students can compile and write real, significant programs in Java and know that businesses use Java extensively for significant applications. (Not the case with Pascal or Python.)
4. It's GUI, but not exclusively so: Students can start out learning console programming, but also be able to use a standard GUI framework (Swing) to make GUI apps. In C, you need to learn Motif, MFC, or the equivalent to write GUI apps, which is significantly more involved (and system-specific).
5. It's cross-platform. You can have Unix machines in the labs, but still allow people to do homework on their Macs or Windows machines. (Not the case with VB, and only partially true of C.)
6. It's clean. A lot of Java tends to look like pseudocode -- it's a very straightforward language, with few distracting frills. (Not the case with C++, certainly, nor with Perl.)
7. It's familial. It looks like other C-based languages look. It uses familiar types, familiar notation, and familiar keywords. (Not the case with VB or Perl.)
On the whole, it's a solid language for instructional purposes, combining the simplicity of Pascal with the real-world applicability of C++.
Bah. When I was at the UW they taught Ada. Now that was a bad introductory language.
i've noticed that there are two different types of people in introductory college courses.
/mskf
some people are there because they like the subject, and generally do reasonably well because of it.
then there are the people that are there because they like the money. these people usually struggle with computer science or engineering concepts.
for the first group, i would recommend learning as i did - C first, then C++, with a smattering of ASM in between. learning C started me with syntax, and got me comfortable with pointers and memory. C++ introduced me to OO (i know it's not pure, but i can see the real intention despite any of its shortfalls). ASM explained C's inherent structure to me.
for the second group, those who are just interested in the subject for the money, and who will likely end up applying cookie-cutter solutions to problems (i hope they never program anything i have to use), Java is easier and more impressive (web/instant GUI, as someone said previously). these people likely will not have any aversion to overhead or clunkiness - they are usually just satisfied that it works.
but really, the money-motivated people usually get weeded out by the higher-level CS courses anyway.
so what approach is there to give anyone something they can take away from an intro course, even if they decide to drop out...
tough call.
personally, i'd say C, then C++.
maybe flop the order to make the OOP people happier.
www.mskf.org
0x0D 0x0A
What I Know Is What I Like
* 100% OO
* functional programming as well
Wouldn't this be a strike against it? If you're trying to teach a specific model, why confuse the issue? Why not just use Smalltalk.. Or go the opposite route and just use C or Pascal ..
- As Computer Scientists, students should understand the relationship between the high-level language and low-level machine, as well as be capable of doing systems programming. Java masks the underlying hardware and is useless for systems programming.
- Paradigms: Java supports exactly one programming paradigm: OOP. That's pretty sad. No support for generic programming, and even the main method and statics have to get shoved inside a class declaration. A Computer Science education should be broadening, not narrowing.
- Pedagogy: Teaching Java is somewhat difficult, as understanding of OOP is needed from the beginning (or lots of "just copy this stuff and I'll explain later"). C++ allows you to start with a simple procedural subset, then start taking advantage of STL classes, and then finally show how to create your own classes.
My two cents.I have had several students here who started to experiment with all sorts of arcane features like inner classes and operator overloading without learning how to write good programs first.
Funny...Java doesn't have operator overloading (just method overloading and overriding). If your students are doing that, then they are skilled indeed (as they have probably modified the compiler to do what they want)A lot of comments so far have focused on whether it's good to teach people something high-level as their introduction to CS.
... I mean, why not show them "look, you hit the gas, it goes faster" and find out if they're at all interested in why, first.
I think it's necessary in some ways. The sort of thinking which is required to succeed as a software developer starts with being able to look at a problem and break it down into loops, conditionals, etc. You need to introduce people into this way of thinking pretty early on.
I can't imagine my first exposure to the logic of computers being C (mine was Apple 2E basic). It's just too hairy, too full of ways to shoot yourself in the foot. Do you need to know that you can shoot yourself easily? Yes. Do you need to know about pointers, about memory allocation, etc? Sure. Which is why, after you understand how to think "like a computer" in some ways, you learn about what's under the hood.
I mean, imagine never even having been in a car and having someone explain driving to you by ripping an engine apart. Whoa, there
Anyway. Java isn't a toy language, and if it's a fad, so is OO programming itself. Java is a powerful language, being used in some of the biggest software projects out there right now, by some of the biggest software development houses out there. I know because I work at one, and I do Java development.
If you're going to discount Java as an introductory language, do so because it introduces (rather well, actually) the concept of OO on people who are still learning what "if" means, not because it is too simple. If C++ is okay for an introductory language, then Java is strictly better in my opinion. I would probably teach C to today's students the way I was taught assembly language. "You need to know this, it will make you a much better developer, but if you get stuck in a job using it, it's a bad sign."
Not representing or approved by my company or anybody else.
"Your fresman year should be devoted to assembly language, basic data structures and low level hardware concepts."
You're going to scare away the next generation of developers doing this, IMO. I would never have gone into computers if I couldn't write "hello world" with something as simple as "Print 'hello world'".
Everything else you say is dead on -- a real CS education should teach you about many different types of programming languages. You should feel comfortable talking about declarative, functional, procedural, and object-oriented languages. My favorite CS undergrad class dabbled in C++, Scheme, and Prolog. For our final project, we had to solve the same problem in all three languages. Though we all knew we'd never see Scheme or Prolog once we entered the workforce, it was amazing to see that the chosen problem was an order of magnitude easier to write (and faster to execute) in Prolog than C++.
But, to introduce people to computers, for their very first class where they have to type something in and see a response, do you really think we're going to fill our ranks by making them learn "MOV AX,BX" or letting them learn "A = A + 1"?
That's like saying you can't learn to cook without taking Chemistry first. Sure, if you know chemistry, you'll be a better cook. But to tell someone who thinks they want to cook, "Take chemistry first, then you can learn to sautee vegetables," seems a bit extremee to me.
Not representing or approved by my company or anybody else.
Sorry, but that's just plain untrue. IBM provide compilers and JVMs that are every bit as good as Sun's and in many cases better (check out pretty much any performance comparison for 1.1.x JVMs, for example...)
++ Say to Elrond "Hello.".
Elrond says "No.". Elrond gives you some lunch.
Regardless of whether that's the case (it isn't, IME) that's not what was being said in the first place, I believe. The claim here, AFAICT, is that Java is a cleaner, better designed OO language than C++. And I certainly wouldn't argue with that.
Most people are never going to write device drivers at all. Why is this relevant?
And frequently do, with the result that they write truly hideous Java code. I've seen the result of people taking this attitude, and it's not pretty. It's frequently possible to tell that people were C++ coders before becoming Java coders from the quality and style of their code.
If that's what people are being taught, then it's the quality of the teaching that is to blame, not the quality of the language. No Java coder worth their salt would write like that. Sounds more like the sort of thing I've seen from bad C++ coders, in fact. :^P
++ Say to Elrond "Hello.".
Elrond says "No.". Elrond gives you some lunch.
You mean it takes about five years for Sun to fix a bug once it's well-known and they've been provided with a working fix? :^P (Witness the bug preventing any program which calls getDefaultToolkit() from terminating, which has led to years of truly horrific user interface application design, and has finally been fixed in 1.4)
++ Say to Elrond "Hello.".
Elrond says "No.". Elrond gives you some lunch.
I sincerely hope that's sarcasm. The idea that you have to be able to write something in order to use it is so fundamentally wrong it makes me shudder. Incidentally, I hope you can write web browsers and operating systems. Otherwise you've got no right posting to Slashdot.
++ Say to Elrond "Hello.".
Elrond says "No.". Elrond gives you some lunch.
Again, you're trying to blame the language for bad teaching approaches. I've seen courses taught with buggy C compilers. Does that make C an inherently bad language? Of course not.
There is no requirement to teach applets as part of a programming course that incorporates Java, and IME courses which do concentrate on applets are normally outdated: applets don't play as large a role in Java today as they did back in the days of 1.0.x - most of the roles Java was expected to fulfil through applets are now using other technologies, from simple animated GIFs to Shockwave applications.
The last good Java course I saw didn't cover applets at all, except in passing. It did, however, cover enough to make it possible for students to learn how to write applets if they needed to.
Fair enough. Quibble over granularity rather than answering that issue. The overall question is whether Java is a better language to teach beginner programmers (or more accurately whether it's a good language to teach them) - the issue that you misunderstood was the question of whether Java is 'cleaner' than C++. This has nothing to do with buggy VMs, and everything to do with a clean and simple object model.
public class Globals {public static int GLOBAL_INT;
public static String GLOBAL_STRING;
}
Ugly, yes, but I believe you'll find it does the trick. It's actually one of those recurring features you see in bad Java code where people are trying to write C++ in Java.
And if we step back a little from your argument, what you're actually saying is that it's easier to learn to code in Java than it is to code in C++ (something that I'd personally agree with). And that's a good argument for using Java over C++ in my book: there's much less time getting to grips with (and struggling with) the language, with the result that more time can be dedicated to learning what you can actually do with it. Which is presumably what people are there to learn anyway.
++ Say to Elrond "Hello.".
Elrond says "No.". Elrond gives you some lunch.
My college CS courses used java to teach OOD/OOP, but, just ro reiterate previous comments, python is the obvious choice.
I feel that Java is a great intro to OO-programming. Teaching OO is completely relevant to computer science courses. Hardware is such a minor part of CS. Hardware should be focused on for Electrical Engineering much more than CS. To me, CS is about understand how computer logic works. To do so, you need to understand programming, logic, math, science, and to a lesser degree hardware. But, I don't want to abandon hardware. I'm just saying that a CS course should focus on theory more than practice. That is why Java would be a great way to learn OO. If I were teaching a class on OO, I would start with some C, move to C++, and finally Java. Java makes it very simple to understand OO. You don't have to deal with malloc and pointers are handled in a much higher level. Just because you learn a language in a CS course doesn't mean you are stuck using that language forever. I graduated from the University of Dayton in 1995 with a BS in CS. We learned Ada. Unless you are working for the DoD, you problem will never see Ada again. But, Ada is object-based (newer versions are OO) and is a great language to start with. Making the transition from Ada to Java is easier than from Pascal or some other basic language. Java could also be taught with C++ so that students can learn the best of both languagues. The more you know, the easier it is to switch to other languagues and methodologies.
Please, let's not start advocating VB as a learning language. VB allows such lousy structure. I wrote VB for about 4 years. I really enjoy the language, but too many people are focused on the RAD of it. Look, I can generate a form, put some code behind it, and I'm done. This is not how to code.
VB allows you to bypass all formal design (yes, you can do this in any language) and go right to designing the look & feel. I have always felt that VB apps get developed in reverse. Very few people take the time to write a VB app starting with a structure or plan.
Let's leave VB to community colleges, training classes, and for you to learn on your own.
HERE HERE! My sister took her first programming course last semseter. Java. I spent one evening with her going over the basics of OO programming so that she could finish her projects. It took her a while because the prof had been trying to teach Java as a procedural language. Stupid. Learn C first (not C++!) or Pascal or ADA. OO is VERY COMPLEX and should be taught later, IMNSHO.
-- IANAEG - I am not an elder god.
You can't. You have to pass an Integer, instead - or use a Class, such as Vector.
Passing an Integer won't work, Integer is immutable.
and now for something completely different (the opinion of a cs teaching assistant at a major university (uiuc)).
i've been assisting in an introductory cs course for two semesters now that is taught in java, and java is too laden with syntax due to its espousal of oop as the One True Way to be an optimal introductory language. the students are hit with it from day one when they don't know what it means. it is rather frustrating to have to say, `here's a program that prints "hello world," but just look at this println statement, don't worry about this public class stuff and don't worry about what `public static void main' means.
i learnt to program in pascal, and anything from the list [pascal, c, python, lisp] would make a pretty good introductory language since you don't get bogged down early on with a bunch of stuff you don't understand. oop certainly does not belong in an introductory class, but guess what, we have no choice but to discuss it. and if you think that introductory level students are prepared to grasp why you would want to use any of this object-oriented nonsense, you are sadly mistaken.
-- your friendly cs 125 ta
Hey, if you're referring to the roff typesetting language as antique, watch out. Maybe it's not state of the art but it is still in everyday use at all Unix installations for online documentation. It is handy to have one file (with equations, tables, type effects) that can be viewed in a console and also beautifully typeset. (Gnu info is great for this too.) You can go from POD or SDF to roff, from roff to HTML, from roff to various typesetting-only languages. It is also the language used to typeset such Unix classics as The Unix Programming Environment and Stevens' books, and I'm sure others by serious Unix-heads. Maybe the professor in question just preferred to continue using an efficient and capable tool that he was familiar with. There's nothing wrong with using it in preference to other Unix-friendly typesetting tools like TeX.
(offtopic)
Python doesn't force you to use TABs. It *does*, however, force you to indent consistently. That's it. You don't have to use 8 spaces, or even a set number of spaces - as long as the indentation is consistent within a block.
Many people who program in Python dislike TABs, and set their editors to automatically replace then with a set number of spaces. Better still, use a decent editor like VI or EMACS, which understand Python and let you navigate around it intelligently (just like I wouldn't want to program Lisp without the Emacs Lisp editing mode).
When you're writing C, you indent AND use braces -- with Python you only indent. Less potential for confusion.
(/offtopic)
My university (Warwick University, UK), have switched to using Java as their introductory programming language as well. I may be biased, but it seems a very bad idea for a number of reasons. Principally, Java is a complicated multi paradigm language -- and when you're teaching, you want to be able to get the ideas across cleanly, without pages of 'just write all this, don't worry about what it means' which you'd have to use in Java.
For structured programming, use Pascal (it's what it was designed for, and it fulfills its purpose incredibly well). For functional programming, use Lisp or fashionable modern alternatives like Haskell or ML. For object orientation, Python is a good choice, or Smalltalk if you want to be more hardline. (a few years ago, I might have mentioned Prolog, but that seems to have fallen by the way-side along with expert systems and hard AI).
Java, along with C and C++, are very bad as *teaching* languages. Once you know the basics, however, they are great languages to learn precisely because they are multiparadigm, and don't force you into a particular programming style.
-- Help Digitise the Public Domain at DP.
Java teaches you nothing about underlying architecture, and system management. How are you supposed to write good code if you won't know anything about the underlying mechanisms. I have seen some of the most inneffecient code in my life written in Java, creating half a gazillion objects then deleting them, and hearing someone say... 'oh it's okay, Java garbage collects', not realising that garbage collection is slow if you just instantiated half a million objects.
C should be the staple for an CS course. It might not be pretty, but neither is x86 asm. C++ might not be purely OO, but it does support multiple inheritance, and although many purists might argue that that is bad, there are plenty of situations where toolkits like Qt use it to very good effect.
Also - note that Object Oriented Design is not the solution for world peace and the common cold. There are other design metaphors that surpase OO for many tasks.
I have worked in at least two companies that are moving firmly and fastly _away_ from Java because they had so many issues with JVMs not performing properly in a high load environment. I think that C/C++ will remain the back bone of the industry for some time, and if not, then more fool the industry (oh wait - there are still companies runnign IIS/NT - I take it back - at least half the industry is moronic).
Does this feels like the industry ensuring it's own future by teaching programmers to write more slow bloated code and therefore require more and more ridiculous hardware requirements? I know that many educational institutions in the US are heavily funded by big business...
Everyone is living in a personal delusion, just some are more delusional than others.
Oh yeah - and Run Time Typing is so much better than templates that give nice compile time errors that are clear and easy to fix. Oh yeah - we will just have this method accept a type Object as an arg because we can.
And don't even get me started on the piece of pain in the ass that is reflection.
Everyone is living in a personal delusion, just some are more delusional than others.
oh yeah - let me see...
public void (Object foo, int bar)
{
...
}
so are we passing a copy of foo and a copy of bar??? eh?
No we aren't.
Java syntax is _not_ clear. This is an easy misconception. At least in C++ it's truely clear!
Oh - and forcing this:
public class Link
{
private Link next;
private Object data;
public Link getNext() {return next;]
public Object getData() {return data;}
}
is just wrong.
Congrats on introducing a 30% overhead into your link list for obeying data abstraction rules.
Everyone is living in a personal delusion, just some are more delusional than others.
cs majors here at uiuc.edu use java for our first programming class. in my experience it did a good job teaching basics without needing to understand things like memory usage and data structures.
the *second* class, which teaches data structures and object orientation, is taught in c++.
in my opinion, having gone through it, that order works pretty well.
chris
I'm a Java developer by day and a C programmer by night, and I think the pair would make an extremely powerful teaching combination - Java for high-level and OO, C for low-level algorithms, pointers, and speed.
Maybe universities should look at requiring students to learn both these languages (each in a different course) - It's not like students aren't going to have to learn a few extra languages anyway at some point.
This would solve a few problems I've seen at university - such as being forced to write low-level file I/O in a Software Design course that was supposed to focus on higher-level design. However, you'd still be able to write low-level algorithms such as those for balanced binary trees if the algorithms course used C.
It would also avoid the confusion a lot of people face when trying to differentiate between OO and traditional programming in the same language (C++)!
> Hell, if that were the concern, we'd use Haskell!
NO THANK YOU
qsort [] = []
qsort (x:xs) = qsort [y | y = x]
That took an age to understand.
Here is what's replacing applets. JNLP is great - once you install a JNLP client, it keeps track of installed JREs, versions, CLASSPATH, etc, automatically. We use Java Web Start (Sun's JNLP client) internally to keep a Swing EJB client up to date and are just pleased as punch with it.
Yours,
Tom
The Army reading list
I won't discuss Basic. It's an abomination as a teaching language.
Pascal was good because it had constraints, and was well structured.
IBM 360 forces you to understand the basics before you can do anything else.
All of these have there place for different types of courses.
With decent course material each of these languages can be used to teach without worrying the students will get over their heads too fast. (It's difficult to jump ahead in IBM 360 without understanding, with Pascal the structure is quite simple, etc.)
A language like C is impossible for beginners to grasp. They can quickly get over their head with bugs they cannot even comprehend yet. You have to be able to take small steps to build on the ideas.
Java, I think, can fit nicely in this. You won't have to worry about core dumps while your trying to teach simpler concepts.
The problems with C++ relate back to C, it is quite possible to shoot yourself in the foot in such a way it is very difficult to find the problem without a through understanding of C/C++ and the program as written. Sometimes difficult to do with some students programs.
I knew C quite well before I attended college, I help a number of students that were learning it, they found it difficult, or impossible to debug if they made a mistake with an unintended pointer issue.
Fixing it for them doesn't help their understanding, and, in general, they don't have the background at that point to understand it enough to fix it themselves.
(Keeping in mind this was on a 3-6week course in C, not 2 years...)
Maybe I'm a little old skool because I learned with C, but I think starting off with Java is a bad idea at the collegiate level. Sure, its great lexically, but I think Java is much easier to appreciate by first coding in C/C++.
I think that new coders SHOULD have to deal with typing your variables, and being careful with pointers.
Maybe if Intro to Programming was a seprate course that just taught the basics of logic, that'd be okay. CS majors could skip that one (presumably CS101) and start with a more structured intro class for CS majors (CS120...programming in C++?).
The structure is important if we want to in any way discourage writing bloated code and letting the VM manage memory.
dirk
I keep trying to pick fights, but I can't shake this Excellent karma.
I think Assembly is the learning tool of choice. Nothing teaches appreciation for C better than Assembly. Wait, though, if you want appreciation for Assembly you need to learn machine code.
Beware the wood elf!!!
I think your definition of algorithmic is, well, odd. There are a few interesting asynchronous designs out there, such as the amulet ARM implementation, but, at least in every case I know about, they are just as algorithmic as any common software package.
An adder, be it synchronous or not, is still just a binary addition algorithm implemented in hardware. That's part of the nature of digital design; it draws its function from binary logic and algorithms.
Hardware tends to be less buggy than software because it is more pedantically verified; it has to be. It's much easier for joe software company to issue a patch than for joe hardware company to replace parts...
I don't believe that the tool used is particularly important - it is the principles being taught that is of the greatest relevance. In an OOP course, for instance, the principles of OOP should be emphasised, not the language of implementation. Once a student has a strong understanding of these principles, they will be able to apply them to any language that follows them - the C++ or Java question should be largely irrelevant.
That said, it could be argued that procedural programming should be taught before OOP, as procedural programming has traditionally been the optimal compromise between high-level design (OOP and so on) and the actual low-level structure of things (assembler programming and such), from which point it is easiest to grasp those higher and lower levels. However, in this enlightened day of RAD tools and such, perhaps this knowledge is not as relevant for "Joe Coder" as it is for those more oriented towards the science of such things.
Nonetheless, the main point is that the paradigm is what should be emphasised, not the language.
- SMJ - (It's not just a name: it's a bad aftertaste.)
The most popular CS intro courses at Brown at taught in Java, with the other options for a CS intro taught in a combination of scheme, ML, Java, and perhaps a few others. This gives a not-too-wacky language to get your feet wet with. The CS course most often taken first semester of your sophomore year delves into some basic assembly and hardware concepts, and the higher courses are all pretty much done in C/C++, especially the software engineering course (one of the requirements), which is all C++ (there are a few exceptions -- AI courses are done in LISP, for example). Independant study courses/research/etc., you're pretty much free to use any language you want as long as it fits the task. Maybe I'm biased, but I think this is certainly a good model to use.
Hmm. Maybe I am agreeing with you in some sense.
To bring this back on topic, my own experience is that starting with Java means a whole load of concepts (inheritence etc...) that didn't used to be there. This may be the right thing in the long run, but in first year it means peoples comprehension of loops, branches and arrays is weak. Without that stuff, they can't really do anything interesting.
Is it any coincidence that the list of schools using Scheme includes most of the best CS schools in the country?
MIT, UCB, Waterloo, CMU, Georgia Tech, Harvard, UIUC, UTA, and Cornell all factor Scheme early in(or at the beginning of) the CS curriculum.
What is probably the most popular intro CS book is based on Scheme.
The first thing to avoid is using a programming course as a method of teaching hardware concepts. These are entirely different ideas and should be treated as such. The same argument you advance for C (forces you to deal with lower-level issues) can just as easily be used against C...make them program in assembler. I once could program reasonably well in 8088 assembler. Now, I realize that the exposure to the concepts was nice, but all the time I spent learning about 8088 specific architecture was useless.
A proper computer science curriculum should teach concepts, not necessarily 'trade skills'. For example, the university I went to taught the introductory classes in Modula-2; and once we were past learning 'how to program', they let us use the language of our choice for assignments.
Why Modula-2? Not because it was popular in the industry, it wasn't...and I haven't written a line in that language since my sophmore year. They used it because it was cleaner in many respects than C and Pascal (the other major alternatives) and provided strong constructs for functional, top-down programming (the methodology of choice at the time).
What people need to understand when they're initially learning to program are basic concepts: What's a flow-control construct? Why does abstraction make a program easier to maintain? What's the difference between strong vs late typing? You're not learning a language, you're learning a way of thinking.
I've developed in over a dozen languages since then...my current 'usable' stable is C/C++, Java, PHP and Perl. They're all strong in different areas, but when you really think about it...they're all pretty similar. When I pick up a new language, my question is just 'how do the following concepts that I need/use map to the new language'? Because I already know how to program and that's the hard part.
Now, to reply to the original question. Of my stable of languages, I would be most likely to recommend Java as a learning language. Why? Because it's a clean and simple language with less of the legacy baggage the others carry. It has a strong OOP support, which wasn't just tacked on at the end. The students won't waste as much time on the nuances of syntax when they could be learning how to design a good program.
My primary argument against Java would be that it's too object-oriented, making it more difficult to teach other programming methodologies.
Anyways, just remember, it's the concepts, not the language that matter.
Java runs on a platform that abstracts it from underlying concepts, much like any other application does.
.91 not work? Are you using glibc 2.2? Is Galeon slow...did you upgrade all the libraries it depends on?
Does your Mozilla
Why did you recommend Perl as an alternative? Do you not realize that perl suffers from the exact same 'application environment' problems that Java does? The primary problem areas for Java portability are areas where Perl is hardly used. When was the last time you tried to get users to run your Perl/Tk program on Linux, Windows and MacOS X?
I'll mention that Perl is my preferred language. It's even the language that currently butters my bread. However, it is my observation that Java is significantly faster (after initialization...so I suppose it depends on how long the program is going to run), more scalable, and more appropriate for large systems.
Perl has advantages too...the most important, imho, is how quickly you can crank out code to do a particular job versus more structured languages.
That being said, I wouldn't recommend either C++ or Perl (your choices) as a language for primarily learning OOP concepts. Java, Python, Smalltalk and many others are more appropriate.
A first course in CS is a really short time to learn about the field. Ideally you'd learn one programming language, the basics of machine architecture and a little bit about how all the other pieces interact with each other (ie. algorithms, os, databases, networks, foundations, ...) and that way hopefully students' interests will be sparked and they'll continue with the core courses -- and maybe even some of the application specific courses (compression, encryption, graphics, information retrieval, etc.)
Going back to choosing a language for an intro to CS course, it's obvious that there isn't much time to get into real depth with it given all the other needs of such a course. Therefore, you'd want to pick a language that would demonstrate the important concepts of programming without bogging students down with the technicalities of hunting down tricky bugs like pointer corruption, or having to deal with obscure language features (C/C++ bit fields, virtual/inline functions, unions, etc).
In my opinion Java is a good match to these needs -- it demonstrates the important concepts in a clean way and since the syntax and semantics are close to C++, one could easily take the next step and learn C++ in a later course (maybe in a data structures course). I think this strategy provides for incremental learning of C++ (ie. you already mastered loop constructs, if statements, selects, etc in Java) plus you can form your own opinion about performance vs. ease of implementation since you'd have experienced both languages. Finally since Java makes the low level details so easy it even allows you to stress some of the higher level details of programming like generic programming and patterns.
As an aside, I seriously think that Perl could potentially be even more suitable to an intro course with its simple data types, no compile cycle and declarative string matching and substitutions (that have the added bonus of introducing students to regular expressions). The downside of course, is that you can say the same thing in a zillion different ways, although this could be overcome by a good instructor that outlines a consistent programming style.
You're talking about imperative languages. Declarative languages also exist where you don't tell the computer how to do something (ie. the algorithm), but what you want it to do and then it automatically figures out what algorithms to use. (Think SQL, or Perl's regular expressions, or esr's CML2, or XSLT, or a whole bunch of other things). These languages are often domain-specific languages in practice, but it's hard to argue that they don't produce code that's quite free of errors.
I predict that in the future developers (and possibly power users) will use many special purpose declarative languages instead of one general purpose imperative language.
My school had this layout: One course of Java followed by a C, then a C++ course.
The Java course was offered the first term we were there, and although the language was easy, the use of true, or even basic Object Orientation was useless. Only the few with good procedural programming skills found the java course very easy. The rest found it confusing and often pointless learning about things in a too dumbed down way.
Java only really started to make sense to people when we were learning C++ in third term.
I found that it is much easier to teach a person procedural programming and then Object Oriented programming than just teaching OO. I found that people fresh to programming just don't have the mindset to see the beauty hidden in OO concepts.
Unless you have REALLY tought OO concepts to death, many with find the OO paradigm, and java very uncomfortable.
By taking a position of superiority you show how nearsighted you are. Thus Spake ADRA
Bye!
...How about teaching them embedded programming?
You could take this to it's logical but absurd conclusion and say that students should have to enter their program with little switches and a button, eight bits at a time. But seriously, you can learn a lot about how computers work if you have to write your own stack, your own heap, and your own start-up code.
What you won't learn is how to use a modern computer to create useful applications (unless you want to go into embedded programming). IOW half of CS is knowing how a computer works, but the other half is getting the computer to do most of the work.
Java may get a lot of bashing, but I see it as C++ with most of the bullshit removed (oh, yeah, and it's slow). I think it makes a perfectly good into-to-OO language.
My company has had some experience with the C++/Java debate. Its sole business is providing materials for CS instruction in high schools and universities.
For the vast majority of high schools, the AP determines the sole language of instruction.
For the vast majority of colleges and universities, the perception of industrial relevance by the students and non-CS administration mandates what language will be used, regardless of the suitability for pedagogical purposes. Otherwise they might be using Pascal, Python or Turing.
What this means is that most faculties can only realistically teach either C++ or, now, Java. C++ was not well liked for a huge variety of documented reasons. We were able to give out 600+ "C++ Sucks!" buttons to attendees at the SIG-CSE (Computer Science Education conference) mostly on the strength of educators being forced to use a language that they considered unsuitable for use as a first language. Or as one educator put it:
If we don't teach C++, nobody takes the course. If we do teach C++, nobody passes the course.
Sun's marketing of Java has allowed it to be perceived as industrially relevant by the student body, who generally get their information from newspapers, magazines and want-ads. This means that Java has become an acceptable choice for teaching first year computer science.
(Generally, AP follows the general trend of CS1 a few years later. The quick switch from C++ to Java indicates, in my mind, a lot of unhappiness of high school teachers teaching C++.)
When weighing Java vs C++, it's not too suprising the Java comes out ahead in the minds of most CS educators.
Remember that, in general, the only real goal is the efficacy of the language in teaching the concepts covered in CS1. Things like actual efficiency (as opposed to the order of algorithms) is not really a concern of CS1. Things like garbage collection vs explicit freeing are also beyond CS1's purview.
Hence they look at syntax issues, ease of expression of algorithms, etc.
All opinions are mine, not my company's.
While Java is usually considered more suitable than C++ for CS1, Java has a number of deficiencies from an educational perspective.
:-)).
Remember that in general, the only issues that matter are those that make it harder to teach the general CS1 concepts. Speed of Java execution is *not* an issue for most. (By the way, please note the word "in general" and "most". There are counter-examples, but one generalizations about the teaching of CS1 are, in my experience, fairly accurate.) For what its worth, my experience is 14 years of producing/selling resources for teaching computer science in universities/high schools.
(1) No simple I/O package. To read an integer from the keyboard takes multiple lines of code. Most programs are not pedagogically improved by adding mandatory error trapping. The solution, of course, is helper classes. My company produces its own, but many are available free over the net. Interestingly enough, while 2 years ago, most university teachers were not interested in helper classes, or in books using them ("I teach pure Java"), there has been a fundamental shift towards the use of them over the last year. The other alternatives are a lot of handwaving ("use this block of code, don't ask why") or using applets only or have all your examples carefully not every need integer input from the keyboard. Each of these techniques are used in different books.
(2) References are Hidden. The fact that many variables are references and can't be treated the same way as primitive data types. This is a personal gripe of mine. I'd say that about 50+% of students who've completed CS1 can't give a clear answer as to what happens when you say "a=b" when both are references. Java doesn't help the situation with the class that most students first encounter - String. Because String is immutable, you can say "a=b" and it works. Even worse, most of the time you can get away with "a==b" for a comparison (because Java efficiently caches identical strings). I spend an inordinate amount of the Java courses I teach (to teachers, mostly) on this problem.
(3) C++ Syntax. In other words, a misplaced semicolon can still waste many hours of student's time for little pedagogical gain. Of course, this was simply a marketing trade off in the creation of Java.
(4) Overly complex environments. Of course, development is focused where there's money, which means education gets (for very little money, mind), what's developed for business. For educators, you generally want an environment that has the basic features but can get students writing programs within about 15 minutes. There are a few educationally focused Java IDEs out there. We have our own (Ready to Program), but there a number of others suitable IDE's out there such as BlueJ.
(5) The Java class libraries. This is both a good and a bad thing. With C++ there was never any question about teaching the Windows API. It just wasn't done. But with Java, you *have* to use part of the class libraries, and from there, it's a slipperly slope to (HORROR!) graphics, applets and GUIs. These can add a lot to a course, however, what concepts get eliminated so that you the fun stuff?
Aside: I've noticed a distinct reluctance when people suggest what should be added to CS1 to also suggest what should be removed so that it can fit. You only have so much time.
Anyway, that's a mini-capsule of what we've found. I could go on for hours (and do, as a few people at NECC will find out
Another Aside: Does anyone know any web sites that cover this topic in depth? I've been amazed at the paucity of web sites about high school/university CS instruction in general (lots of good individuals posting content, but few general resource gathering sites).
If you're teaching C++ so your students can get hired - stop. They're just going to get stuck away doing maintenance on 5 year old systems. Everything interesting being done at most of the companies that I have worked at / interviewed with in the last few years is being architected for Java delivery. The real problem in programming instruction that I see is learning how to think about a solution. As you have indicated a single language is not sufficient. But if you are going to teach a single language, then Java makes it easier to think about programming problems and get results than any other that I am aware of. Scheme has had some introductory CS work but most schools are moving away from it. And they are moving to Java. Because students can put it on their resume. I personally think that hardware and implementation can be left for later courses. Once you get the right thought processes further information will just fall into the right places.
Why are you confusing Java developers with dorks? Big O notation applies in all programming languages,
an O(n) implementation in Java will beat an O(n*n) in C any day.
I'm a Java developer, one with a solid education as well. I believe that C should be your first language,
I don't however, believe that it should be mandatory to know the nuts and bolts of hardware near programming.
If you know C, you'll be able to grasp onto near any other programming language fairly easily.
Unable to read configuration file '/bigassraid/htdig//conf/14229.conf'
Geocrawler error message.
Re: Happy Hacking Keyboard
If you live in vi and it's vi-bound ilk, then the HH is king. It takes about a week to get really used to using the function key+number for the F keys, but that is about it.
And as a plus, my forearms no longer hurt!
Word. The interpreter is what made Python click with me.
I remember writing this my second week (I keep *everything*..):
import string
import random
import time
crapulous=open('/home/drsmeegee/crapulous.txt', 'w')
goat=random.choice(['peon', 'leon', 'cajon'])
cow=random.choice([' ate ', ' vomited ', ' stepped on '])
chicken=random.choice(['bat meat', 'cat food', 'android burgers'])
spork=[goat, cow, chicken]
crapulous.writelines(spork)
crapulous.close()
Yes, it's madlibs.
Um, my point. Lessee...oh yeah. The irony here is that my job on campus is 90% Java and %10 LambdaMOO. Even though I don't think Java should be taught in classes, it's still my bread and butter. But with my C++ (and decade of BASIC) experience and the promise of a great wage, I learned myself all the Java I needed in about two weeks. I looked at the client code that existed, I skimmed a textbook we had in the office, and mostly I looked at the online docs, but I'm far from needing a year-long course to pick up the necessary skillz. I think we could all learn a lot more if we could intern/apprenctice in the working world.
The latest version of my pretty little Java client can be found at this place, but keep in mind that over the summer it's constantly being broken and remade in preparation for Geology 105 each fall. It'd be interesting to see it Slashdotted, tho.
------------------------
Co-founder of GerbilMechs
There's a difference between learning the stuff in your spare time and needing to have 1 or 2 years experience in a real job to answer most of the classified ads on the market. I never wanted to learn any languages just for the hell of it, but even if I did, I would have had to do something serious with that knowledge to reap the benefit of having spent ANY time with it. Even my college experience in the stuff I learned is not good enough for most of these HR-dept. placed job listings.
I was happy enough in college doing school, working a part time job, and reading Slashdot to keep familiar with things. Perhaps I would have served my own knowledge well by doing some more independent study with programming topics, but the only thing that would have helped me get a job would have been to work at a local corporation for one or two years while in school doing that stuff. Otherwise... hey, I've got all the free time in the world right now, and my roommate is taking a Java class and he's got a book on it, so I could learn from him. But that doesn't meet the lofty expectations employers have for entry-level candidates right now...
This is a great idea, and it's exactly what my CS program did in college. We learned C, C++, Lisp, SPARC Assembly, and Prolog at least in the core cirriculum. Java, SQL, several flavors of Lisp, and perhaps some other programming-type languages were taught in elective courses. VB was available in the business department.
The major problem is that after all this time spent on DIFFERENT languages, I'm a jack of all trades and a master of none... I don't even feel comfortable coding C++ anymore just because I haven't done it for at least 2 1/2 years: it wasn't asked of me toward the end of my program. The only above language that I did NOT get to take is Java, because of scheduling difficulties, and now I sorely regret that... because now I'm looking for a part time job to make ends meet as a recent BS-CS grad with an MIS minor and two completed internships. Yea, life sucks sometimes, but whatever.
Point is, I may have a diverse background in languages, but that doesn't help me professionally. I still wonder why I spent all that time learning all those languages and no one made sure that I would be able to apply my skills in the real world.
I mean, if you're gonna teach a course on a subject, maybe you shouldn't design it around trying to make money off the concept. But if you're going to assemble a department and an educational program that people will be paying in excess of $20,000 a year to enroll in, then perhaps more than FOR loops and system calls should be included in the bunch.
This is the problem with Java though. Teaching Java instead of C++ is a cheap way out... it's not supplementing a good program with job skills, it's replacing a good program with the language of the year. It's the dumb way of answering the question of "How are we ever going to use this stuff?" Instead of teaching them what they should know, they'll teach them what they want to know. That's not always good. In this case, it's flat out horrible. But I suppose it'll make many people happy as long as no one figures out that a Java-based CS program is perhaps as bad as all the Visual Basic courses they teach over in the business school...
I will probably be modded down heavily for saying this...
There is a reason why BASIC is called BASIC - it stands for Beginner's All-purpose Symbolic Instruction Code.
Originally designed at Dartmouth College as a teaching language in the 1960's, it is still a language that can truely teach the fundamentals of coding.
I am not talking about QBasic, or QuickBasic, or even VB - but standard ANSI Basic. For a course, I would recommend using Bywater BASIC.
Don't teach line numbers, or GOTO, but do teach how to handle possible errors, and good code formating, as well as proper commenting and code documentation. Most programming concepts can be taught using such a BASIC implementation.
Later, after students have caught on, you can go back a little and tell them about GOTO, and why it is bad - as well as why it can be good (very few people know examples of good uses of GOTO - I have seen only a few myself - but yeah, I know it is possible to write code without ever using a GOTO).
After that, teach a more structured language - Pascal comes to mind. Then move to C, then C++, then Java...
Worldcom - Generation Duh!
Reason is the Path to God - Anon
However, these languages are very difficult to learn and this can get in the way of learning other facets of programming and computer science. This learning curve impacts the learning of the general problem solving skills needed to work outside the limited world of discrete finite machines, such as in networking or inter-personal spaces. Java solves some of the problem in the OU cirricula by providing a "lite" language. It is a language that does impressive things very easily and that gaurds the programmer against some nasty complexities like platform/compile/library incompatabilities. These are also the reasons it is popular in industry. Languages such as Fortran and Cobol hold on in our Science and Business colleges because of legacy code and the personal perceptions of the faculty. Unfortunately you can improperly teach the problem solving ciritcal to progammin in any language, just as you can properly teach without a language. Classes that focus on getting design and thought about a problem started at least during if not before a project would be much more helpful. Systems such as OO pattern and tools like UML provide much help to the Software Engineer and Computer Scientist alike.
I've worked in the *real world* Perl, C, C++, Z80 assembler (in embedded and non-embedded environments) and Java. Each has a different goal and a different way of getting their. However, irregardless of the path taken, they achieve those golas to a limited degree. Oak, the language that became Java, was designed to be a simple extension of real OOP with a C syntax. Like other embedded languages, most of which are either assemblers or functional strangely enough, it has grown to include methods of getting at the machine and conecpts such as closures. If it adopted lamda calculus syntax extensions, you could use it to teach mathematical therom proving.
However you choose to view the language, as toy, irritant, the next wave, the last wave, et cetera, it is in our CompSci cirricula and it can be taught and taught well. When I went on to my second year of classes I was exposed to C++ for Data Structures and Java for a Programming Abstractions course. Data Structures became a waste of a class trying while to work with a professor who was new to the lanugage. The Programming Abstractions professor knew what was up with Java and so taught us a lot about OO design before delving into the language. I didn't get a lot of help from my time learning Haskel, wich in turn had severly limited my time working with C before moving onto C++.
For what it's worth, learning RCS, and later CVS and UML, helped with my programming more than any of the languages I in which I learned or worked. In the end, these languages proved that they are just tools. Like all tools - Craftsman, DeWALT, GNU liscenses, Sun.Java.*, there will be proponents and detractors and teachers and charlitans. You mileage may vary.
Here's to 5 years of CompSci and counting (with 1 year to go.)
"You cannot have a General Will unless you have shared experiences. You cannot be fair to people you don't know."
For an introduction to programming course, Java may not be all that bad a language. Java hides a number of implementation details (such as memory management) which, while extremely important for a well-rounded programmer to learn, just gets in the way of a beginning programmer who is learning about loops and method invocation. And, at least at the level of writing expressions and loops, it's similarity to C should help people make the transition later to C/C++.
Of course I wouldn't use Java for embedded software development, nor would I personally want to use Java for anything that is compute intensive. But by hiding a number of details, IMHO it's not a bad language for beginners.
I'm a UW TA, and think the move is a positive thing, even though it means I'll have to go back and review Java if I TA the first-year class ...
While C/C++ is probably most common, it doesn't represent the "majority" of programming. Java is not a fringe player in industry.
More importantly, however, an undergraduate CS curriculum is not dedicated to churning out professional code monkeys. The idea is not just to learn how to "do stuff", but how to code _properly_. C/C++ are just too messy. Java is a far more elegant language, and demonstrates the fundamental precepts of OO programming better than C++ does. Later on, you'll probably wan't to pick up C/C++, but after experience in Java, that's not so difficult.
When I was in university back in '92, Smalltalk and C were the two languages you learned in first year.
At the time, I couldn't appreciate Smalltalk for it's OO-ness -- but I'm really glad they taught it to give us the intro OO.
I can't think of a better language to learn OO, despite it not being very useful, and the version we used crashed a lot on Windows.
It helped me. Kudos to Carleton University, where the 'K' stands for "quality".
When I went to school ( in the dark age of 1985 ), we were taught LISP as the initial language. Not because the school thought LISP was a particularly eximplary language, but because almost no one entering college had ever used LISP. The professor thought that this ignorance made it easier for him to teach Computer Science as opposed to computer programming. If it were a well known language, people would come into the course with biases they had already developed. Looking back, I agree with his assesment. All of us learning the language at the same time afforded us the opportunity to learn the language within the framework of basic Computer Science.
So, my suggestion would be to use a quite functional, but not very well known language or even have the professor write a language themselves and use that.
All those nice run-time optimizations being applied to Java work for C++ too, if anybody would bother.
You apparently don't understand what I mean, because those optimizations are impossible for any staticly-compiled language. The HotSpot compiler can see the entire inheritance structure that is in place for that runtime session, and finalize those methods that will not be overridden. Better yet, if it finds out later that it was wrong, it can dynamically replace the finalizd method with a non-finalized version.
Of course, since C++ is generally tons faster, nobody has yet.
C++ is not that much faster in situations where operation is computation bound, rather than I/O or graphics hardware bound.
So, have they bothered with a 'select'-like statement, or is it still 3000+ threads for a server with 3000 cllients [sic]?
3000 threads is only the case on systems like Linux where the thread model is one-to-one. Solaris, for example, has a many-to-many thread model that allows for very nice threaded operation. When you get right down to it, Linux isn't really set up for good lightweight threaded execution. The 1.4 revision of the JRE for Linux starts to address those problems, as do the new I/O libraries and some of SGI's work on KIO.
As for worrying about all that icky memory stuff. I want to worry about it. My programs are faster and better designed for it.
I personally have my doubts that you of all programmers on the planet has memory management down to an art. Nonetheless, I think the great number of memory-leaking C++ programs and libraries out there testify that you are rare if having to worry about memory management makes your programs better. The garbage collector in Java is admittedly the weakest part of the platform still, but it's a tricky problem, and it is being tackled steadily. The gc in J2SE 1.4 is reportedly much more efficient than its predecessors.
It also makes me extremely nervous that Sun still has such tight control of it.
Sun can't make a single change to the language or API specs outside of the Java Community Process these days. They are responsible for the official implentations of the J2SE on Windows, Linux/x86, and Solaris. They are the administrators of compatibility testing, and they own the trademark. So basically, the only difference between them and Linus Torvalds is that they require passing a compatibility suite before you can use their trademark. That and they can't change anything without community input. Gosh, that's tight-fisted control!
Right...
Not to be nitpicky, but you mention providing marketable skills & performance isn't the issue. If Java is a slow performer, wouldn't it tend to hurt students more learning a language that is slow, and klunky? Last I checked, there were plenty of jobs available for C & C++ programmers. I have a feeling that Java may be a fad, and C/C++ will be around and fall back in favor unless Java really takes off.
Java lets you do some cool stuff, and it lets you do some really klunky stuff, but it isn't designed for performance. Any industry that is CPU bound (Simulation, number crunching, gaming, local applications, etc.) needs to be coded to run fast. Industries that are network bound (ISP's, ASP's, Portals, etc.) don't really care about how much the CPU is choking because the network is the bottleneck. I have a feeling, once the network is no longer the bottleneck, Java either better get fast quick, or it's going to be going back to C/C++ for speed.
Obligatory flamebait disclaimer: I don't think C and C++ are going away, or that Java is the One True Language. However, it is ridiculous to assert that Java is slow, poorly adopted, or unsuited to real-world applications in the face of overwhelming evidence to the contrary. Very serious companies like Oracle, Sybase, IBM, Macromedia/Allaire, Borland and of course Sun, are banking lots of money on Java's success, recognizing that it's a mature, robust, stable, fast language for very serious development.
Right...
Every time there is a discussion on Java, the same complaints come up:
Guess what, folks - most of that hasn't been true for the past couple of years, and it's getting better all the time. The stuff that you're not and won't be allowed to do is prohibited for the most part because it's dangerous and counter-productive. Java, like any widely-adopted language, does not simply cater to the 31337 hax0r.
I've helped teach a class for the AP and IB CS exams, and I'll tell you what they're about more than anything else - algorithms. That certainly doesn't benefit more from C/C++ than it does from Java. Hell, if that were the concern, we'd use Haskell! The point is, the class's focus isn't on pointer arithmetic, code optimization, or any other topic that makes C++ a more natural choice than Java. As a matter of fact, having to consider those things make C++ an obstacle to understanding, rather than an aid. I'm glad the College Board is changing the language to Java - it's the right thing to do for the level of understanding they're trying to teach.
Right...
A few years ago I was asked to teach a Java class. As I got into it, the thing that struck me as being the most annoying was the requirement for error handeling. When I was trying to explain regular syntax, flow and procedure calls, I had to keep including exception syntax just to make it compile. For a while you can just wave it off and say "just include this for now, we'll go over it later". But that means you can't give really open design assignments. It has to be very limited so they can use the few exception examples and still have it compile.
There is nothing so silly as other peoples traditions, and nothing so sacred as our own.
All these CS graduates with no idea about machine internals are inflating my EE salary! More java! Yeah! VB too!
Embedded programmers rule :).
..don't panic
Let's face it, most tutorial languages are picked for being high level, and having a fairly shallow learning curve. When I started learning programming, Pascal was used, which was fine in the days of purely procedural programming. Now that OO is more or less the defacto way of thinking about things (NOT to say that we should only be programming in OO languages), it makes sense to go with Java. Java was designed from the very very beginning with the explicit goal of making it harder to make mistakes - errors are caught up-front as much as possible.
Java has:
1) strict typing
2) dynamic linking
3) built-in memory management
4) a consistent implementation and rich libraries from a single vendor (for better or for worse)
5) works *identically* on many platforms ("identically" is the key here...we don't need to be spending half our time teaching build environments for various systems)
For all these reasons, it makes sense to use Java as a beginning language. The basic programming concepts are all there (yes, even resource management). The problem with C and C++ is that it is very easy to obscure larger concepts with intimate technical details, the learning curve is steep. I remember when I was learning Pascal, it was as if the class hit a brick wall when pointers were introduced. Imagine if learning pointers and intimate machine-dependent ("words"??) memory management was the prerequisite to larger programming concepts such as conditional statements, iteration, recursion, etc. The whole learning process would be stymied.
And I used to be one of the oh-so-cool C++ programmers who thought that Java was just a kindergarten-level "fad", and scoffed at it when it was used to teach programming in CS courses. Now enterprise Java programming is my day job, and I can attest to the fact that it is NOT a fad, is very powerful, and is used to do some really serious, and really cool stuff. I'm sure assembly programmers said "C?? You don't even need to know what REGISTERS are to use that!!".
It's 10 PM. Do you know if you're un-American?
I would suggest the following: an OO programming languange shouldn't be taught as a learning language at all. What CS students need to learn in their intro class is how languanges and computers and programming languages work, not OO design methodology. Java is just too far removed from the concepts of "hardware" and a real "compiler" to teach anything useful about how computers work, and C and C++ are too complex to teach anything truly useful about programming languages.
Instead, I would suggest using something like Scheme or LISP as a teaching languange. My first college programming class was in Scheme, and while I had no great love for the language while taking the course, it taught me much more useful things about programming then Java ever could have. The concept of a stack is very important in scheme; this relates directly to the way an OS works with memory. Scheme is also something that people are not too likely to come into the class with any experience with, so all the students are on a level playing field; you don't have anyone thinking they really know what they're doing in C and therefore ignoring all the instruction and useful conceptual information...
CS students need to learn good OO design, but that should be saved for their second programming class, IMHO. What they need to learn in the first one is how programming languages work, so that they have a good foundation to work from later. Scheme may not be a marketable job skill, but learning how to program in that kind of language will give someone a much stronger base to build skills in C/C++/Java/whatever on later.
However, in the OO S.Eng course, the first thing we learned was UML, and IMHO, that is the best way to learn OOP, then apply your abstractions and inheritance to whatever language you want.
Of course, different people have different learning styles. Myself, it took me 6 months to figure out that in Japanese -te form verbs are equivalent to -ing verbs in English. Once I had something for the new concepts to relate to, I was happily a-conjugatin'! Too bad there's nothing like that for kanji, or I'd be able to *read* most of my tankoubon...
And I leave you with some words of wisdom from L. Flon quoted in the "Cow" book
I rest my case.I only take a drink on two occasions - when I'm thirsty and when I'm not.
I only take a drink on two occasions - when I'm thirsty and when I'm not.
Brendan Behan
Object-oriented languages are difficult to understand when you have no previous programming knowledge. :)
I used to work as a programming teaching in a CS school, (Supinfo Paris) and some people learned only OO-languages (C++ and Java) . The problem is that they were only able to think OO. They had a lot of pain to code in C language, they created a lot of structures and functions for nothing, and inefficient code. They were unable to solve simple problems with simple code, because they always wanted to solve problems with objects.
On the other hand, people who are already familiar with non-OO languages are mastering the iterative programming basics : loops, structures, tests, types, etc. And they can switch to OO-languages easily by thinking that classes are just structures with functions in them.
The lessons were in the following order : C, C++, (OpenGL, GTK, sockets, SDL, etc), Java, Java assembly, Perl.
Every time we started a new language, we started with the same examples so that people can easily understand the special concepts of every language. And they were quite amazed to see that 3 lines of Perl were doing the same thing that what needed 200 lines of C before
It worked quite well. Most people who weren't familiar with CS understood every step.
My ideal is that everybody starts with raw assembly language, so that when we then use compilers and virtual machines, they can really understand WHAT THE MACHINE IS DOING, not only abstract algorithms. This is important for optimizations, and to understand the concept of memory pointers. Ironically, as I did only assembly programming for years, I can hardly work without pointers. Java and Perl gave me pain, because I couldn't understand that an "array" isn't a buffer and that handles aren't address. And today, people don't like to learn assembler, that's a pity.
I strongly advise you to teach OpenGL, whatever language you are teaching (there are bindings for a lot of languages and platforms) . OpenGL is simple to understand, produces eye-candy results, and students love this.
{{.sig}}
All true, but the numbers are 80-20. It's not a fuzzy sum ("x" and "100-x"), because it isn't a sum in the first place. It's a ratio; 80% of the time is spent in 20% of the code. Two different nouns; you can't borrow from one and give to the other. The fact that they add to 100 is coincidence.You make a very good point in that MIX/MIXAL was never advocated as a first programming language. I just wanted to note...
What's more, it's a recursive ratio. 64% of the time is spent in 4% of the code.
Proof? Examples? How the ratio was calculated in the first place? See either volume I or III of -- what else -- Knuth. :-)
You cannot apply a technological solution to a sociological problem. (Edwards' Law)
Hear, hear. I'm sick of seeing freshly-minted Java programmers grunt out mounds of steaming O(n!) code, believing that "this is good cuz it's Java."
Knuth continues to use MIX (and the new MMIX) and MIXAL in TAOCP for this reason; once you know how the computer works, and which algorithms are the proper ones to use, your choice of high-level language often becomes irrelevent. Just a choice of style.
Wake up, people: you can write FORTRAN in any language.
You cannot apply a technological solution to a sociological problem. (Edwards' Law)
There's a really great book out called _Accelerated C++_, by Koenig and Moo. (Yes folks, that Koenig and that Moo, the C++ gods.) It's a very new approach to teaching C++ as a first language, and everybody who's used it or even just reviewed it has loved it.
It doesn't even introduce pointers for several chapters. Students learn how to write simple loops, manage collections of things using std::vector, do the common 90% of string-related tasks using std::string, write some useful and practical programs, all before ever seeing a pointer.
Side note: the book is part of the C++ In-Depth series, being edited by Stroustrup. One of the rules for the series is that the main body text of the book must be no more than 300 pages. No filler crap, no 1500-page tomes to raise revenue; make your point simple and clear and then shut up.
You cannot apply a technological solution to a sociological problem. (Edwards' Law)
I teach CS - and teach CS to beginners and I use Java. The reasons are simple - its free, available on most platforms, there's a good deal of documentation and books available, its relatively simple, and you can do graphics with only a bit of code overhead.
For the most part I try to give out assignments in which most of the code is provided by me and I ask the students to change it, add a few things and so on. Having taught CS to beginners for a number of years now, this has been the most successful for me - but its labor intensive - I usually require the students to do a 2 hour lab each week and these function best when I have enough TA's (who can be second or third year undergraduates) to have one for every 6 or so students. I like graphics because the students get to <b> see </b> results quickly.
My goals though may be different than other instructors at this level - I want students to start to <b> look </b> at code quickly and to start to think about how to check their results (Does it work?)
I've thought about Smalltalk - and looked seriously at squeak, but I think the learning curve there is quite steep at the beginning and there is a relative lack of good documentation.
I don't use C or C++ - C pointers are tough and C++ is just way to big a language to learn quickly unless you skip all the stuff that makes it powerful (and dangerous).
But I also try to stress that the language doesn't matter - that learning new languages and systems should be something that CS people do all the time. And I try to get students to learn languages that use seriously different paradigms - it doesnt matter if the language is popular - its what the student is <b> thinking </b> about the software process that is important. I've recently been using Haskell in classes - but the students claim that Haskell is not used anywhere and that it is thereby a waste of time. My goal though is not to teach them Haskell so much as to teach them a programming language that is radically different than any they've already learned.
However, I've been branded "the worst CS teacher ever" by some of my students (but I've also had students say that I was the only CS teacher that they learned anything valuable from). My current employer "Eastern Orgone University" is terminating me in part because I've required students to learn new languages. Instead they've found someone who is requiring students in early courses to pass in programs on paper.
"sometimes a bad programmer is better than no programmer"
Ewwwww! A bad programmer can increase (and quite radically) the workload of the others on the project. A bad programmer can cause a project to fail completely (I was in a startup where one of the programmers was convinced he was the "Java God" and he basicly went unchecked and destroyed the project and the company). A bad programmer might let a bug through that could cause injury or death. (Admittedly, so can a good progrmmer, but its less likely.)
Bad programmers are Bad News .
... in the process, you're preparing them to be professional programmers, because they're learning the programming environment they're likely to end up using in their professional lives.
:-)
And it wasn't that long ago that you could say Fortran was the language they'd most likely be using, or COBOL, or.. etc. The point is languages change. Just because it's what you happen to be using now doesn't mean it will be the primary language in the future. There's a whole lotta COBOL programmers who found out the hard way about that. Fortunately, Y2K came along and they had work for a while.
PS, if they learn C and C++, it's easy for them to learn Java! But, if they learn Java (and only Java), then by your argument that "C++ is much more complex and difficult"
By that argument, Java sounds ideal as an introductory language. After all, things getting more complex and difficult is how courses are supposed to go right? We generally don't teach how to make beef wellington before teaching how to make apple pie, right? Though if we did, I'm sure the pie would be a snap.
Don't teach Freshmen how to make applets! Or SERVLETS!? Are you nuts! Teach them C and C++, and then it's easy for them to learn that other stuff, later!
Tell you what.. how about we use Java to teach them how to make standard applications first? You know, those things they taught you in your first C classes? A Huffman zip encoder and all that kind of jazz.
Don't even bother with applets or servlets or even threads until they've got a good foundation in the language and in the OOP concepts.
That Jesus Christ guy is getting some terrible lag... it took him 3 days to respawn! -NJ CoolBreeze
I would buy what you're saying except that JBuilder (Foundation) is gratis.
Until our children are no longer molded into castrated sheep democracy remains a fake and a danger. -A. S. Neill
As far as for a CS course, it depends on what that course is trying to teach. In my university courses, we are never taught a language, we have to pick that up ourselves, the language is used as a tool to express CS ideas. In this way, a language which has many drawbacks overall may still be a useful tool.
For an introduction to OO ideas, Java may be very useful because students don't have to deal with explicit pointers/references or garbage collection, they can focus more on the ideas of OO.
Something like Pascal is often considered outdated today, but I found that it was a good language to use for learning about procedural programming and CS fundamentals in a 1st year course.
Overall, my point is that every language that could be used has faults, but if it assists students in learning about the ideas of the course, then it is useful. IMO, courses that only teach languages are a waste of time. Languages in use will change, the ideas behind them and that for which we use them is what we need to learn.
---
I hope you're not pretending to be evil while secretly being good. That would be dishonest.
Put G4's with OS X in all CS labs, and teach Objective C.
The following sentence is TRUE. The previous sentence is FALSE.
Uh, hello, this was supposed to be funny, people!
one hundred twenty
is just enough characters
to write a haiku
First, I find it difficult to believe that there aren't a sufficient number of Java development jobs. Second, the point of a CS education should not be to learn the most popular language, but to learn the concepts of programming so that you can easily pick up new languages as required. I find Java much better suited to that task than C++ with its mountains of complex features and wacky syntax.
if you're looking for a high-performance language you can't rely on a system with garbage collection and run-time linking.
This is not necessarily the case; recent Hotspot JVMs have been producing impressive results. Yes, you'll probably always be able to beat it with optimized C, like you'll always be able to beat C with optimized assembly, but for the vast majority of tasks it is more than fast enough.
Not to mention that truly understanding what's going on with memory and pointers, while posing a steeper learning curve, really helps you understand how the machine deals with your programs.
Here I agree. Nobody should be able to get a CS degree without knowing C and being able to do pointer tricks. But for introductory classes, which probably have lots of non-CS students, that's going to be overkill.
How to solve most of our problems: 1.Lots of nuclear plants. 2.Cure aging.
Yes, there are. You're absolutely right that applets and client-side Java in general have failed, but it's very heavily used in enterprise and back-end products that you don't see on the shelves at CompUSA.
Passing by reference. In order to pass values by reference in Java, you have to make another class to do it?
Why are you passing values by reference? Very often there's a cleaner way to do it. Personally, I like that in Java and C when I write "foo(a,b)" I can be sure that a and b will be the same afterwards, as compared to C++ where they might be passed by reference and I have to look at the declaration of foo to tell.
Garbage Collection is a clever trick, but if you get used to that net being under you, and you've never used another language, programming in C will be a rude shock.
Professional developers should understand memory management and be familiar with C. But an introductory class would be much better served by discussing loops, methods, and basic algorithms rather than the details of malloc/free/new/delete.
My point is that it takes more effort to go from Java to C++, than it takes to go from C++ to Java.
Of course it does, because C++ is much more complex and difficult. I'm experienced in both, and have found Java to almost always be a better choice.
(Try wrighting an applet that actually does anything useful, and then try to run it under Netscape on a Macintosh.
Again, that's client side. Sun completely screwed up by putting the burden of supporting Java applets on browser developers, thereby insuring spectacular incompatibilities. These issues go away on the server side. Our complex web applications run equally well on Solaris, NT, and Mac OS X, with 0 lines of code changed.
Java is nowhere near as bad as you think it is. I understand where you're coming from most of your exposure to it has been buggy applets, but it is a real language capable of doing real work, in many cases much more quickly and reliably than would be possible in C++.
How to solve most of our problems: 1.Lots of nuclear plants. 2.Cure aging.
My college taught Pascal (Borland's) which is a wonderful language that does include wonderfully implemented OOP. It was great for the first years who tend to know nothing or too much for their own good. Next was C/C++. At the same time, we built the hardware (simple ALU and bus) and programmed with binary, then learned assembly. After all that the language is secondary for most of us -- we had to learn VB for one course. We hated it, but it wasn't hard. Same with Java (hated it a little less). In my algorithms course, we programmed in all kinds of languages and saw how in many cases a better algorithm design was far more important than what language we used. That's CS.
Am I the only one here who knows that for ta language to be pure object it has to support it's most basic types ( int, long, float ) in pure objects. Java has native bytes, chars, shorts, ints and longs. That's not pure to me, that's still Object Oriented. For it to be purely object you would have to code a bit like this :
Integer a,b;
a.equals(5);
b.equals(6);
a.add(b);
a.getValue();
This is pure object.
"The answer to the Question of Life, the Universe and Everything is... 42"
As for performance, it is slower than some languages closer to the heart of a computer, but speed is not the point of an educational language, constructs and methodology are.
Not to be nitpicky, but you mention providing marketable skills & performance isn't the issue. If Java is a slow performer, wouldn't it tend to hurt students more learning a language that is slow, and klunky? Last I checked, there were plenty of jobs available for C & C++ programmers. I have a feeling that Java may be a fad, and C/C++ will be around and fall back in favor unless Java really takes off.
Java lets you do some cool stuff, and it lets you do some really klunky stuff, but it isn't designed for performance. Any industry that is CPU bound (Simulation, number crunching, gaming, local applications, etc.) needs to be coded to run fast. Industries that are network bound (ISP's, ASP's, Portals, etc.) don't really care about how much the CPU is choking because the network is the bottleneck. I have a feeling, once the network is no longer the bottleneck, Java either better get fast quick, or it's going to be going back to C/C++ for speed.
I tend to think that discussions along these lines generate significantly more heat than light. For starters, I would bet that many of the opinions that have been expressed with regards to learning computer science (higher level language versus lower level language, C versus Java, etc) are coming from people who probably did NOT learn what they know of computer science in the manner that they prescribe. I could easily suggest that scheme should be taught as the first computer science language followed by C then Ruby, then maybe a little Java or Smalltalk then haskell, but the fact of the matter is that this is not the progression that I made (nor do I know many of the languages that are prescribed above). For an example, I truly think that there is a lot to be learned from a language like scheme, but rather than the first, this is the LAST language I learned (having recently been T.A. for a class taught using the Wizard Book). Having already studied other programming languages, I discovered that there is a lot to learn about both the Structure and Interpretation of Computer Programs (pun intended) from that language. But what I found as a teaching assistant is that the concepts that were so clear to me from this language were not so simple for students with much less of a background in programming languages than I had.
This is part of the "expert" dilemma. If you already have a vast amount of knowledge from years of hard work, it isn't necessarily easy to prescribe how or in what order to pass this knowledge base on to others. Perhaps there does not exist an optimal starting point for everyone. Maybe you just have to start somewhere, collecting knowledge until enough connections can be made that all of a sudden you are an expert.
Another point that should probably be considered is the purpose of a computer science education. From this discussion, it's pretty clear that many people have different ideas of the purpose of a university or AP computer science education. Some seem to think that it is training for real-world programming in C or Java or whatever is the language du jour of industry. Other's consider it a ground for creating the code hacks of the future. Others in fact find it to be the place to teach computer theory for future computer science graduate students. And the replies posted here strongly reflect these biases. Perhaps different schools have a different leaning in their programs, some being theoretical schools, others trade schools. I think it's important to note that not only are there different programs, but different students, who may find different schools and classes more or less suited to their needs.
There are only two kinds of programming languages: those people always bitch about and those nobody uses.
The fundamental question is: should these kids be learning fundamental CS--algorithms and data structures--or should they be learning something practical, with which they can also learn fundamental CS (albeit applied)?
If the former, then go the way of MIT and teach Scheme (a clean, older dialect of Common LISP). See *The Structure and Interpretation of Computer Programs* (or, colloquially, SICP) for more info.
My guess is that many of these kids will go on to other disciplines. Some will just want to be hackers. Do we really want to unleash bright, potentially excellent Open Source hackers on the world with a working knowledge of Scheme only?! What might they do? Could they tweak the Linux kernel's scheduling algorithm? Hmmm.
I think the best way to teach how computers work is to use a language that talks directly to them: C. People who propose ASM have their hearts in the right place, but ASMs come in as many flavors as ice cream (and from a productivity POV, they're about as nutritious).
A course should start with 2-4 months of C. Students can learn, for example, how the instruction pointer works, how arguments are passed on the stack, and how registers are used to do various things on whatever platform they're coding to. All of this is learned as a natural result of debugging simple problems.
Having learned the basics, the course can then shift gears and talk about OOP and how C++ implements its special variety. At this point they can learn, for example, about the extern "C" linkage specification and name mangling. These things are actually very easy to understand if you've used C--and are if the utmost practical importance; many libraries are still only available in C.
Algorithms and data stuctures can act as the landscape that these kids paint with their new knowledge and tools. Learning a language like C++, that is close to the hardware, they will be able to pick up any language with much greater ease.
WRT the Java vs. C++ issue, the answer should be clear. C has been around for 30 years, C++ almost 20. There have been hundreds of compilers written. Java? Not even a standard. Oh, and let's not forget that it was patterned after C++, along with several other languages (though to a lesser degree) like Perl and <ahem> UnrealScript.
If the rationale for using Java is that they want a simpler, cleaner, don't-show-me-the-hardware-messiness language, then why choose a C++ spin-off (that retains much of the syntactical messiness)? Use an elegant, open, intuitive language. The only one out there that I know of is Python. For a good description from Eric Raymond see Why Python?
Hi-
I graduated from a CS dept. right before the Java wave took. We started with FORTRAN (about 3 months worth) and moved on to C and later C++. Now, because of the position I took, I program mainly in Java.
The difference is that Java teaches good OO (since it is required) concepts that are hopefully also being taught in the curriculum. However, procedural coding is also importiant (for example, most games are not pure OO because of memory overhead and speed etc). So I would say knowing both is a benifit.
Now, as to what language should be taught...
I make this point strongly, CS is not about programming. It's about solving problems, the fact that a computer is used to do so is secondary. Any good CS student should be able to sit down and not only be able to decide what the best language for the job is, but also learn how to use it and get the job done. Whether it's C for games, or Java for a web app, or perl, or python, or whatever.
So concerntrate on the concepts. Java is impressive on a resume, so is C and so is C++, but proving you are adaptable and resourceful and that you understand concepts is way more valuable any day than what language you learned on.
TRoy
Gee, in hindsight, this topic couldn't possibly have been an invitation to an all out flamewar over which language has the most fervent True Believers... Java! Python! C++! Assembler! Nothing like a /. shouting match.....
DO NOT LEAVE IT IS NOT REAL
I'd never consider teaching students C++ as a first language. C either.
Python yes. Java yes. Perl no. ML would be reasonable, as would Eiffel.
C and C++ need to be taught, but they should be in a Junior level course.
If I were in a "yeah, Java's not the best, but it does have a good combination of reasonable power and critical mass" mood, I'd teach java first. If I didn't care about who's using what at that moment, I'd teach python first.
Rocky Ross wrote an interesting article on this in the "Education Forum" of the most recent SIGACT News. His conclusion: Java is not a good language for introductory courses. He makes some good points, among which are that in order to make the language familiar to C/C++ programmers, Java inherited many of the ugly features of C and C++ (his big example was the poor block structure for conditionals). And I have never met anyone who has taught C/C++ as an intro course (which I have done) and thought it was a good language from a pedagogical standpoint. In fact, I'd go so far as to say that there are very few languages that I can think of that are WORSE than C and C++ as intro languages....
The good news: Java is better than C or C++ as an intro language.
The bad news: It still sucks.
Yes, understanding and modifying poorly written code isn't a skill that'll get you anywhere in the real world. </sarcasm>
The cake is a pie
If you want to teach someone a computer language so they can go out and maybe write a few programs to do things that should really be done by shell scripts, by all means use Java, or even VB. If you are trying to build a good foundation for a sound computer science career, or to develop top-notch programmers, do not teach them Java (or any other OO language) as a first language. OO provides some very useful and powerful tools for development, especially of large scale systems. It is not suitable for teaching people the foundations of computer science. If you want to take a theoretical approach to CS, a functional language would be a good choice as it exposes the logical formalisms that underly CS and information theory, for practial curricums, a procedural language is best since it closely mirrors the way computers actually work. Once someone has a strong foundation, they can learn any number of new techniques and languages easily.
Many OO programmers swear that people should start with an OO language for whatever reason, but I have quite a bit of experience with people who learned Java first, and C or Pascal first. Hands down, when it comes to understanding more complicated archetectures, even OO archetectures, the people who understand how those systems translate into something a computer can execute learn much faster and are better able to understand the tradeoffs in flexibility, convenience, and performance that different techniques make.
Seems to me Python would be a much better fit as a learning language.
You're quite correct that I haven't used it to meet a deadline like you describe. That is probably because my employers have always trusted me to set my own schedule, and I make sure I do it right. Part of doing it right for me is staying far away from the Microsoft Incompatible Dependency Suite.
I suppose VB would be good for teaching what people have to do in the real world when their language isn't up to the task at hand, and vendors have to invent new and strange things to give programmers the features they want. VB feels so hacked-together it's not even funny.
Besides, if we went by "widely-used" to decide what to teach new programmers, we'd all still be using COBOL. :-)
I'm just about to graduate from The University of Auckland with a BSc in Info Systems (which is just about the same as a CS degree). Starting from first year papers, the CS dept. teaches Java. Obviously with the more specialised areas, other languages are taught (or used) (eg. lisp, hascal, c etc.), but it is mostly Java that is used. My last paper which was with OpenGL was taught using Java (running the Magician package).
:) (eg. with php, I implement OO stuff as extensively as possible).
/. "Education" area)
Having been introduced to programming with Java, I have been able to use other languages quite easily, but I much prefer OO programming
I'm not sure if this relates to the discussion, as everything is really long and I don't want to read it, so sorry if it is not. (PS. gotta love that Blue for the titles in
Nevrar
However quite an amount of failures is also hardware driven, rockets (challanger), ships, trains, airplanes, etc. only people find it much more hard to believe if an accident is caused by software, than by hardware. (or most of the cases human failures). From what I read in the news only a minority of accidents are coused by software.
:)
You're kidding me? I am talking about things like microprocessors, ICs and logic circuits. How often does your computer hardware fail compared to the software it runs?
Might to be stupid, but designing an flexible, self changing cell logics, doing tasks, might not be easy. I know the today CPU architecture (called Neumann or?) is pretty much already taken as the wisdoms last words, it's not. But developing alternatives is fundamental research, and getting money (and brains) for this is difficult
There are a lot of researchers and engineers around the world hard at work designing reconfigurable, programmable active memories PAM). These memories are asynchronous processor arrays that are data (signal or event) driven as opposed to being clock driven. They are not only orders of magnitude faster than conventional processors, but they are also non-algorithmic: every active cell executes its instruction as soon as its data is ready. This is called event dirven or data-driven parallelism. It's analogous to the way the brain works. It's the future of computing, IMO.
Moderation Totals: Offtopic=1, Interesting=1, Funny=3, Overrated=2, Total=7.
Not what I would call a consensus. I had no idea this would be so controversial. I thank everyone for their replies even the negative ones.
'Parallel algorithm' is an oxymoron. Think about it.
Software engineering will come of age when programming languages no longer exist. All programming languages (Java, Lisp, C++, etc...) share a common charateistic. They are all based on a programming technique which was first pioneered by Lady Ada Lovelace more than a century ago: the algorithm. I am convinced that the algorithmic nature of software is the primary reason that computer applications are so unreliable and that software development is so time consuming and expensive.
It is a known fact that hardware is orders of magnitude more reliable than software. The most obvious difference between software systems and hardware is that the former is algorithmic whereas the latter is based on parallel streams of signals.
A signal-based system is ideal for the implementation of work-once, work-always components that can snap together at the click of a mouse. This is because their temporal signatures remain constant. By contrast, one can never be sure when an algorithm will be done and this is detrimental to stability. Algorithms should thefore be implemented on top of a signal based system. They should not be the basis of automation. In the future we will have technologies that allow computer memories to instantly reconfigure themselves into parallel logic circuits. In the meantime, even though the Von Neuman paradigm forces sequentiality on us, signal flow parallelism can be easily emulated in software so as to hide the serial nature of processors from the application developper.
Unless computer scientists wake up from their algorithmic stupor, computer science will continue to limp along, badly. More multi-million dollar space probes will malfunction, airplanes will crash, electronic stock exchanges will suffer from glitches and airports will shut down. Half a century, thousands of lives and trillions of dollars later, we'll kick ourselves in the rear and ask ourselves "why have we been so damn stupid for so long?"
I've taken two "introductory" programming courses, one in C++, the other in Java. I found the Java course really got down to a lot more abstract programming concepts. In the C++ course we were always bogged down with limitations of the language and had to use classes written by the instructor to work on certain concepts (which is of course entirely stupid because nobody else in industry has ever heard of those classes). In the Java course we weren't using any non-standard classes and generally just got a lot more done. 'nuff said.
"Caffeine is not an option. Caffeine is a way of life."
There is more exteraneous noise in Java than in several other OO-capable languages (C++ excluded). This extra required syntax and the REQUIREMENT to program in OO makes java as a first or even high-school language difficult.
If you take someone straight out of BASIC or Pascal and throw them into Java, you might have some obsticles - They're learning too much all at once. In High school, the added complexity probably isn't warranted (we want to spark interest in our youth), and in College, people that transition majors may need more hand-holding.
Not really true nor a factor. For a large number of institutions (primarily High School), Windows is the development platform. It's harder to get easy-to-use free Java tools for Windows. Yes, you can find them, but it's not an obvious choice. The second part of my rebuttle suggests that an institution spends the money on the right tools (within their priorities for a given carriculum). We used Apple IIe's with Apple Pascal. It was a purchased license, but the whole system cost was marginal.
To counter this, Java requires expensive hardware (namely, no donated 386 / 486 is going to be happy in a [education] development environment), though these are probably what you'll find in poorer schools.. Which has to facilitate advanced students taking AP courses...
Then they'd all teach Visual Basic as a first language. Since you're garunteed some sort of employment. It's almost impossible to avoid VB these days.
-Michael
Perhaps I'm biased cause Perl is what I've been using for a while, but I think Perl would be a fantastic language to learn programming. The big reason for this is the Perl philosophy: TIMTOWTDI (There's more than one way to do it). As learning programming goes, I think Perl is a great choice because of this.
Perl 5 is fully object oriented, but only if you want it to be. I find Java is too bulky of a programming language to be truly effective as a teaching language. There is too much stuff you must learn before you can get anything of any use done. Perl is great because you can jump right in very easily, and write low complexity programs quickly. (one liners anyone?)
Perl also has probably the best set of standardized libraries aside from Java. CPAN has a module for just about anything you could need, all with well published OO interfaces. Perl has many features which could be considered syntactic sugar (several different ways to perform 'if-then' program control), but are actually very powerful for writing coherant (understandable/maintainable) programs.
I also think theres nothing wrong with BASIC or Visual BASIC (aside from MS only) in high school. With 1ghz machines, high school students will most likely not program anything that's going to benefit from the fast execution that C and C++ offer, and the learning curve and time to program are too big. BASIC is great for learning control flow and the very basics of programming.
While I appreciate that learning memory allocation and what is actually being performed at the assembly level are paramount to being a professional programmer, these details will only slow down beginners.
As a background on me, I learned (in chronological order):
1. BASIC
2. Visual BASIC
3. Java
4. Prolog/Scheme (minimally)
5. 6811 Assembly
6. C/C++
7. Perl
I havn't looked into it much, but I've also heard really good things about Python.
ps. As has been mentioned before, the _most_ important thing when teaching is to teach how to think algorithmically and develop maintainable solutions which perform correctly in the appropriate time. Language is not the most important thing.
Java has no way to pass variables by reference. This is just bullshit. For primitive types, this doesn't even make sense. However, pointers to primitives are another way to pass references to arrays in C/C++, so you are probably just ignorant of how Java handles arrays of primitives. For reference types, it is the reference that is passed by value. As long as you are using reference variables (anything that is an Object) in Java, you are passing by reference. Repeat after me: Java lacks pointer arithmetic, not pointers.
On the other hand, memory management, pointer arithmetic and concepts of stack and heap are crucial if you want CS education. After I learned C along with these concepts when I was 15, I had no trouble at all learning semantics of C++ and Java along with a bunch of other languages. C is probably the "proto-language" in this respect, it gives you the important low-level understanding, the essentials. Any CS student should be able to think on multiple levels, from high level design to heap allocation behavior to assembly (if needed).
Distinguishing the difficulty of teaching object oriented design from teaching procedural programming is also important. Object orientation is useful when (the complexity of the system you are building/the environment you are building for/your extensibility requirements) outmatches your capability to build the system by procedural means. For someone who is starting to learn programming from scratch, procedural concepts are easier to grasp that object oriented ones. This has the additional advantage of letting the person hit the complexity ceiling himself and see what problems object orientation solves, rather than accepting them in blind faith.
"The deluded are always filled with absolutes. The rest of us have to live with ambiguity." - Aristoi, Walter Jon Willia
Of course, Python is a great language, and I could very easily see that a course could be designed with it in mind. But the same could be said for lisp, or prolog, ML, or any number of other languages. But teaching C or C++, or some form of assembly first is just dumb. Beginning programmers should be concerned with *concepts* not implementation details. Learning data structures or basic algorithms becomes much more difficult when you have to deal with pointer math.
Java isn't the end-all, be-all of languages, but it is pretty nice. It seems like a good choice for beginners. Comments on its non-free nature are pretty wrongheaded. The Java standard is a published spec. Anyone can make a Java-compatible compiler or Virtual Machine...they just can't call it Java. GJ (Generic Java) is one such implementation. GCC-Java also is a free java compiler. So I don't see how it is any different than C in that respect, other than Sun controls the standard to a large extent.
I would recommend Java as a language for introductory programming courses simply because it is clean, safe and conceptually clear. It would allow the instructor to concentrate on OOP and general programming concepts without getting too bogged down in command-line compilers, makefiles, platform differences, etc.
On the other hand, I do not recommend a CS curriculum that focuses strictly on Java or OOP. In my undergrad courses, I had to use Pascal, x86 assembler, C and Java -- in order to understand the concepts at different levels, not for the purpose of "language collecting". Any good curriculum should touch on assembly, procedural, OOP and functional paradigms. Note I said "touch on". That doesn't mean that every student should be fully trained in language X, Y and Z. But every student should learn the pros and cons of different types of languages. Otherwise, you might as well just go to a Sun Java certification course: you're not a computer scientist, you're a programmer.
Smalltalk or Eiffel would be my choices; they are both better for teaching OO than either C++ or Java.
Eiffel is the cleanest and most readable, imo.
I program in Java for a living. It gets the job done, but it isn't very elegant.
If you think C/C++ should be the language to teach low level and memory management stuff, you obviously haven't been to school the past 10 years. When I was at uni, we used several different assembly languages when we needed to learn about registers and other CPU functions. When we needed to learn about memory management and virtual memory, we had a 1MB toy OS and some special compiler to play with. When you want to learn about OO, then obviously you want an OO language to teach it with.
Lets face it. C++ is an OO addon to C. You can use all the classes and STL you want and still program procedurally. At least Java would encourage you not to do so.
OO and OS are 2 different classes. Why would you choose a language to do both instead of choosing the most appropriate for each one?
---
In its introductory CS course (6.001), MIT uses scheme.
:-)
The reason that MIT uses scheme is that it teaches the most important concepts of programming without complex syntax. The point of 6.001 is to teach students how to think about problems recursively, how to approach an iterative process, how to break large problems into smaller ones. These should be the main objectives of any introductory CS class; the particular language used isn't that important as long as it doesn't get in the way of the concepts.
Unfortunately, Java does just that. Its syntax is complex and arguably clumsy; it forces the OOP paradigm (which is, for most things, absolute crap!); it can, for a beginner, turn the easiest task into a fight with the compiler. In essence, it fails the "doesn't impede learning the concepts" litmus test. As such, it's not the right language to use for an introductory course.
Interestingly, the same arguments can (to a lesser extent) be made against C++ as an introductory programming language. Perhaps even ANSI C is too complex syntactically and semantically to be good for people just being introduced to programming concepts. I happen to like programming in C a hell of a lot more than in scheme (as I'm sure most here do), but try to remember the first time you ever wrote a program. Which would you rather write?
#include <stdio.h>
void main(void)
{
printf("Hello world!\n");
return;
}
or
(display "Hello world")
A separate issue related to the above is, of course, the procedural vs. functional language argument; that's something else entirely, and enough arguments have already been made on that topic, so I won't expend any more wrist on the subject.
I am going to have to disagree with you. Java is nice, but I would have to agree with tulare that it is clunky and slow. I also don't like drilling the idea of OOP into a new students head just for the sake of OOP.
My first language was BASIC when I was eight or nine years old. It was simple enough to earn basic concepts of programming--even though it was spaghetti code. There was not a whole lot of structure to the language, and this allow me to focus more on what each structure did.
I think using OOP just for the sake of OOP is plain stupid and narrow minded. OOP is today's functional programming. The next generation may come up with even better ways to program. By forcing the student to learn OOP right away, you are narrowinf the students view of a problem. The student might not realize there is a simpler way to tackle a problem that doesn't involve wrapping something in an object.
At my almamater, Pascal was taught as the main language, and you could either learn FORTRAN or COBOL depending on what avenue you took CS/Business or CS/Mathematics. I would rather see either C/C++ or Pascal taught as the introductory language because they both can provide a wide view of programming and help to get the basics down.
I think assembly should be used when you get really low into how the computer works. This way get a hands on idea of what happens with the registers, memory, etc. Of course when I took the class, my professor (single guy with PhD. in Computer Science Mathematics) had us hand write out an assembly code program. Then he had created a machine code interpreter, and he required us to change the machine code into 0s and 1s. Then we had to run it and produce out put. We had to hand in everything.
OOP is just the current fad in programming in the Univerisities. In the real world, most people I know use various meths of programming from component and OOP to functional--usually the programs have both.
It is best to keep the students view wide and open allowing the student a better chance of adapting in the future to new programming ideas and concepts. When we start using quantum, or light based, computers, the resources will probably be limited and we'll end up going back to funcitonal programming to save on space because pure OOP waste a lot of space, and pure OOP does a lot of things that are not really necessary.
At the next eco-hypocrisy-meeting, count the private jets used to get to the meeting. Should be interesting to see that
*frown*
Easy? Interesting. I'm far more at home in C/C++ due to their non-OO structure -- perhaps that comes from having a decent math background, where algorithms usually translate more easily into sequences of instructions rather than objects and methods.
The GC probably isn't *that* critical early on -- for a small project in, say, C/C++, memory leaks really shouldn't happen often after a bit of experience, at least when not trying funky tricks. Careful use of destructors, documentation indicating where memory is allocated and who's responsibility it is to deallocate it, and a careful design help -- and tools like Rational Software's Purify can be used to track down leaks that remain if needed. When TA-ing low-level courses, I saw far more conceptual errors than memory leaks, and the former's what I'd worry about more regardless of the language.
Only the dead have seen the end of war.
8) and 9) contradict each other, and that's the original poster's point -- that no one language will suffice for four years because none can possibly have all the traits that are arguably important to teach. For instance, could have cited purely functional programming and purely imperative programming as another major contradiction; both are worth learning, but no language has both restrictions.
As for low-level foo, it might be interesting to know when you really care about performance. For instance, cache miss latencies are expensive, and therefore knowing the cache design of the intended platform can be factor when accessing memory -- you don't want a loop stride that makes every subsequent iteration result in a cache miss. If you want to design, say, a main-memory database engine, things like this can be important.
Only the dead have seen the end of war.
It's not the language that teaches elegance and beauty -- it's the professor and TAs. If bad coding practices lose points, and explanations are provided, the students will likely learn... whereas one can write horrible Java, or Perl, or Lisp, or C with ease if the course instructors do NOT value organization and comprehensibility.
Only the dead have seen the end of war.
It depends on your application. If performance is an issue, you may want a lower-level language like C or C++ that lets you explicitly tweak memory usage patterns. And C++, other than sheer perversions like multiple inheritance (which is something that I have rarely either used or seen -- because it rarely seems appropriate), really isn't much harder than C. Classes are glorified C structures with functions (methods) that are members and some other bits of sugar (the public/private et al foo isn't in C).
Java's interface handling (the 'class BLAH implements FOO, BAR, BAZ interfaces') is actually quite nifty, 'tho. It'd be uglier to do the same thing in Java.
FYI, the two programming languages I use most are C/C++ (treating them as one because they're that similar... and the C++ programs I write are usually imperative + some OO syntatic sugar rather than radically OO designs), and Perl (which is nice for rapid prototyping since it's interpreted, and support for native associative arrays and references is sweet -- it's trivial to do complicated hierarchical structures in Perl. Plus, a built-in regex parser is a pretty useful sometimes).
Only the dead have seen the end of war.
I was a computers science major at a small liberal arts college, so I am skewed towards believing that understanding the theory of data & algorithms should be the subject of intro courses. Given that, I definitely don't think that assembly is a good starting language (as some people have suggested). It also makes me think that performance of the generated code is a HORRIBLE way to judge teaching languages. Based on those arguments, I don't think that JAVA is a bad programming language for intro courses at all.
However, I do think that JAVA is a bad intro course, based on my experience. During my senior year at Macalester (my college) I was a student aide for second semester CS course. The course had previously been taught in C++, but was taught in JAVA the year I was a student aide. The first semester course was taught in Scheme (a good choice IMHO). The major problem that I ran into when helping students with JAVA is that it isn't a pure OO language. It is a hybrid language: both procedural and OO. That seemed to be the real sticking point. Of course C++ is even more of a bastard language than JAVA is, so that doesn't make it a better choice.
I think that a good choice is any pure programming language. Scheme is an (almost) pure functional language. C and Pascal are pure procedural languages. Smalltalk is a pure OO language. I think that those languages are good choices, except for maybe C. I think that an intro course should concentrate on theory, not segfaults. We get to spend the rest of our lives hunting those down.
I haven't had a lot of experience with it, but SmallTalk is a great language for learning object-oriented principles, because it is purely object oriented; everything in the language is an object, from integers to windows to text and all methods act on an object. In that respect, it's a bit closer to "human thinking" than most programming languages.
I did not study SmallTalk until my Programming Languages Concepts in my junior year here at Penn State, but I wish I had studied it earlier. My initial reaction to the language was it would make a perfect "introduction to programming" language, particulary object-oriented programming. Squeak is a great implementation of SmallTalk, very intuative design and easy to examine classes, objects, and methods.
But I guess that would be copyright infringement or license violation or whatever..
ad
What are you talking about? There's no way to pass objects around EXCEPT by reference.
So, in order to have a method change a value that you pass to it, you have to encapsulate it in a class.
Oh, well, yeah. That's what true OO is all about.
---
---
It's quite simple. You want a language that will help introduce the most issues purely, yet one that is actually used in the industry and not viewed as a waste of time by beginning students. Java is more pure as far as OO concepts go that C++, and is more widely used than most any other language (other that c/c++). With all the Java hype in the news, students may be more motivated to learn Java (the "new thing"). I just hope that at some point in a curriculum, students are also exposed to languages which represent different programming paradigms like Prolog, Lisp, and ML. Student's should have the chance to see that the imperative languages aren't the only and often not the easiest solution. (Wouldn't it be interesting to see students introduced to OO concepts via CLOS??)
"The best laid plans of mice and men gang oft agley..." - ROBERT BURNS
You're right, if they only knew Java, and never went on to learn other languages, they would be tripped up by those things you mentioned, but who only learns one language? You have to start on something, and by no means is it going to teach you everything.
In fact, one could argue that because they don't have to worry about things such as memory leaks and pointers in general (of course, once they do, they'll realize it's not that Java has no pointers, it's nothing but pointers--const pointers), it's a better teaching language. And that's key, it's being used to teach basic CS concepts, not the entire universe.
Well, just this past semester I had my programming languages class where we covered Lisp, Prolog and C/C++. And let me tell you, us C/C++ programmers were way more prepared for what hit us. We spent less time on assignments, did better on the tests with less study time, and in general understood better what was going on.
I definitely will agree that Java has a place. There are some great things about Java, and some really crappy things about Java.
I think the greatest danger I see in teaching Java as an intro language is that it removes the user too much from what is actually taking place in the computer when the application is running. Trying to explain to someone what overflow is when they don't even know what a heap is can be difficult. I would think that a Java based cirriculum could be made that also ensures students understand what's going on internally, and it is important to stay current with what's going on in the industry. But let's not cripple students early on, setting them up to fail later when they come face to face with memory management and the like.
No seriously, I have to say that the parent comment claimed that C and C++ are more intuitive. Maybe it's because I had a course in Software Engineering before I started programming (in SE they teach you to think about programming in very Object-Oriented ways, well the course I took anyway). I found Java much more intuitive...I had to use C the same term to write a control program for a robot...I can tell you it was pretty ugly. I found it was so easy to make mistakes in C that were very hard to trace.
;)
Ok people don't diss me coz I'm crap at programming...I guess I'm just not smart enough. But from my point of view, Java is a much better language to teach programming than C or C++.
Of course for real software development, Java quite often is not a realistic choice, mainly because the Swing libraries are, well... a little slow some times
Ok my first sentence didn't make any sense at all. Give me a break I've been forced to get drunk by my flatmates tonight :) . Anyway, what I meant to say is something like:
No seriously, I have to say that I found it Odd that the parent comment claimed that C and C++ are more intuitive than Java.
Why learn assembly first? That is the WRONG way (IMHO of course). The way I see it, CS should be taught from the top down. First, you learn an OO language like C++. Why? Object Oriented design methodelegy is extremely high level and abstracted.
Next, on our trip to the bottom, a funtional language like C should be taught. If you have ever read "The C++ Programming Language" (Bjarne Stroupstrup), then you will remember that Bjarne said that learning C++ first is better than learning C first and moving to C++ later. The problem with going from functional->object oriented is you will try to do functional programming in the object oriented language. That doesn't come put too pretty. But, anyway, the reason I would teach C after C++ is because starting at the top and going down towards the heart of the computer is better.
After C comes assembly. Pick your choice--x86, PPC, m86k, or MIPS. Or even any other assembly. Assembly belongs last. Why? This is the part that can become useless. x86 is big now, but will it be in 10 years? Will processor architectures be the same in 10 years? If you start here, Then you will end up trying to make all your programs run best on the architecture you learned. So, when you got to an OO language, it would still be fairly low level, and the idea of OO design would be lost upon you. If you go from OO to assembly, you won't have this problem. You will have an appreciation for what the compiler does for you. Knowing assembly will help you to optimize your current programs, but the idea of portability will have already been ingrained into your skull, never to be forgotten.
Now, onto Java. Don't teach it! If a school wants to teach pure OO, then use ruby. Ruby is 100% pure OO, and would be a great teaching language. If Ruby can't be taught, then at least teach Python. Why must people choose Java for pure-OO when there are other languages that do it so much better, and in a free way (Ruby is free software).
So, maybe I am little biased towards OO design (I find that OO programs are easier to read, debug, and maintain). But, OO design does promote good code. I know I'll get flamed for this but...iostreams are many times better than C stdio. What you say! Well, it is a hell of a lot easier to learn cin >> foo that scanf("%d",foo). And, you can add the ability to input/output user defined data types with ease. You also get rid of printf() format string attacks. I see that as a huge bonus. printf("%s, moo! %d",5,"arf")...that will do a bad thing. It is impossible to screw up like that with an iostream: cout 5 "moo!" "arf" (yes, it will still output wrong but it won't segfault). Now, if C had a typeof operator that would fix the problems with printf and scanf etc (in va_args, you could do something like this: if (typeof(va_peek) != char*) return error)). Now, time to retreat into the flames of the anti-OO trolls (OO and functional coding have their places. I do not wish to force my opinion on anyone. If you want to flame me, then please present me with a sane argument).
-------------
HAL 7000, fewer features than the HAL 9000, but just as homicidal!
I've been a software engineer for 15 years. I graduated from the University of Lowell in 1987 with a BSCS. I received a 4-year award in Mathematics and a 4-year award in Computer Science from Dracut Senior High School in 1983 (the latter being a misnomer as there were no CS courses in my high school freshman year). My first language? BASIC, on a DEC PDP11/44 running RSTS/E.
So does this mean that I'm tainted goods, scattering GOTOs throughout my C, C++ code? Does this mean that I don't specify arguments to functions, instead trying to mimic GOSUB statements? Certainly not.
There are many different approaches to learning a new discipline. One method is to expose the student to "hard lessons" up front in order to burn basic principles into their memories. Another is to expose students to basic principles gradually, so as to build their confidence and spark their imaginations. This difference in method, I believe, is more important than which language is being used.
But you're assuming that you're teaching so that somebody can get a job--perhaps some of these questions are more oriented towards teaching certain concepts about how to solve problems, which just happen to use programming languages as the means to solve them.
If you are trying to prepare high school students for college, take a look around at the local University for what they do with CS101.
As a side note, the University I attended taught us a complete impractical language as a learning tool, Scheme -- the bastard stepchild of Lisp. I do not remember any of it, but the point of it was to teach concepts which it was good for.
My second CS language class was C++ (replaced by Java now methinks). In terms of good OO design it was certainly lacking and was meant to translate the concepts from the first CS class to the real world.
All of the rest of the theory classes reverted to Scheme or assembly language. You could subsitute C for the assembly language part and get nearly the same effect for educational purposes.
If you are going to teach Java, please keep in mind it is more than GUI window programs or web applets. I have seen too many reviews of books on websites that complained because Java educational books and courses focused too much on the non-GUI parts. Ugh.
Lastly, I think Java is excellent in terms of teaching the fundamentals of OO programming and patterns. You'll need to decide if you're up to the task of teaching programming and OO.
-mjg
It's 11pm, do you know what your deamons are up to?
OOP is a process, not a feature of a programming language. I can easily teach a OOP class using Fortran 77 or K&R C.
The whole purpose of teaching C++ is to tell the students what C++ is, and what it is not.
Also, I don't know if it's a good idea to try to explaing OOP to people who haven't done any programming whatsoever.
ps: About your sig: there _are_ no old Java programmers.
It's 11pm, do you know what your deamons are up to?
Ok, I get your point, but my view is still that you should have at least some previous knowledge of programming before startnig with OOP. In that way you already know the "tool" and OOP becomes just another way in which you can use it.
So, no OOP in the very first programming course. That'll come in the second course.
Teaching programming using OOP is [not quite, but almost] like teaching math using finite element methods (which I know is being done in some places).
Sig note: You know what I meant.
It's 11pm, do you know what your deamons are up to?
Java is, I would say, more platform dependent than C or C++. Furthermore C and C++ are actual real international (ISO) standards which means that you're protected against changes to the language that will make your old code incompatible with the new language every three years. Java is something that Sun does whatever they want with (and Microsoft has it extensions to it making it incompatible with the rest of the world as usual).
/have/ had troubles when people have been using extensions to the language, or as you call it "Borland C++ programs". The point is: Those programs are not C++. They are "Borland C++ programs". Those two things are not the same.
Why is Java more platform dependent than C or C++? First of all, if your platform hasn't got a JVM, you are done for. You can't run Java programs. If anyone tells you you don't need to have a JVM, then WHAT THE HECK IS THIS DISCUSSION ABOUT?
There's absolutely nothing in the C or C++ language standards that says anything about the platform, that's why those languages are so great for writing embedded applications and operating systems. They don't even assume the existance of a monitor or a keyboard.
I have never in my life had a problem with running C++ code written using the Borland C++ tools on my GNU/Linux or NetBSD machine. I
Now, I need some coffee...
It's 11pm, do you know what your deamons are up to?
CS is too often just learning to program, not the hows and whys and whatnots. I like Chris DiBonas comments on that matter but pump his attitude up to very annoying and there i am. I tire of the kids wanting to know "which language should I learn?". btw, try lisp
what about:
www.google.com
enter: +java +mplementation
hit search
You will find hundreds of alternative java impelementations, either compilers or hits or VMS.
e.g Kaffee, SableVM, Kiev, TowerJ, JRocket
Your whole post is bullshit.
Nearly every JAVA distribution is free, as in beer. And there are more free (as in speach) java distributions than commercial ones.
angel'o'sphere
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
I've asked the undergraduate advisor in my Engineering Faculty where I'm taking Computer Engineering why we take Java and not some other language. His answer was that the other ones are "too hard". That was also his answer to why we didn't use more free software in our courses. Because it's too hard for students to get the hang of UNIX we don't use it.
Now, I can see part of his point. My faculty is full to the brim with morons that cannot use a computer and won't be able to when they graduate, but as long as they are accomodated the cycle continues. *sigh*
In real life, the most important things a program needs to be are maintainable and correct, where the latter tends to follow (more easily) from the former. A good programming course should teach how to abstract, how to structure for maintainability and how to comment usefully.
Both Java and C++ can be used for this but Java has the advantage of not being full of obscure little features that will blow your foot off if you look at them wrong, so it gets my vote over C++ as a first language. It's not ideal, mind you, but if you're teaching it to people who just want to get a programming job at the end of the course (as opposed to learning computer science), it's likely the best you can do. (If not, try Python or LISP.)
In an ideal world, programming students should have to learn at least four radically different programming languages and implement non-trivial projects in all of them before they can inflict themselves on the industry.
BTW, I agree with Chris DiBona's comment that it's necessary to understand low-level issues. However, that should be later. A novice who believes the computer works because of little elves but knows how to abstract and comment will produce much better software than somebody who can design processors but writes spaghetti code.
Java shouldn't be the teaching language. I've done minimal java development, but I try to avoid it nowadays because it sucks resources like none other.
I'd recommend that the teaching language be C/C++ - once you know that, you can learn Java, Perl, PHP, etc. with little effort. True, Java's cross-platform, but if today's AP computer science classes were anything like mine, you'll be developing on a single machine, writing code that serves little practical purpose other than to learn. Teach them C/C++.
My AP compsci classes (2 yrs ago) used the old 25mHz Macs - God help us if they try to run Java on one of those beasts.
When I use the abbreviation C/C++, I mean C (and|or) C++. Not that they're the same, but that they're similar enough that we can teach either one.
there is no thing
what else could you want?
UC Berkeley uses Java for its 2nd semester core CS class (data structures) (and now, also for upper division OS design). Berkeley never used applets.
Personally, I think using applets would be a horrible mistake -- they are crash-ridden, full of extra garbage and syntax, etc. Personally, I love writing in Java, and I love doing internals -- stuff that never links to graphics code, and only provides "answers" or runs systems.
At the time that I took data structures, I had already been programming for over three years (incl. 2 AP years in high school). Although lots of the material was old, I found that Java worked really well in teaching data structures, and included lots of good habits _built_in_ to the language (like a good documentation system, easy modules with packages, type-checking, etc.).
there is no thing
what else could you want?
...as in speech? Do we really want the next generation of programmers growing up with their primary language owned and controlled by one company? Sun has by no means been a benevolent dictator in their control of the Java(TM) language. It's pretty clear Sun wants to use Java(TM) as a tool to increase it's power. Sun talks about fighting the Windows Evil Empire, when all they really want is to take over Microsoft's position, and become the next Evil Empire.
Just look at all the close minded decisions they've made over the years:
-- JDBC(TM): Only works with Java(TM). Why not use ODBC?-- Servlets(TM): Take FastCGI and remove cross language support.
-- RMI: Java(TM) only RPC.
-- SOAP: Thankfully IBM gave us this, but Sun would still like to find a way to make this Java(TM) only.
It's like someone copyrights a subset of the English language, and convinces schools to teach all their writing classes in that language. English, liked C++ is pretty messy with a difficult grammer and lots of exceptions. At least no one owns C++.Personally, I only took a single programming class in college (FORTRAN), which I failed due to conflicts with the teacher. I studied philosophy and math, and had little trouble converting my knowlege of algorithms and logic into Javascript, Perl, whatever language I needed to learn to get the job done. But I realize other people might not learn best that way.
I guess I shouldn't worry too much. Who learns anything useful in High School anyway...
Peace, or Not?
I attended JavaOne last week. There were 20,000+ java developers there. Much bigger than any single C++ conference. The power of Java is not the syntax of the language, which is what most discussions get in to.
The power of Java is that once you understand the fundamentals of the language, learning something new is just a matter of learning a new API. C++ has a similar concept, but the centralization (Sun) and open development nature of Java lend it to doing more robust applications.
Now, I bet many of you don't know about the Java Community Process. Basically if Sun wants to change the language, or more importantly *you* want to change the language, you just submit it and a JSR is created. You work with other people who have similar interests, and BAM you've made a difference.
Also, the flexibility of Java is pretty powerfull too. Sure, it has a lot of the same features, but the monetary benefits of decreased code maintenence really make a difference.
Of course, if you're a bad programmer than no language will help, Java even less slow. It's possible for Java to be 90% as fast as C++ when a JIT (just in time) compiler is used. The JIT compiler reads the compiled bytecodes and basically recompiles on the fly to code written for the local platform. So when using a JIT you get speed, performance, memory optimization, etc.
Java is not just better than C++. It blows it out of the water. Anyone who says differently doesn't understand the fundamentals of the language and is ignorant enough to be content.
.anacron
... we have a computer science course and a AP computer science course. In the regular computer science course they teach C. Then the next year one can continue on to AP CS with C++. This way the early programmers drop it if they don't like it and they learn some of niches of the computer and are primed for a AP course. This way the language of the AP course can change and the students still know how the computer works with other stuff (dynamic memory in the C->Java case). I believe that this can be a solution for a highschool CS department.
So when you do find something unexpected during implementation, which always happens, you run back to the whiteboard and read what it says, and send back the appropriate exception. No design changes, no mess, no fuss ... unless you screwed up the design in the first place, in which case you probably want to get some lessons so that you know what you are talking about (since its evident that you don't).
By unexpected, I don't mean simply cases that result in exceptions, I'm talking about valid situations that weren't thought of in the first design process. (we're all human, right?)
For example: some method returns 6 different types of widget, 2 of which must be handled differently 7 method calls later, where the Right Way of handling this situation might mean rearranging a class heirarchy and touching many different files.
I agree that with OO, if things are designed well (which becomes difficult very quickly as the complexity of the project increases) there should be minimal changes required in some circumstances, but the resulting code of OOA and OOD tends to be more rigid when it comes to supporting things not included in the original design, than code written in some other languages.
Inflexibility may well be a valid design goal, but I disagree with anyone who would use it as the default when introducing people to programming.
Consider: with OO you're told that you should spend 80% of your develompent time in OOA and OOD (making cute little object diagrams on whiteboards before doing any real work). I doubt that anyone except the most experienced programmers can forsee all the problems that they will encounter when writing the code, before actually writing it.
And once you do run into something that you didn't expect, you have to run back to the whiteboard for some more OOA & OOD, then sit down and make little changes over many source files that depended on the way you set things out the first time (at least in Java or other strongly-typed OO languages). Personally, I find that pretty wasteful.
Why not try a language that encourages you to write small amounts of code that can be tested in isolation, and then makes it easy to combine that tested code in different ways with little modification. I've found Python to be very good at this, but I'm sure there are some other good options.
Pretty much all programming languages are fads. Some just last longer than others.
What *doesn't* change are the fundamental concepts of programming and computer science. What you are striving to do is to correctly implement the solution to a problem with limited resources. Languages are the tools that try to increase your productivity with these limited resources. They are the practical illustrations and implementations of the concepts (data models, algorithms, proof techniques).
As time changes the limitations change. Memory and CPU speed used to be a huge limitation. Ditto for storage. The age of small-low level languages. Then we hit 400Mhz CPUs and 128MBs RAM along with CD/DVD and 30GB HDs and 'most' apps are more than happy with that. Thus, languages like Java become more practical. Of course low-level languages continue to excel, except that the limitation now is time. OOP languages and RAD tools take advantage of this and leverage inefficiencies for more efficient use of the programmers time.
What you as a student should take form this is that the fundamental ways of approaching a problem is most important. Personally I feel that all students should learn (or at least be exposed to) a OOP language (Java/C++), a functional language (scheme/lisp, etc), and a low level language (C/Assembly). Probably throw in some interesting languages like Prolog and you're pretty well rounded. Scripting languages like perl/python/php are good to know but won't teach you much about CS/programming that the others won't as well.
IMO, the only thing you get out of learning C/C++ early on as far as 'inner working' of computers is memory mamangement. You also get exposed to a lot of painful (and questoinable but necessary) experiences like memory leaks and linker errors. You don't learn much that is truly useful until you take a Computer Architecture and Operating Systems course which are usually mid or upper level courses. This is where you learn more about how caching works(level1/2/3, TLB?), understand bottlenecks in performance and resources (bus speeds, IO), how memory functions (what is CAS2), and how the CPU functions (instruction ordering, pipelining, etc.).
If the goal is to learn OOP then I would use Java to teach. If at all possible I woud also use C++. My OOP programming class in college did both.
Unless you intend to specialize in a lnaguage you really should arm yourself with as many languages as possible. You see problems from different points of view and can better understand the strengths and weaknesses of the tools you are using.
Fsck cluebie moderators. I'll say what I want, offtopic or not. And fsck having to qualify every bloody statement just
Another key advantage is you don't spend as much time fighting the language. With C/C++ you have wonderful things like linker errors. It might seem like a small thing to the initiated but I know many people who had given up learning C/C++ (at least initially) because they couldn't compile AND link their programs. I've spent many a wasted hour trying combinations of includes to figure out what exactly the linker didn't like. STL linker errors are even more fun! Most people who know C/C++ don't pay much attention to this drawback.
Fsck cluebie moderators. I'll say what I want, offtopic or not. And fsck having to qualify every bloody statement just
Touche! This reminds me that C/C++ also suffers from this problem. Not having ths standard libraries in your include path (on an unfamiliar shared unix machine) is quite fun for the beginner.
Fsck cluebie moderators. I'll say what I want, offtopic or not. And fsck having to qualify every bloody statement just
Okay, so it's sounds a little crazy. But why not teach elisp and emacs? I think that too often, CS students who are not complete geeks like ourselves go into CS not really having any decent tools that they can use to expedite drudgerous tasks. They're given assignments to create things that will be of little or no value to them once they're done with the class (unless they can get hours of amusement out of playing cheesy simple tic-tac-toe games). By teaching an editor that has a very good scripting language (one could even teach a scriptable editor other than emacs/elisp, if it's really against their religion), you can show students that they can use their programming skills to create useful tools that they can use to write more code faster and better, and with less drudgery. If I knew how to effectively use elisp/emacs when I first became a CS student, my grades in those first few classes would have been far higher.
CS should give you a thorough grounding in several languages. Once you've got a few languages under your belt, you begin to understand that when you get right down to it, languages are just syntax and the concepts invariably remain the same. In fundamental concepts, Java and C++ are damn close to one another. As long as you understand the fundamental concepts and can pick a language that can most easily express the solution to your problem, you're pretty well set.
I'm trying to teach myself to set people on fire with my mind... Is it hot in here?
Once you get into OO, by the way, Design Patterns should be one of the required textbooks. You can get patterns books for other languages but the one with the C++ examples has struck me as being the most complete of the lot.
I'm trying to teach myself to set people on fire with my mind... Is it hot in here?
Once the student understands how things work in memory, going to any other language should be much more straight forward.
I'm trying to teach myself to set people on fire with my mind... Is it hot in here?
Eiffel is the only language to teach if you want to teach object oriented methodologies. Period. If you disagree, you don't know what Eiffel is. If you think you know what Eiffel is and still disagree, you're wrong, you don't know about Eiffel, go learn to actually CODE in it and you might discover what object oriented really means. Anyone who tried to tell you that inheritance was like "is-a" relationships doesn't know OO from a hole in the ground and has never used Eiffel.
Dismiss me as snooty or whatever, but just stick it in the back of your mind and in 5 years when you're writing your new applications in Eiffel and wonder what the hell #defines were for and what they ever had to do with porting, remember this post.
Esperandi
Instead of asking which language to use in an introductory CS/programming class, one should ask what concepts need to be learned and in what order, and then pick one or more languages that can illustrate the desired concepts. When the problem is approached that way, any one of several languages will do.
Many have suggested that the most important first step is learning about the machine being programmed, e.g. registers, memory management, addresses, etc. I suggest that this approach is exactly backwards. The early concepts should include basic structured programming constructs like if-then-else, case, subroutines/functions, and building larger programs from smaller pieces. Then you can introduce good, controlled interfaces and information hiding and why it is vitally important do them as well as you can. While you're at this point you can stress the point of documentation and communication, perhaps through a group project where each individual has to use code written by others in their group without being able to look at each other's actual code. These are the very basics of programming.
Then you can introduce concepts like object orientation, polymorphism and overloading. Somewhere along this point things might split up into more or less hardware oriented tracks. The more hardware oriented would get into C, C++ and assembler with maybe some embedded applications. The more business oriented track would introduce persistence/databases with SQL, XHTML, Java and many other language(s). Overlapping subject matter might include human factors (UI), distribution (networking) and parallelism (threads and multiprocessing). Somewhere in there you want to teach lower levels of how things work, e.g. compilers and language theory.
All of the early boring stuff (disciplined structured programming, documentation, communication) is the most important part for a software professional because you always do all of those things regardless of programming language or architecture, no matter where you work. These topics should be covered first, no matter which language you use to cover them. These basics are ironically the stuff that most CS and engineering programs leave out or skip over.
Use Java to teach the things java is good at and force the students to use C and assembler when they take the "Architecture" class.
Both low and high level concepts should be tought before you get a degree.
I have been makeing a living with java for the last 5 years, the 7 years before that all in C and 680x0 assembler.
I think the low level work I have done lets me write better java. I have had some performance horse races with C++ fanatics that I work with and always come out ahead. Why? Not because Java is faster -- because my implimentaion of the contest challenge was better, which I direcly attribute to my "lower level" experience.
I love using java when it is appropriate. When to use a particular tools should also be taught. Who wants a one trick pony?
I honestly don't think it matters too much what language is used in teaching intro CS courses, as what must be conveyed in those courses are the basic paradigms that are expressible in all languages, from ML to LISP to Java to C.
Intro to CS courses that use Java could be taught badly, as they would be if they focus on UI issues instead of learning to write the fundamentals. Students should be expected to learn how to write linked lists, trees, and all the basic underlying structures of programming. There should not be too much dependence on the fancy features of the language for doing this, IMHO. Learning to use Java's list class is not the same as writing it yourself, and thus understanding how it's written. Java is fine for testing issues of relative speed and for empirical explorations of computational complexity.
One of the key advantages that java has over C (or especially C++) is that it is relatively clean, and relatively safe. On the other hand, it's not as portable as C or C++, which is a real problem for many schools, since Macs are often used in education.
David Andre
UC Berkeley
You don't see people asking "If assembly is so great, why are no CGI Scripts written in it". The answer: few people are sadists. --me
Though it can be argued that learning to write tight assembly will make you better at the smaller, procedural sections of object oriented code, I think most people would agree that it won't make you any better at designing a high-level data structure or an object-oriented framework.
On a more humorous note, why not teach students to write Java at the byte-code level -- thus answering both sides of the Java vs. Assembly argument! ;-)
Nobody has mentioned learning with RESOLVE/C++ yet. I have taken the first 2 classes of this 3-class series at Ohio State, and although I know most of it from AP high school, I think it's a great way to learn programming.. even though many people think it's ridiculous.
Mike Roberto
- GAIM: MicroBerto
Berto
something like Prolog or haskel.. Computer scientist at the undergrad level are in training to be Computer scientist to go on to a graduate level. Have some 2 credit courses that teach C++/java or any other language.
The 1st year undergrads at my University learning C and Java, which IMHO is a very good combination. You get to learn the machine with C, and OOP with Java. Personally I use Java quite a lot. The programs I write I generally proof of concept, trying out algorithms etc. Java allows me to develop programs rapidly by removing a lot of the tedius memory manage, IO etc. Of course, I am not generally that concerned with performance, and the programs I develope relatively small.
Moderators, pay attention. That was the most important statement in the entire discussion (at the high school level). AP Courses should use the language that's in the AP Exam. Period. Otherwise the students will not get AP credit which can save them $$$ in college tuition.
The current AP CS Exams use C/C++, but they will switch to Java in 2003. College courses should use whatever language is best for them; personally I recommend Scheme or Python. But for the high school level, you ignore the Board at your own peril.
Having taught Java as an introductory language, I feel qualified to state that it should be the first language anybody learns. Why? Because it's simple; it's easier to learn. And it doesn't teach you the bad habits that say BASIC would. It is more standardized across different platforms than C/C++, and just as good for OOP as C++. And of course, it's FREE for educational use. Java isn't a perfect language (frankly, the lack of unsigned primitive types bothers me) but it's the best language for beginners.
"Freedom means freedom for everybody" -- Dick Cheney
Actually, Java is not that slow, and there is nothing to stop you from compiling Java to machine code, in which case it should run as fast as C++. However, in an educational environment, it is good that you're code run slow enough so that the effects of good vs. bad programming practices is perceptable. In fact, I have used timing a few thousand iterations of computationally intense algorithms in Java and then tweaking them as a way of optimizing algorithms, which were later ported to C. Experimenting with Java is usually faster, since it only recompiles the single class that changed.
"Freedom means freedom for everybody" -- Dick Cheney
---
"This message is composed of 100% recycled electrons."
Unfortunately, people are teaching that programming is a matter of drag'n'drop IDEs, connecting components, and using class libraries.
However, who writes the IDEs, the editors, the class libraries, the components? How do you build a new language or a new operating system? How do you make a device driver or whip out microcode?
Computer Science, as I remember it, was learning how to problem solve and evaluate solutions by understanding their trade-offs. There was advanced data structures, algorithms, analysis, and math involved. When you had that under your belt, then you started learning the art.
Students need to understand what the machine is doing under the hood, how machine language is represented by assembly language, and how high level statements perform groups of operations. It gives them an appreciation and a better understanding of why things work the way they do -- and it helps them seek better solutions. You also learn when breaking the rules is the right thing to do.
A language like Pascal which is solidly has structure that must be followed is a fine example of learning how to take mental concepts and map them into executable code when there are langauge constraints. Eventually one learns that different programming langauges are better at expressing and addressing certain kinds of problems more efficiently than others.
Programmers should be expected to know how to deal with pointers and languages without garbage collection. Eventually some task bumps into them. Knowing about proper resource management can help optimize solutions.
In short, it's all about building blocks before taking short cuts.
Java has a steep learning curve to master its extensive library, and it babys developers in things they ought to understand already. Never being exposed to lower level constuctions, especially early on, is not something I would consider as being beneficial in the long run.
Java is clunky, ugly, and runs much too slow on most platforms.
When choosing a programming language to learn, you must choose a language that does what you want to do. If you are looking at low level programming, Java isn't for you since you can't access the hardware directly (unless you are using the Java SDK 1.4, which supports writing directly to the video card).
Java is a well thought out, beautiful language. It's strengths are, in my opinion, at the server end, where it out performs CGI, although I do use it for some application development.
Java has seen great performance gains since version 1.0. Many Java applications that I have created work just as well and just as fast as C++ applications that do the same thing.
Finally, it isn't the language that's slow, it's the interpretation of bytecode that slows things down a little. There isn't any law against compiling your Java code into a native executable.
I'm right. Java is a fad, not worth much more than the Windows OS in terms of quality, and my CS faculty is doing me a disservice by cramming it down my throat.
I think Java is an excellent language to use to learn OOP because it forces it. If I were taking a class, I would rather learn Java since the demand for Java programmers far exceeds the demand for smalltalk and other OOP language programmers. I don't see how making you learn a very marketable language is doing you a disservice.
It seems to me that you don't know much about Java. I would hold off judgement until you do. Everyone that I know that takes the time to learn it's strength comes to respect what it has to offer them. Again, it's a great programming language. Even Microsoft thinks so (not that that means anything to me). That's why they are working on releasing Microsoft Java (oh, I guess they changed the name to C# so they could break there Java licensing agreement with Sun).
I started playing with computers (Commodore PET's, PDP/8's) because it was fun, it appealed to my geek tendencies and I could hang out with other geeks. In the ensuing 20 years I've used 38 languages (grouping together BASIC's) on 11 systems (grouping together Windozes, Unices and 80's micros) and guess what? It's still fun! I still get to hang out with geeks!
Let's not forget that what get's kids fired up is a rewarding experience. They need the sense of having accomplished something, something visible, of getting positive feedback for legitimate effort.
It's probably a good idea to teach a computer language that gets kids solving problems and producing results without having to deal with unnecessary syntactic baggage. Python is would be my choice, just because it has a clean syntax and lots of functionality built in without having to resort to too many libraries (and it is popular where I work (a major Swiss bank)). Ruby is probably also good, but I've not had a reason to try it out yet. Java relies too much on its libraries IMHO for the beginner. Lisp and recursion are probably not the best starting point.
Programming language was 10% of what got me into computers; I survived PET-BASIC, FORTRAN and FOCAL. It sounds like the teacher here is a good one, which is 50% of the battle, and that he's thinking hard about an engaging curriculum, which I think is 30%. 10% is chance, I'd guess... :-) If the kids get an enthusiasm for it, and learn they can accomplish things with computers, they're set.
Seriously. It has the pure OO-approach and lambdas of Smalltalk, simplicity of Python, flexibility of Perl, even borrows mix-ins (advanced OO concept sort of like multiple inheritance) from eiffel and is fun, with easy to understand syntax! If you're going to teach OO language approaches in an imperative language, this is a serious language that contains just what you need and no extra fluff. It is easily extendable, both in C and within the language itself. I bought the "bible", got productive after a few hours and learned almost everything but C-extensions in just 3-4 days. Very easy and fun read, plus the entire book is also available online.
;-) Java is NOT a well-designed language. It's not always best to follow the pack either, those who make a difference don't. Ruby is perfect for bringing up new ideas. Let students experiment with extending OO-concepts in the language!
Here are some additional links:
The official Ruby page
Dr. Dobbs article about Ruby
Documentation
HotLinks
If this weren't MUCH better than Java, I wouldn't pull this shameless plug. Please check it out, don't stay in the dark ages..
Btw, PLEASE don't make the students create Object Oriented ZOOs and the like. We were forced to such meaningless assignments when we had OO-classes in school, and such stupid problems are for OO-morons. Additionally, you don't need a "fast" language for teaching OO-concepts. On the contrary, since ruby is a glue language (like perl), it can be used to glue the right tools for the job when you need it to. It's definately fast enough if you just express your ideas in it correctly (avoiding many nested loops). Some people even use Ruby as a specification language, because of it's easy-to-understand syntax and lambdas. Ruby code is usually shorter and more readable than the same code expressed in other languages.
- Steeltoe
http://www.debunkingskeptics.com/
I would love to address everything mentioned, but I don't have the time or the room.
I work in a 100% java shop employing over 100 programmers. I've also worked in C++, C, Basic and Assembly. (http://www.doradosoftware.com). We have a full client/server product that will manage large numbers of Network Elements and has 24/7 operation. Java is not some toy language.
Honestly, I would suggest that Java would be a fantastic first language. Java has been designed to allow the programmer to concentrate on your problem rather than the language. Think about it--An "Ideal" language would be one where every single line goes towards solving your real-world problem and no time/code goes into language maintenance. Java's design goal seems to be to eliminate the overhead.
I read a really intestering comment the other day. Basically programmers can only evaluate languages that are inferior to or equal to the most powerful language they know.
This really fits what I've seen. I have known 4 people who were very strong C++ programmers (and who, of course, dreaded using Java because it's so "Trendy", or "Slow", or (well, insert any other problem mentioned in this thread). By the end of the project each dreaded or refused to go back to C++.
Java is currently as fast as C++ at nearly every operation (a little faster at times, a little slower at others), is not bulky at all (the Bytecode is actually more compact than assembly), and has some amazing capibilities that you can't even understand until you have used many of them for a while (Fully understand Reflection before even commenting about Java! That's the part that has blown the socks off the C++ programmers I've known)
Honestly, the whole difference in design between Java and the C/C++ world is that java was designed to be used and used right (C/C++ was more evolved than designed anyway).
What's my point?
A) Feel free to use java or some other higher level language in school (I hear lisp is great too).
B) DO NOT take recommendations from anyone who does not have at least a year of steady Java use--they are honestly not qualified (Just as I am not qualified to comment on Lisp).
C) LOTS of java jobs out there, don't be afraid your time is in any way wasted. (Also, don't EVEN think that this will be the LAST language you learn)
Actually, I heard today that VB has more code out there now than Cobol does.
VB sucks as a language, but put it together with the whole environment & database integration and it's a really powerful tool--to knock it so out-of-hand simply means you haven't used it to meet a deadline that was otherwise impossible.
Worldwide programmer shortage? Woooohooooooooooooo!
____________________
It's rare that you're presented with a knob whose only two positions are Make History and Flee Your Glorious Destiny.
It seems to me that relatively few people understand and appreciate the Java language and Platform. I've studied many languages through my curriculum here at RIT. We started with Eiffel, which is a "pure OO" language. It gets compiled down to C, and then to native code.
;-) There are also proposals for templates but that will come later.
In my opinion, that was a very good language to start with since Object Oriented concepts like polymorphism, multiple inheritence, and data abstractions can be made very clear. It also doesn't suffer from the way too orthonogal "everything-including-int-is-an-object" paradigm of Small Talk.
After doing Eiffel for a year, we were thrown into C++. That took a while to get used to, but the basis in quality Object Oriented program guided me.
C++ may be faster, but it also suffers from the dreaded header files and makefiles. Blah!
The claims that Java is slow are entirely untrue (in some cases). I agree that the GUI responsiveness of Java sucks, yes. However, in console or server applications it runs just as fast as C or native code. (look up some java benchmarks or do it yourself!) Java is getting better in the GUI responsiveness with the upcoming JDK1.4.
Java also has many other benefits. It has the nicest API I've ever seen. Yes, some things are a bit limiting. No templates for instance, and single inheritence, no assertion checking either. Well, in JDK1.4 we're going to have assertion checking
Everyone should remember that this language is relatively new compared to the likes of C and C++. This language is 6 years old, compared to 20+ years of C/C++. With every new release it keeps getting better.
Also, Java the platform runs everwhere. Check out Tiny -- the smallest java powered webserver in the world (http://ibutton.com) etc, etc.
It also has very nice pre-made APIs like JavaMail, JDBC, JavaSpeech, whatever. It all comes down to I think that Java is the most perfect language for writing software quickly, accurately, and efficiently.
Java provides features that are relatively hard to implement in other languages. Features like JavaBeans, Instrospection, and Reflection. These are all usefull in their own right, and all very powerful.
Learning assembly level programming first might be discouraging for some people. You don't want to scare them away, and besides... no one uses assembly code for anything anymore anyways. With RISC architecture coming, writing the simpliest programs will take forever. I know, I've done it. I hate it. Those tasks have been put off to the compiler designers. If you want to write assembly code, be a compiler writer -- but most computer scientists would not want to do that.
An AP Computer Science class is taught to high school students. Teaching them the internal workings of a processor is borderline Computer Engineering. They'll be better off if their tought the CONCEPTS behind a computer language instead of any language in particular. But since a language is required for the tests or whatever, any one will do.
Sorry about this rant. It all comes down to, there is a specific application for every language. Java encompasses a lot of good ideas, design patterns, etc. If you don't like Java, tough... it's here to stay.
This is a really big deal. How many new CS types are you seeing in your HR departments, looking for jobs, that don't know squat? Have you seen college curriculums lately? I went to Penn State about 3 years ago, and I can tell you that they were STILL teaching engineering students FORTRAN, for heaven's sake. MIS students were encouraged to take 2-3 semesters of COBOL. Not that COBOL isn't still used in legacy systems, but they didn't even offer a Java class until 2 years ago, and that was only one semester as an experiment.
One of the other posts here also made the note that Java, for all it's shortcomings, is really portable. Get the JDK, run the program. It's that simple. Other languages are portable, true, but Sun has really gone out of their way to ensure that programmers have a rich set of libraries to develop from. You hardly have to write code anymore, it's mostly a matter of reading the documentation and stringing together the correct objects. Those same libraries are completely portable across any platform that the JDK is written for. You can't say the same thing about most other languages.
Java is a great way to learn the complexities of OOP without killing yourself with overhead, and you get to learn a language that is in commercial demand as well.
"We apologize for the inconvenience."
I'll admit I wasn't aware of this -- but aren't they licenscing java from SUN? meaning -- they're still at SUNs mercy ?
Free Techno/Jazz/DNB/MI Music by guys obsessed with monkeys!
That hardly is a well articulated argument.
Free Techno/Jazz/DNB/MI Music by guys obsessed with monkeys!
How long do you think java is going to be "free" for? My guess -- another 5 years -- by then it will be everywhere -- and SUN will pull a Unisys and start charging fees for it. (this is just my oponion, not fact)
I think schools shouldn't teach their students langauges that aren't free (as in speach). Theres 100 C/C++ compilers you can buy/download, but just a couple java compilers.
\editorial : For begining students I expect Python would be a good choice -- its simple, very consistent, and is very explicit about variable cohercion, and is still "powerfull".
Free Techno/Jazz/DNB/MI Music by guys obsessed with monkeys!
Have you thought about using Ada95 - It is cross platform with compilers on most OSes and can be written procedural *or* OO. It has lot's of constraints so you can't hang yourself like in C with array out of bounds stuff. It has very good exception handling and is easy to learn. The university I go to taught this language in 1st and 2nd year and then only in 3rd did they introduce us to Java!
While I agree with DiBona's reasons for objecting to Java as a learning language, my suggestion would be a language that really insulates the programmer from the hardware: LISP. If you want to force someone to learn something about structuring code, I think it's a good adjunct, though not a substitute for c.
The whole idea of having to learn software engineering in school is a scam. If you take a look at anything you're genuinely any good at you'll realize that you largely taught yourself. If you really, really want to learn to program you'll read about it, try your hand at writing a little something, read some more, try something more difficult and so on until you're hooked.
A programmer to me is someone who loves to code. All the rest are better off becoming cops or cab drivers or construction workers and such.
Play is Learning
School is Time Taken Away from Learning
Night
Java may be just fine for the purposes of teaching Computer Science, but it's one of the worst programming languages around - as far as teaching people to be a professional programmer.
There are NOT that many people who will use Java, in their professional lives. Applets are a pain in the ass, because every browser / version on the planet behaves differently. Something new has got to come along and kill Java in this market, possibly even Java 2.0, just centrally controlled and with forced updates. And writing servlets is going to be the responsibility of a comparatively small number of programmers. So, it's really not that important that every college grad with a BS in Computer Science knows how to do it. Well, those are the two situations where Java has dominance. Other than that, it's a not-very-good language to use. Specifically, it's a bad language to use to teach someone to be a professional programmer. Here's why :
Memory management. Real, professional programmers need to know how to manage memory, both in RAM, and on a physical medium. Java not only doesn't help, it hinders understanding in this area. Garbage Collection is a clever trick, but if you get used to that net being under you, and you've never used another language, programming in C will be a rude shock. Like I said, Java might be fine for teaching Computer Science, but my whole point is that Java, in this specific case, is horrible for teaching people to be a professional programmer.
Passing by reference. In order to pass values by reference in Java, you have to make another class to do it? That's nuts! It's a horrible thing to teach someone to do. And since your entire Java code is likely to be in one class, it'll teach people to use global variables to store all of their important data. Not a good way to go!
Why are there integer and Integer? double and Double? Java is not pure Object Oriented, because if it were, there wouldn't be two classes for an integer value, okay? And the fact that you HAVE TO use them both just shows that it's a horrible class library. I'm not saying that C or C++ really crush Java in this department, but my point is that Java has its failings, when it comes to teaching OOP.
Now, here's an important point : Java is fine. If you learned it as your first language, you can go on to learn any language you want. My point is that it takes more effort to go from Java to C++, than it takes to go from C++ to Java. Why on Earth would you WANT to cripple students? Let's give them false perceptions about what programming is really about, and what's important to keep track of. Let's pretend pointers don't exist, and argue that being cross-platform is the Holy Grail, while using a language that is NOT cross-platform. (Try wrighting an applet that actually does anything useful, and then try to run it under Netscape on a Macintosh. Then you can preach to me about how cross-platform Java is. Some versions of Java crash when you ASK THEM WHAT VERSION THEY ARE!!!) Or that OOP is the Holy Grail, while using a language that itself doesn't do a very good job of being Object-Oriented.
Teach C++. Most students will end up spending most of their time using it, anyway. Don't make their lives more difficult by teaching them first in a language that hinders their learning!
Education is the silver bullet.
I've been a computer programmer for 20 years, and I write both Java Applets and Java Servlets every day. I've been working with Java for two years. I would argue that I'm qualified to make my own statements, and I'm not parroting things I've heard before.
There are currently 5 Million java developers worldwide. Java is the main language used for eCommerce. Do you want your web site to leak memory?
Are there more people who write in C/C++? Yes. Is it possible to write C/C++ code that doesn't leak memory? Yes. Is it possible to write Java Applets that unintentionally leak memory? YES. Java is not the main language used for eCommerce. You are incorrect. What language was Apache written in? What language was Windows written in? What language was Linux, BSD or any other UNIX written in? What language was your browser written in? What language was your TCP/IP stack written in? WHAT LANGUAGE WAS JAVA WRITTEN IN? I believe a more intelligent argument would be that eCommerce applications for making intranets, or serving non-static web pages are most commonly written in Java, and that the only language for doing client-side execution without a plug-in or otherwise installing software is Java or JavaScript. Regardless, that doesn't make it a good language to teach programming in. It also doesn't make it the most widely used language.
And this is Java's fault? You're hilarious. I was countering the argument that Java is cross-platform. Instead of establishing through example that it IS cross-platform, you seek to attribute blame to someone else. You have not defeated my argument : Java is not cross-platform, in the way that everyone harps it to be. Who's parroting?
Applets are hardly used anymore. Java was clearly a failure in this area Thank you for making my point for me. I can guarantee to you that if a University intends to teach Java as a programming language, they will at some point develop applets. This doesn't help anyone. They won't use that skill in the real world, and even if they wanted to, by your arguments, it wouldn't work. And in learning Java, they never learned pointers and memory management. Guess what? It'll be harder for them to learn C/C++, because of it. And you're ignoring my main point : it's EASIER TO LEARN JAVA, IF YOU'VE ONLY LEARNED C/C++ THAN IT IS TO LEARN C/C++, IF YOU'VE ONLY LEARNED JAVA!
Maybe, but when dealing with eCommerce or enterprise apps... You know what? Fine. Have your stinking eCommerce or enterprise apps. You know what? Most programmers are NOT writing eCommerce or enterprise apps. Let's prepare MOST programmers for the real world! And by the way, back to my early argument, making your web page look pretty is a small portion of your business. And no, enterprise applications are not clearly in the realm of Java, either. If you want to work for a consulting firm, be prepared to not write in Java. Because C/C++ is still king, in that market, too.
You obviously have no idea how java works. Thank you for being inflamatory. You're also incorrect.
Changing values passed into a method is not OO practice, and should be discouraged. What planet do you live on? So, it's okay for my method to return a value... But it's bad for it to return multiple values? I have to design a class, or use a Vector, in order to have my method return multiple values to you? I'm shocked that you think it's bad OO practice. I should have to write two functions? Or make a special purpose class? Or use a Vector? I can't even see through your argument to a spark of logic that might have created it!
Oh no... Please don't code anywhere near my app. I hope all your C code isn't in one file You know what? This whole discussion is about teaching programming. And when you TEACH programming, you're likely to start with small programs. The kind that are likely to be solved with one class. Like, if I want to teach about a FOR LOOP, you're proposing that I put that into multiple class files? Let's stay topical, okay? And my TOPICAL argument is that, while teaching someone programming, they're likely to do most of their coding in simple, one-class programs. And there will be the temptation to use global variables, just like there is in C/C++. But, in Java, you have the comforting blanket of it being a class variable! It's not a global variable! Having a class variable is perfectly OO! But guess what? They're using it like a global variable, and if they start coding in C/C++, they'll do the same thing. AGAIN, you're IGNORING my fundamental point - that it's EASIER TO LEARN JAVA, IF YOU UNDERSTAND C/C++ FIRST, THAN IT IS TO LEARN C/C++ IF YOU UNDERSTAND JAVA FIRST.
Java is not pure Object Oriented.
and C++ is?
I never said that. Again, you get mad at me for saying that Java has faults. Well, if they both have faults, that eradicates your argument that Java is BETTER. I'm not saying that C++ is pure OO. But I'm demonstrating that NEITHER IS JAVA.
I've had no problems developing in Linux and moving my executables to solaris or NT. Try moving them to C-64. Or Lego bricks. Guess what? You can with C. And yes, these are silly arguments, but they prove that C is more Cross-Platform than Java is. So, if your argument is that Java is more platform independent, so let's use it to TEACH - well, you're wrong. Does it take work to port code? Yes. Is it possible? Yes. I'm not saying Java isn't useful... I'm merely saying that it isn't a better language to use, when teaching computer programming. And my specific argument here is that, when you say Java is cross-platform, let me retort that C/C++ is MORE cross-platform.
Java is a very nice, high-level language; while it may not be suitable for beginners, it provides a lot of things that make it useful to people who want to get things done in business. This is going to surprise you : I agree with this statement 100%. And the whole point of this Ask Slashdot was if Java was a BETTER language to teach beginners. And the whole point of my post was to say that it's not. But you seemed to ignore that, and got mad that I pointed out that there are flaws in Java, there are flaws in the argument that Java is cross-platform, and there are flaws in the argument that Java is the perfect OO language. My point remains : Java should not be used to teach computer programming, or Computer Science.
I speak as someone who learned to program in BASIC, then in Pascal, then in C, then in Object-Oriented Pascal (like, the exact day that it became available from Borland), and then C++. From that foundation I have learned about every language that you can name. And in my opinion, the best language to use when teaching people Computer Science, is C and then C++ - when it's time to discuss OO.
Education is the silver bullet.
This is fantastic, someone brings up the question "Is Java a better language to use, when teaching people Computer Science." I say "No," and try to explain my reasoning. So, obviously, I'm a troll. *sigh*
Education is the silver bullet.
I've been programming for 20 years, and I've been coding in Java for two years. Writing both Applets and Servlets, as a professional programmer. I understand Java.
I know that Java is versatile, and can be used in many environments. My point is that C/C++ is a better language to use, when teaching computer programming and Computer Science.
Java has strict typing That everyone overrides. If you override it, every time, it doesn't exist. String a = (String)myVector.elementAt(0); Code like that appears all over the place in Java. That's not strict typing.
You can learn the fundamentals of programming in any language, even COBOL, Fortran, BASIC, and Pascal. Oh, and C/C++. Your argument doesn't mean that Java is BETTER, only that it is functional.
it can introduce many different aspects of programming to a student... without having to learn another language/environment or some 3rd party libraries. This actually isn't a bad point. I'd argue that doing GUI or event programming puts you into Java Application or Java Applets, and those are not real-world problems, you know what I mean? If you're going to encounter GUI or event programming - as a professional programmer, it'll be in C/C++. So, teach it in C/C++... Right?
Java is a good language. I'm programming in it right now, and it's useful. Another language would not be as useful, for the task I'm working on. I acknowledge that Java has its strong points. However, C and then C++ should be the language(s) that are used to teach people how to program, in a Computer Science curriculum. Mainly for the reasons I listed, which you ignored.
The arguments I brought up against Java were just to illustrate my point... When someone says "Java is BETTER than C/C++ for TEACHING computer programming," I can say, "No, it's not." I agree with you that it has uses, is useful, and is not a bad language. I disagree with anyone that says that we should use it to teach Computer Science!
Again, it's EASIER for someone to learn in C and then C++ to switch to programming in Java - than it is for someone to learn in Java, and then switch to C and C++. And since MOST people will end up having to code in C or C++, eventually - teach it to them, in the first place!
Education is the silver bullet.
In the domain of enterprise and back-end products, I agree that Java is very heavily used. I will argue that enterprise and back-end product development is done by a very small portion of the professional programmers in the world. Most people who program will not be doing that, therefore it is illogical to assert that Java is a better programming language to use to TEACH BEGINNING COMPUTER PROGRAMMERS, on the grounds that it's dominant in that market. Lisp is dominant in the AI field, but that doesn't mean you should use it to teach people how to be professional programmers.
Why are you passing values by reference?
void GetNameAndAge(char **Name, int *Age);
When I call it, I say :
GetNameAndAge(&Name, &Age);
The ampersands help me remember that the procedure will change the values. I'm passing a pointer (passing by reference) to the values that I want the function to find, and return.
I personally have the same complaint that you do, which is why I'm opposed to people passing by reference, by using the & in the declaration - leave that to the caller!
an introductory class would be much better served by discussing loops, methods, and basic algorithms I agree. You can do all of that in C just as easily as you can in Java. In my opinion, it's actually easier in C. And then, when you want to teach OOP, malloc/free/new/delete, you show them C++. And in the process, you're preparing them to be professional programmers, because they're learning the programming environment they're likely to end up using in their professional lives.
[I] have found Java to almost always be a better choice. Most computer programming is done in C and C++. It doesn't matter if you like the language better, I feel that it's more appropriate to teach someone to use the real tools they're likely to use in their professional lives. I personally like Object Oriented Pascal more than any other language. But I'm more realistic than you, apparently. Even though OOPascal is vastly superior to all other languages (tongue placed firmly in cheek), I recognize that C and C++ are by far the most widely used languages, and are far more appropriate to use, when teaching people how to be professional programmers.
Again, that's client side. When people talk about how cross-platform Java is, they're going to bring up Applets. My argument is that Applets don't work. Well, actually, they do - but it's enormously painful to get them to work right. The consumer loves it, but for the developer, it's a nightmare. You seem to agree with me on this point.
I actually had to change some of my code, when switching Java Servlets from platform to platform - Vector.add doesn't work in Tomcat, apparently... It's Vector.addElement.
And back to my point, even though writing servlets cross-platform is great fun, most people will not do that for a living! So, give them the tools that are appropriate for their upcoming jobs! C and C++! PS, if they learn C and C++, it's easy for them to learn Java! But, if they learn Java (and only Java), then by your argument that "C++ is much more complex and difficult" it will be NIGHTMARISH for them to switch to C++! How can you not agree with me on this point?!
Java is nowhere near as bad as you think it is. I use it professionally, it has many uses, and it's not a bad language. But it's not so much better than C++ that we should start using Java to teach Computer Science and computer programming! That's my only point!
[Java] is a real language capable of doing real work, in many cases much more quickly and reliably than would be possible in C++. I must have been horribly unclear in my post... I AGREE WITH YOU that Java is useful. BUT IT SHOULDN'T BE USED TO TEACH BEGINNING PROGRAMMERS! Use C and C++ to teach, and then, hey - give them a class on Java, if they're curious! Don't administer the Advanced Placement test in Java! That's INSANE! Don't teach Freshmen how to make applets! Or SERVLETS!? Are you nuts! Teach them C and C++, and then it's easy for them to learn that other stuff, later!
Education is the silver bullet.
void ChangesA(int *a) { *a = 1; }
You can't. You have to pass an Integer, instead - or use a Class, such as Vector. That's what I mean by being able to "pass variables by reference," it means that I want the procedure to have the ability to change the data that you send it. Oh, and by the way, my definition of "pass variables by reference" works in almost any language, C, C++, and Pascal included. Your definition is a technicallity, based on the difference between dynamic classes and static classes. The fact that static classes are passed in Java by reference hardly makes it easier for me to change the value of an integer passed to a method.
Secondly, this is exactly the point of high(er) level languages. You're funny. It reminds me of the HIGHEST level language : TA. It's simple to use : as a professor, you enter your program source code into the computer via answering machine, shoddy sketches, a few simple words in the hallway, or by sending an email. The result : a few days later, a Teaching Assistant (sometimes the Research Assistant) has produced the desired output!
But seriously, Java does cool stuff. Unfortunately, most people won't end up using Java in their professional programming lives. Also, learning Java first has drawbacks : namely, it makes it harder to learn programming concepts that will be needed, when using other programming languages - like C and C++. Coincidentally, the language they are most likely to end up using IS C or C++. Therefore, in my opinion, teach them using C and C++, in the first place! Especially since it's then easy for them to switch to Java! I'm amused to see that Java advocates have a hard time admitting to its weaknesses, and contemplating the proposition that Java might not be perfect for every task - like, teaching someone how to program in C and C++!
Automatic Garbage Collection is a concept that can be applied to many differing programming languages and it is a detriment in none of them. When you have Garbage Collection - it's useful. I agree. But, if you've NEVER, EVER had to program memory management yourself, it will be VERY, VERY hard for you to learn how to. Since MOST people WILL have to code in C and C++, and WILL have to program memory management for themselves - I would argue that it's BETTER to show them how to do it right, in the first place. Especially since it's not that hard! It's a good programming practice that they should learn! It's just as easy to NEW and DELETE as it is to NEW!
Maybe you should study the term encapsulation. Wow - that's mature. I've been programming for 20 years, and I've been using standardized Object Oriented programming since before it even existed as a standard in C++. I also recognize that it's possible to write encapsulated code without the help of a compiler! When CLASSES communicate, it's valuable to encapsulate the data - in fact, it's about the most important programming practice to learn, in my opinion. But, when I want to write a function that will return TWO values instead of ONE value, I think it's nice that the C and C++ compiler knows how to support that. Whereas the Java compiler DOESN'T know how to do that. FOR NO GOOD REASON. You're telling me that a procedure with multiple return values is somehow NOT good Object Oriented practice? Are you insane? Somehow ZERO or ONE are the only crumulent possibilities? (To steal the word crumulent from The Simpsons.) TWO or MORE are evil?! What world do you live on?
people learn the wrong way to write OO code I don't think Freshmen in college, or worse, High School Students, should have to write OO code in their first computer programming class. I think that data structures and procedural programming should be taught first. Then you show them how useful objects are. Otherwise, you end up with people who start writing Financial software by writing
public class Penny
Object Oriented Programming is a TOOL, it's not a way of life. It should be used when appropriate! I happen to think it's not appropriate for integer and double, Java seems to think I'm wrong.
Java allows you to solve problems, C++ allows you to solve details. Allow me to respond with another generality : All generalities are incorrect.
You can write clean, beautiful code in almost any language. (I happen to think it's impossible in COBOL, but I never really tried.) I could write the same code in Pascal, Object Oriented Pascal, C, C++, or Java - I'm competent in all of them. It happens to be easier to solve some problems in some environments. I'm arguing that Java isn't good for teaching beginning computer programmers and Computer Scientists. SPECIFICALLY, because they're likely to have to use C and C++ at some point in their professional lives. I think we should TEACH them to be good programmers in C and C++. Then, they'll be good programmers in any environment, Java included! But if we have them use Java instead, my argument is that they'll miss out on such things as memory management, pointers, passing values by reference... And at the end of the day, they're likely to have to go and learn C and C++ and how to do all of that stuff, ANYWAY! Why not show them how to do it RIGHT in C++!? It's easier to learn it right the first time!
By the way, I learned in BASIC and Pascal - and I happen to think Object Oriented Pascal (read : Delphi) is the best language, ever. But I understand that SINCE people WILL have to use C and C++ and there's nothing WRONG with C and C++, we should use it to teach them! You CAN CODE WELL in C and C++, and it's NOT HARD! TEACH people how to do that, and they'll be able to tackle ANY problem in ANY language! But, if you never let them do memory management, or use pointers, you're massively crippling them!
Java allows you to solve problems, C++ allows you to solve details. As an employer, I know which one I'd want you to deal with. As an employee, I would think that you would want me to write good code, no matter what the programming environment. I would think that which programming environment I used would be important to you, only in the context of being able to maintain, support, and reuse the code that I write. Most employeers see C and C++ as the only way to go. I'd rather prepare most beginning programmers to be able to work most places!
Education is the silver bullet.
The claim here, AFAICT, is that Java is a cleaner, better designed OO language than C++.
The claim here is that Java is a better language to teach beginning computer programmers. That claim is incorrect.
It's frequently possible to tell that people were C++ coders before becoming Java coders from the quality and style of their code.
It's frequently possible to tell that people were Java coders before becomming C++ coders from the memory leaks and from their inability to dynamically allocate objects correctly.
I don't know what you would point out as being particularly "C++" about someone's Java code. I honestly don't. I'd love to see some examples of the wrong (read C++) way to code something in Java, and then the right way. It's an entertaining notion to me, but I have as yet never seen an example.
If that's what people are being taught, then it's the quality of the teaching that is to blame, not the quality of the language. I agree. Most people argue to me that the Java language enforces good coding practices, and that's why it should be used to teach people. Laughable. You can write bad code in ANY language. I was trying to illustrate that one of the pitfalls of trying to code in C++ like one would code in Java is that there's code that's OUTSIDE of a class, and that's a weird concept to grasp.
By the way, you CAN'T write global variables in Java - everything is inside of a class! No wonder you'll never see a Java coder do it! Oh, unless they then try to write C++. What's an example of something that I, as a seasoned C++ coder, am likely to incorrectly do in Java?
The whole point of my argument is that Java is not a good language to teach beginning programmers. Every argument that I have heard about Java in favor of C++ as a TEACHING language, is illogical, incorrect, or just language-centric posturing. Java is a fine language for use in many situations. I use it myself, and it's not too bad. But I think that C and then C++ are the languages that should be used to teach beginning computer programmers. Specifically since MOST people will have to code in C or C++ at some point in their jobs, and it's (in my opinion) FAR easier to code Java, from an understanding of C++, than it is to code C++ from an initial understanding of Java.
Education is the silver bullet.
You're telling me that, having done Java programming for the last five years along with C and C++, you can honestly say that Java APPLETS crash less often than C++? Have you EVER programmed a Java Applet? Oh, wait - and then tried to VIEW it using the browsers that people are using? Like, IE 5.5 on an IMac? Netscape 4.0 on a Win box? You obviously have no idea of what I'm talking about. The VM is unstable, since every crappy version that people are still using has bugs. The latest and greatest JVM for servlets is fine - I never said it wasn't. I was talking about Applets. And I was talking about Applets because people always say that Java is portable, and then they're arguing that Java should be taught as a first language for beginning computer programmers. A beginning computer programmer is likely to be shown Applets, as a matter of course - and that will be a disappointing experience. Applets are VERY hard to get to work correctly on all platforms. There are versions of the JVM in browsers that will CRASH if you ask them what version they are!
In truth, Java is one of the most stable platforms your can find today for development. You're quite obviously not talking about Applets, which was what I was mentioning, when you misquoted me.
Passing variables by reference. What I'm talking about is the fact that Java allows you to return either no values, or one value, from a function. There's no way to return multiple values from a function, unless you use a class. Repeat after me : Java lacks the ability for the coder to use pointers. I can't write this in Java :
void ModifyA(int *a) { *a = 1; }
And there's no good reason I shouldn't be able to. Specifically, for you to write this :
void ModifyAAndB(int *a, int *b) { *a = 1; *b = 2; }
In Java, you would have to use either a Vector or a special-purpose class. That's insane. Keep in mind, I'm talking about TEACHING BEGINNING PROGRAMMERS, here. I could care less about it lacking that functionality, in my professional life. It has about zero impact on anything - and it's trivially easy to work around, in most cases. But you show that C++ code to a Java programmer, and they are LOST. Therefore, teach them C++, in the first place, NOT JAVA.
I can hardly believe your last two paragraphs were written by the same person! I agree with them, whole-heartedly. It sounds like you're saying that the way to teach beginning computer programmers is by showing them C, and then C++! That's my point!
Java is fine, and I happen to use it on a daily basis. But I recognize that it's not the best language to teach beginning computer programmers! The best language, in my opinion, for teaching beginning programmers, is C and then C++. You seem to finally agree with me, after misquoting me, and insulting me. Granted, I insulted you right back. But, remember the children! :)
Education is the silver bullet.
Oh, well, yeah. That's what true OO is all about.
This has been a recurring theme in people's responses to me, so I want to adress it. NO, IT'S NOT. Object Oriented encapsulation is about encapsulating the data in once class, so that ANOTHER class will not access that data! When I'm writing several methods in the SAME CLASS, there's no reason that the language should prevent me from changing a value in a method! That's certainly not what Object-Oriented programming is all about, "true OO" or not!
Education is the silver bullet.
You sound like the type of person who would code a Penny object for a financial database. By providing a simple example of Java's inability to return multiple values in a method, I was making the point that it's harder to write certain methods within a class. (Quickly, any way! I remember when RAPID Application Development was desirable!) I agree with you that exposing functions like mine in the public area of your class is a bad idea. But there's NO GOOD REASON why I shouldn't be able to declare functions like that in the private area of my class. Encapsulation refers to the API - the interface to your class which is exposed to the outside world, the user, the coder. FORCING someone to encapsulate their data, within the methods of one class, is madness. If my file contains NAME and AGE, there's no good reason that I shouldn't be able to fetch that data, as a private method of my class. None. Forgive my silly example, pretend instead that I had listed the function as follows :
void MySQLFetchUserNameAndAge(unsigned int id, char **Name, unsigned int *Age);
And imagine that my database is designed to keep track of who can legally buy cigarettes or alcohol in a store on campus. Imagine that every student has a student id which is a non-negative number, which is magnetically stored on their student ID. The store wants to allow people to quickly scan their student ID to verify that their Driver's License is valid. Also, they'll get a student discount. Imagine that all of the data is stored in a central MySQL database. Now, I'm writing this function to encapsulate my call to the MySQL server, because the university is thinking of switching to Microsoft Access, despite my best warnings. Now, imagine I have two hours to write the whole thing. I would argue that it's better to encapsulate a private call which might have to be changed in the future, so that it's exposing as simple of an interface as possible to the rest of my class. Imagine that this is a method in the private area of my class, which will only be called by other methods in my class - which expose a brilliantly designed API to the rest of the universe. Now does my example demonstrate poor cohesion? You're telling me that it makes sense that Java says that I should have to use a Person object with accessor and mutator methods for all of its class-level variables? In the middle of my class? In an API that I'm not exposing to the outside world? The internal functioning of methods in my class shouldn't require encapsulation. And by the way, your way takes far, far longer to code. Again, this reminds me of the Penny object, in a financial application. It might be brilliant code, but making something an object doesn't magically grant it cohesion.
Universities teach Computer Science. They also teach Art History. It's pretty hard to get a job, as an Art History major. Heck, it's hard to get a job as an English major who graduated at the top of your class. A useful function of the Computer Science education is gaining experience in computer programming. As I mentioned, there are a handful of people in the world who do Computer Science for a living, without ever doing computer programming. I think it's essential that someone who is preparing to enter the work force have useful and marketable skills. Therefore, I think that chosing the language to teach Computer Science with, is an important decision. Specifically since almost everyone with a Computer Science degree ends up programming for a living. I think it is possible to teach Computer Science by teaching computer programming, and showing what it means. Computer programming is essentially the language of Computer Science. Computer programming would be the syntax and Computer Science would be the semantics, in my argument. I would agree that learning good programming practices, and what it all means - the Computer Science of it - is the most important part. But the language plays an important part in that! It would be like trying to teach English Literature to students who are forced to read and discuss it using only Spanish. I'm stretching my example, sure. I'm just trying to illustrate that the syntax plays a role, in learning the semantics.
You have at no time in your arguments demonstrated that Java is a better language to teach OO in a University than C++. You have merely asserted it, several times. This does not form an argument. An argument uses logic and examples to illustrate and defend someone's reasoned opinion.
If you have to fight memory management and pointers, then you don't have a good teacher. Memory management and pointers are easy concepts to grasp, if you discuss it in the right language (read : one that HAS memory management and pointers available for coding - i.e. NOT JAVA), and if you have a good Computer Science background, framework, teacher... You can't debate this point with me. Address and defeat this one single point of mine and I will be persuaded.
Beginning students, as you rightly call them, should be granted the opportunity to use the same tools as advanced students. You never make the case that BASIC should be the language of choice. Why not? It's BEGINNER's All-purpose Symbolic Instructional Code! The answer is obvious - it lacks constructs that are essential in any serious later programming. Java lacks constructs that are essential for C++ coding. List for me constructs that C++ lacks that are essential for Java coding.
Hey, thanks for pointing out the whole 1.2 to 1.1 thing! That helps! I hadn't had the time to research what had happened to me.
Again : you can win this debate if you can list constructs that C++ lacks that are essential for Java coding. Oh, I suppose for extra credit, you should have to assert and defend the position that people are more likely to end up having to write Java than C++. (They're not.) And it would be nice if you demonstrated that the first thing that beginning Computer Scientists should learn about is OO. (It isn't.) And you would crush me completely if you could demonstrate that pointers aren't necessary to learn about for a Computer Scientist. (They are.)
And do it all while remaining calm.
Education is the silver bullet.
To quickly put the analogy in math terms : You are stating that all of mathematics should be taught in polar coordinates. They are far more useful than cartesian coordinates, because there are several circumstances where polar coordinates are vital!
If C++ had been taught in your program, from the very beginning then students could easily focus on learning the material that was taught, and explore the concepts, as opposed to fiddling with trendy single-task (ie INTERNET) languages. It would allow the students to develop, and the teachers to test on whatever system they are most comfortable with, because C/C++ is the most platform independent language in the world. You can run C++ on a Lego. You can run C++ on your car's Fuel Injection system. Java Applets crash in some browsers when you ask what version they are. Java servlets are far better behaved, granted. And the latest and greatest JVM is probably pretty darned good. But when people say "Java," I have to remind them that not all Java's are created equal. Granted, neither are all C++'s, but you don't get to use the argument that Java is MORE platform independent than C++. That's my point.
While some programs have different views, the one I attended, and my personal opinion as well, dictate that the objective of a Computer Science education is to teach you the theory behind the construction of a program to solve problems efficiently, as well as expose you to prior work by individuals in these areas.
You are absolutely correct. Some of those theories relate to data structures and algorithms that are impossible to implement in Java, but are easily done in C++. Take special note of the fact that William H. Press, Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling have not yet written a book entitled "Numerical Recipes In Java : The Art of Scientific Computing." (That book exists for C, Fortran, and Pascal - all traditional Computer Science programming languages.)
C++ has a larger available API than Java. By far. Java allows for rapid development of many programs in the eCommerce problem space. However, for coding 90% of your applications, C++ is just as good, or better, or far, far better than Java.
All that said, let me reiterate that JAVA IS FINE. It is awesome at some things that C++ sucks at. I use it daily, in my job. I seriously wish that Java Applets were more stable, so that more people could easily develop for them. Yay Java! But not for TEACHING BEGINNING PROGRAMMERS.
Education is the silver bullet.
By your extended argument, BASIC sounds ideal as an introductory language. After all, things getting more complex and difficult is how courses are supposed to go right? The point can be carried out, ad absurdum. But, going in the opposite direction, C++ can do just about anything, whereas Java can't. And also, C++ is far my widely used, and excepted. If you're going to pick one over the other for teaching beginning Computer Science students, pick C++.
As a student in High School, I learned about binary trees. They were on the AP CS exam, when I took it. I presume they will still be on the AP CS exam, but now in Java? That's nuts. My point is that, if you're going to pick ONE LANGUAGE to teach beginning Computer Scientists, it should be C/C++, not Java.
Huffman and ZIP are different. I did code a Huffman compressor in my Computer Science courses, and we did it in C. Doing the same thing in Java would be nightmarish. Unless you cheated, and used the Java class libraries to take care of the hard stuff! That's my point - they should be able to do it from scratch. Otherwise, why make them do it at all?
So, all of the things you're proposing to teach them, I can teach them in C++. Easily. But you can't easily teach them memory management, pointers, many data structures, operating systems, and a lot of fundamental Networking. And I can even teach them to code a real Operating System, a real Database, a real First-Person Shooter video game, and device drivers. These are valuable things to be able to teach!
Java is great. But C++ is better, if you're only going to choose ONE language to teach beginning Computer Scientists.
Education is the silver bullet.
Yes, several methods in the same class should pass variables, and they should often be allowed to return more than one value. That way you can write atomic code that is easily used for multiple purposes. You encapsulate the functionality into building blocks that can be used, in many different circumstances. This is a fundamental concept of structured programming.
Using member variables to do all of the communication within a class is akin to using nothing but global variables in a normal program. You can't write re-entrant code, recursive code, or methods that call methods that call methods... You end up with a morass of code that's impossible to maintain. At least, when you're coding a class with any significant size.
C recognizes that often, it's convenient to have one function return more than one value. This is accomplished through explicitly passing by reference - allowing the called method to change the value pointed to, so that the caller can then access that data. In Java, the only way to do that is to use a class - like Vector, or a special-purpose class.
That slows down coding, and doesn't in any way lead to better code, or better OO design. It's merely a hoop that you as the programmer have to jump through.
Back to the whole point of this discussion : most programmers will have to use C and C++ in their professional lives. Java lacks functionality that C and C++ have. Teach beginning Computer Science students in C and C++.
Education is the silver bullet.
It is widely and freely available. Not as much as C or C++. Almost every machine on the planet is capable of running C code. That's not true of Java. And you're never going to write device drivers in Java.
It is being used widely in the industry - again, not as widely as C / C++. Not even close.
I think educational institutions have a responsibility to release students with marketable skills. I agree with this statement, whole-heartedly. Unfortunately, you seem to think that Java programming is a marketable skill. Or at least, you seem to think it's MORE marketable than C/C++. Which is insane. Any reasonably competent C/C++ coder can pick up Java in a heartbeat. The converse is not true. I've seen Java coders who STILL can't figure out how to dispose of memory, basically don't understand the difference between stack and heap, and don't understand pointers well enough to dispose of an element of a linked list.
And Java offers all the needed constructs and is good to teach the OOAD methodology. No, it doesn't. By virtue of using Garbage Collection, it is taking memory management out of the hands of the developer, teaching people to be lazy when it comes to object instantiation and use. Not having pass-by-reference gives people the idea that having class-level variables is a viable option. But the problem is that most simple projects are written in one class, which essentially teaches them to use global variables - which is not good. Lacking pointers is the critical flaw...
It's possible to learn C/C++, with an understanding of Java. But it's far easier to learn Java with an understanding of C/C++.
Most people will end up coding C/C++ for most of their work. Teach them to use the language that they'll end up using. Specifically because it's easy for them to then learn Java. Whereas if you taught them Java, it's not as easy for them to then learn C/C++.
Education is the silver bullet.
"Here are some reasons why you are bad ..."
Of course I meant,
"Here are some reasons why you are wrong..."
or probably
"Here are some reasons why this is a bad idea..."
Sorry. =)
Most people do not need assembly. It is an important fundamental, and it should be a part of every CS major's education, but it is not a requirement for understanding how to program in a high-level, abstract language. (It may be a requirement for writing good C code, however.) In fact, very many computer scientists hardly ever program. Programming fundamentals should be about the foundations of programming, not about the implementation on hardware.
My school now uses Java for its introductory classes. Since I TA'd these classes in both the C++ and Java versions, I think I can speak with a little authority. Java is a good language to use for introductory programming/algorithms.
The class particularly in question is called "Data Structures and Algorithms". In my experience, the students who took this course in Java had a much smoother experience than those who took it in C++ the year earlier. Programs crashed mysteriously less often, they didn't have to deal with memory leaks, they had less compatibility problems, and were able to write more sophisticated and interesting programs in the same amount of time. Since Java is simpler, we were actually able to teach almost everything in the language to them, where for C++ we had to leave out a significant amount of its core (such as templates, which meant that they couldn't really understand the string class, for instance).
All of the CS majors took "Systems programming" the next semester, which is a hard-core C programming class; most go on to take Operating Systems, in which they learn anything you'd hope they'd learn by struggling with C or C++ in the intro class. I agree totally that systems programming should be a significant part of any CS program. But systems programming is just *a part* of computer science (in the Slashdot/Linux crowd, perhaps it is the most popular). And in truth, things like manual memory management and hardware access are not important in most of the other parts of CS. For teaching algorithms and data structures, these things are a hindrance.
Personally, I'm waiting patiently for the day when only the most low-level software (a microkernel and hardware drivers) are written in C or assembly, with all of my applications written in a safe, GC language (perhaps Java, though there are better alternatives). It sure will be nice to be free from buffer overflows and memory leaks, finally! So while my recommendation of Java here is partially influenced by that goal, I think it is also quite justified for pragmatic reasons.
Here are some reasons why you are bad (I have TA'd 7 CS classes at my university, so I am not just pulling this out of my ass):
- Many people who will not be getting a degree in Computer Science (but who might interact with programmers or write some MS Access scripts) take introductory programming classes. It is important to have these people learn the fundamentals of programming rather than their actual implementation -- assembly will be practically useless to them unless they take the time to take compilers, operating systems, etc...
- Assemblers (and I might even stick C in this category, if I was feeling snappy) do not support the abstraction and generic programming features important for writing interesting programs. (Except systems stuff.) Introductory programming classes typically focus on data structures and algorithms; if you make the students program these in assembly, you are limiting the amount of material you can cover (and therefore, how much they can learn).
- Assembly as an introductory language is going to scare people away from computer science. Systems programming is pretty fun, but it's not for everyone. Many computer scientists hardly ever program (let alone in assembler), and I would wager that most professional programmers do not need to write in assembly language. Assembly is a great enhancement to a programmer's (or scientist's) knowledge of computers, but understanding it is not a requirement for programming in high-level languages.
- The world will be a better place (fewer buffer overflows (thus security holes) and memory leaks, more portable software and code reuse, and shorter development cycles) if we encourage new students to move towards high-level, abstract languages. I'm not saying Java is the best choice for this (though it may be the most practical), but assembly certainly isn't.
...of good programming.
My college is now in the experimental transition from C++ to Java. Personally, from what I've seen as a consultant at the college, all it does is make programmers sloppier code writers.
The problem I've seen with rookie C++ writers is that they fail to grasp what's going on inside with the CPU and the memory processing the program.
My fav beginners language: assembly. People who learn assembly learn about what jumps and loops do, how registers, memory, and IO ports are used, and how to be clean at using memory.
Our final program was one that used the clocks T0 and T2 to program the speaker to play line of music read from a file. Sure, you can do the same with C, but rather than using libraries, everyone got to see how things got moved in and out of the IO registers, as well as how to use them to manipulate PC hardware.
As a bonus, we then got a chance to toast our Interupt tables at the end of the semester. Sometimes, trashing a machine is the best way to figure out how it works!
Assembly gives everyone the chance to not only work with hardware directly, but also how to make your code more efficient on CPU cycles and on memory block management (because you have to manage it directly, rather than leaving that up to the compiler).
is straight and narrow.
It should come as no suprise that someone familiar only with Java should *fall on their faces* at pointers and memory leaks. These things don't exist in Java unless your building a VM. The idea that the *right way* to program means running afoul of these creatures is just polemic.
I feel about the C's the way I feel about Windows, I could spend time trying to master it, but world+dog has a 10 year headstart. And BTW, I've been writing Java for two years and have yet to build a GUI anything. Instructors relying on toy projects and libraries are lazy instructors and not valid arguments viz the language.
illegitimii non ingravare
You have to keep it simple-- whatever rout you go, you should make sure that the peripheral knowledge required is minimal to non-existant. No fair making people learn make in order to learn C. And no fair making them slog through all this crap about classes, public, static, void, and main just to write "Hello World" to the screen. Interpreted languages have the advantage of not needing a compiler, and pure procedural language skip all the OO stuff that you can cover later. (Though I believe in a move to OO once students have the basics down.) Scheme is lovely for these reasons, but anything that allows students to quickly get the matter of the lesson is fine.
The main thing is that generic concepts are stressed. It's useless to learn how to build an interpreter in Scheme if you don't see how the same thing could be expressed in Java, or C++, or whatever. It's far more valuable to start seeing all languages as data structures than it is to just build a parser. Once you see that, building an interpreter for any language, in any language is possible.
What I'm saying here is that starting from a high-level language, stressing high-level concepts, really is the Right Way to Do It. I've tutored students for several years, and I've always found that when you show them the big picture first, and keep it in mind when talking about the details, the light goes on much faster, and they remember more the next time.
<cheap shot> Then again, that's just my first-hand experience and carefully-honed intuition talking. Starting with pointers, memory management and big-endianness might be the way to go after all. </cheap shot>
-Froggy
You are asking yourself one question, which language should be thought in school. But you should ask yourself two questions. First, which language should one learn to get a job? C/C++, get some added OOP and then Java. Best way of knowing how to code in a work environment.
Then you have the question, which language for teaching OOP. That is a tougher question, since there are a lot more real OO languages out there than most knows about. I have no specific choices to give you, but I know that C++/Java can not teach you OO fully, if you think so, you have fooled yourself greatly. And I will bet that you really do not know OO.<BR>
OO is quite an advanced concept, and takes quite a lot of time to understand. It's still more academic than industry adopted, but it is VERY VERY cool when you finally start to understand it. I wish I had more time to learn even more, but I have to code C++ since that is what I am paid for.<BR><BR>
//John
Python will also have you coding games in no time. check out http://www.pygame.org. Learning should be fun and games are fun.
--IBM created Microsoft. No ibm = no M$.
IMO: :-)
Python = Ruby - some_neat_feature - 0.2*perl
Python is easier than ruby for newbies because it misses some of the 'perlism' of ruby (like $_ and company, assignment returning values, etc... ). Also, the iterator syntax strikes me as particularly unintuitive, if powerful.
Ciao
----
FB
I guess id depends on what you want to teach. If you want to teach algorithms, or give a programming tool for non-programmers, Python is fine. If you want to teach OOP programming, maybe is better start with Java
And if you want to teach how computer works, nothing beats C, the portable assembler.
Ciao
----
FB
(disclaimer: I am a professional Java developer)
/.er has the slightest comprehension of what's out in the "real world" -- Java's not useful for "the real world"?!? Does anybody actually realize how much server-side Java code is out there?
Seriously, you're asking *Slashdot*, which rather by definition contains a ridiculous number of C & Linux zealots, whether Java is an ideal teaching language?
That's a lot like conducting a poll of Bush's popularity at the Democratic Party Headquarters.
Judging from most the comments above, I don't think the average
Arguments about its utility as a teaching language are fine, but anyone claiming you can't get a job with Java skills hasn't taken a peek at the want ads lately.
ZFS: because love is never having to say fsck
To start with, Java is a currently used, valuable assset in the job market. It teaches a number of skills and can be used to illustrate a lot of concepts in CS. That's the practical, easy reason for a wider acceptance as a basic course in CS.
To follow on, both MSFT and SUN have weighed in now heavily with Virtual Machine byte-code languages and platforms (.NET in case you didn't realize that MSFT is actually following after Java) as being more capable and in some cases theoretically as fast or faster due to run time optimizations impossible in statically compiled languages. Interesting, isn't it? You can do things by examining the byte code at run time that the assembly code at compile time won't allow you to do. Think dynamic loading, introspection, virtual method inlining, just to name a few.
It's free and open. This has been mentioned, but the specs, while nominally controlled by Sun are in fact controlled by the JCP and that means by industry and community members. You don't even need to use Sun. Use IBM, or the GNU/Kaffe systems, or the Linux Blackdown ports....
On a different, less practical tack...
The thing we are fast slamming into as anyone in the industry knows is complexity management. It's time for many of us to let go of the assumptions inherent in knowing the assembly-language model of computers. You shackle your thought process to a certain execution and ordering model that both changes over time and changes between platforms, and you become tunnel visioned to a certain mode of thinking. One that does not allow for rapid, adaptable abstraction, which is the human method for dealing with complexity.
Case in point. You did, at one time in the past, have to write some very low-level routines yourself to do things like draw windows, access disk drives, direct codes to the raw printer, or even spin the disk drive up depending upon how far back you travel in time. All those things are now abstracted away from the day-to-day programming, so that we can deal with remote method invocation, distributed objects, relational and object databases, and concurrency control.
Why is that a bad or wrong thing? Getting any decent language (Java, C, C++, LISP, Smalltalk, etc) into a person's head to start gets them capable of thinking about the idea of O(n) type analysis. You don't need assembly for that. It's algebraic if you look at how it was developed. You don't need any language at all, just an algorithm.
Get over it! I learned assembly one of the first languages as well, but I don't think it's as much of an advantage anymore, and to deal with increasing complexity and systems, and new ways of modelling and desinging those things, you do not want to think about that sort of process as your core design philosophy.
Cool factor yes. Practical, only for a few low-level programmers that give the rest of us the abstraction layers we need. Both tasks are hard, but there's fewer people needed at the layers nearer to the chip.
My thoughts. Give yours.
I spent a few years pursuing, among other degrees, a degree in Software Engineering. At the University of Wisconsin La Crosse the very first course I ever took (required) in 1996 was Eiffel on NeXtStep. For months people in the class were complaining about not being able to learn C/C++ and that "Eiffel was never used anywhere and learning it was a waste of their time and money." That was a valid argument. But, the most interesting reply was from my professor when he said "You are not here in college to learn a specific language. You are here to learn what OOP is, how it works, and the beauty of its power. You are here to learn a skillset...since languages change all of the time and your need to know different languages changes all of the time...Here you are being given the knowledge to learn OOP ideas and principles, and then you can go out and apply those to whatever language you want." That made perfect sense to me and to this day still does. I really, truly feel that this news article and most of the people posting comments to it are simply fighting the wrong battle and begging the wrong questions. This is not whether C/C++ is better than Java or SmallTalk or Python or whatever...Although 99% of the posts are about that. The question to a college professor and hopefully Software Engineering and/or CS majors should be "What language and tools will give me or my students the absolutely best ability to learn OOP and then apply it to all of the languages of the world." For almost everyone that answer has become JAVA. It is not a matter of whether you like it or not. It adheres EXACTLY to how an OOP language should be programmed and used and it doesn't let you do otherwise. The IDE's are cheap if not completely free, and unless you are planning on coding for some specific piece of hardware (which no one here truly does I am sure with the exception of a very few people) you would be using Assembly or already know what you are doing with another language, JAVA keeps people from learning and thinking that BASIC or Pascal (which everyone learns first...usual because their first computer came with DOS or something or they have to take it in high school) is the way that programs are really supposed to be written in which C lets you do that since it is not OOP at all. When you stick a student coming fresh out of a C course in college into an OOP class with JAVA, they are completely lost. My class went from almost 50 students to about 8 in the first 8 weeks. That is because they had no idea about the "concept" or OOP. The language is/was truly irrelevant. I have learned Eiffel, JAVA, C/C++, Assembly, ADA/OOADA, Pascal, Basic, and a variety of other languages and applications (Matlab, etc. ). C++ always felt like C taken to a place it was never meant to go. C++ should have been a completely new, independant language from C with OOP design and fundamentals from the start without an C at all. In this sense, OOP and JAVA are perfect together for a college curriculum and its objectives. But, there are NO good alternatives to C++...I agree with most posters here on that issue...but learning OOP the right way before you get into languages such as C/C++ is very important. JAVA is a great tool and teacher for that. It won't let you be a C or BASIC programmer. Every language has is place and purpose.
Java, in my humble opinion, is not a good core learning language for computer science. Lisp (or Scheme, as used at my school) is a good choice. As a language to teach object oriented programming, it's not bad. Neither is C++, or several other languages.
I never took the AP computer science course (my high school didn't have AP classes). If the goal is to teach computer science, then I think Java is a bad choice. I would argue that you could design a high school introductory computer science course that could be done entirely with paper and pencil.
The problem is the computer science/programming confusion. Teachers, parents, and kids think that they want to learn programming. They demand that the courses use current programming languages so that they're not "wasting their time" with something like BASIC. They don't understand (and, perhaps, don't care) that they're not learning computer science, just a single programming language.
I have been arguing for the past 3 years (when my University had switched from C++ to Java) that it was a bad idea.
From a theoretical standpoint, Java skips two important features. First, it does not have (traditional C) pointers. Learning a linked list in Java (if you actually learn one instead of using a library) lacks the effectiveness of learning a linked list in C/C++. Along the same lines, becuase of its garbage collection, Java teaches first time programmers to be lazy with their objects. I saw countless programmers who cut their teeth on Java fall flat on their faces later on when faced with C++, with its pointers, segmentations faults, loss of memory, etc. you are much better off learning the right way before being able to take shortcuts.
I have also notice some disturbing trends with the way Java is used to teach. When I took classes in C++, our projects were Comptuer Science oriented, such as simulating a rudimentary telephone switching system. Many of the first year Java assignments I have seen take "advantage" of Java's graphical features, and involve clocks, scrolling text, etc. Instructors seem to lose sight of the real Computer Science oriented projects that present themselves when the only easily availible interfaces are file and text.
So I heartly say that Universities (and High Schools) should teach C++. And students learning Java now should do themselves a favor and learn C++ on their own.
_sig_ is away
Actually, Java is a cleaned up version of the ugly, ugly mess that C++ is.
The illegal we do immediately. The unconstitutional takes a little longer.
--Henry Kissinger
Please mod this up - this guy actually knows what he is talking about!
My college is changing over from C++ to Java right now. Here's their plan http://www.cs.depaul.edu/news/news.asp?theID=445
The first problem with teaching languages is that you have to decided if you are trying to instill understanding, or marketable skills. A cluefull progammer can pick up a new language quickly --- but someone with bad fundamentals, even with years of experience, cannot pick up new methodologies easily.
So, assuming you want to produce people who actually understand what they are doing and have a few years in which to do this, i sugges something like this:
1st: introduction: basic C.S. theory in conjuction with scheme/haskell/ML.
rational: a) functional languages are more closely tied to C.S., there are things that become obvious in FL's that are very hard to see in procedural languages. b) levels the playing field. If you have an intro java class, you are going to have a handful of poor-quality self-taught programmers in your class. They won't pay attention because they think they know it allready.
2nd: fundamentals: two streams, one in assembly (MIX or MMIX would be ideal) and the other in OO (using a language like smalltalk or preferably something with multiple inheritance, or perhaps CLISP with CLOS is you used lisp in the first stream)
rational: OO design is going to be with us for a while. But programmers who don't understand the underlying machine do silly things in any language. Presenting these streams early, you can ease your way into both.
3rd: from here on out you can concentrate on more practical issues, both in terms of languages used (e.g, introduce 'c' as a high level assmebly, and c++/java as ugly-but-practical compiled languages). You should encourage students to learn a few languages, and especially to work with something like python (with c++ for performance after profiling) for rapid prototyping. Well, for the competent scheme/lisp will allow faster protyping, but there is no sense in insisting on that, if people want to build marketable skills.
S.
-dB
"It if was easy to do, we'd find someone cheaper than you to do it."
C?! Java?! That's like arguing which bunch of politians are more honest, Democrats or Republicans. The answer is "none of the above".
.ps or .eps code and sent back a .JPG of the output and a text log of the RIP messages. Then they could do their assignments on web access PCs at any public library.
A learning language has several requirements different from a application development language (like C or VB+Access) or a scripting language for a production evironment (Perl, any UNIX shell, DCL). Students need a language that is
- free. As in: here, have a diskette to take home.
- light. Low system requirements. Run on any old computer students may own or schools may be saddled with. Were talking 8 bit here, not 16 or 32.
- small. The entire run-time and development environment should fit on a $1 3.5" floppy. Not a CD-ROM. Students may not own or have access to computers with 660 free Megabytes of hard drives space to install the software.
- portable. Students do not all own the same kind of computer, if they own one at all. Same with schools.
- low-level. Students should be able to learn about the assembly language underpinnings of the language: registers, stacks, zero-page, addressing...
- FAST. on slow/obsolete hardware.
- Interactive. None of this edit/compile/link/run/crash/repeat BS. It's easier to learn when you can try out the syntax at a prompt, like BASIC or any shell.
- Toolable. You should be able to write tools in the lanuage to help you write programs faster and more easily. If you can write your own syntax-sensitive IDE and source code tools, students will see how programs can make programming itself easier. The easiest example would be an editor that accepts scripts written in the language their learning to modify the current file. They can write easy stuff, like Comment/Uncomment, to make it easier to get their homework done.
Few languages fit all these requirements. Most require a "Developer-class Workstation" eg. a fast CPU with generous RAM and lots and lots of free disk space. It's not fair to kids to assume they have that available at home or that they can stay after school to use the lab. Kids should be taught languages they can use on any PC they can afford, obtain, or borrow.
And that'd be FORTH. It's essentially a reverse-polish notation macro for raw assembly. It's easy to port by essentially porting the macros to a new CPU/architectures. It'll run on ANYTHING. You can learn it on an Apple II+, a PC/jr, an AT, a 286 clone picked up at Goodwill for $30, or the family Macintosh Plus (or iMac for that matter). Procedures can be built interactively and/or in an editor -- compilation is optional. It has everything C(++) has -- pointers, structs, file I/O, OOP, flow control, and access to the hardware at the lowest levels. GNU has gforth available.
From there, you can teach them PostScript, which is basically FORTH, only easier to read and with easier built-in datatypes. Students can learn on GhostScript and GSView, with a final copy for turned-in homework sent to a printer and RIP'd without errors and with correct output on the paper (use an overlay for grading). PostScript is a nice intro to 2D graphics programming (no animation though), and you learn how printers and fonts work. If students don't have a PC or Mac that can run GSView, it would be trivial to build a web interface to Ghostscript that accepted their
Then, you graduate to not Java, but the Java VM itself, which is also stack-based, and operates along the same lines as PostScript and FORTH. You can teach them Java, and show how the sytax of Java is compiled into the JVM bytecodes that act just like the FORTH they alread know and hate/love. With Java, you can build on the graphics principles learned with PostScript to build animated, multimedia GUI applets. Because the students may not own Java-capable computers (like something with IE or Netscape 4+), use Waba, which is just Java, but without all the built-in classes and dumb bloat that Sun stuck into Java. Waba requires only 64K of memory, and the entire VM and program code can fit in 50K. It supports graphics, GUI, and sound, and runs in the JVM of Java-enabled browsers (being a subset of Java).
Although I'm advocating some pretty OLD stuff, the students don't need to suffer in crusty old editors or shells to learn this stuff. Give them nice tools/editors/shells, with all the key commands where they expect (i.e. arrows/backspace/return for editing, not ^F/^B/^H or the vi command set).
Using modest software like FORTH, PostScript and Waba would also make it viable for schools to partner with obsolete PC recyclers, and donate a rebubished CPU, Monitor, Keyboard, Modem, and mouse to students that don't have a computer at home.
You don't need an expensive or even a recent computer to learn programming. It's the OEMs, like Apple, who keep goading to the schools and parents to buy Buy BUY new machines semi-annually. "Without multimedia, your children will be DUMB, un-employed, pregnant, drug-using drop outs! Do you want Strawberry, Tangerine, or Grape?" High-school programming classes are not about getting you a job, and you don't need to know C or Java already to get accepted into a CS program. Kids need to learn how computers work from the lowest-levels, so they don't grow up to be superstitious, clueless, and gullible when it comes to technology. Just throwing iMacs at kids and schools (as tempting as it may be to throw iMacs at anything) isn't go to insure that.
Democracy. Whiskey. Sexy. Pick any two.
Why start teaching CS knee-deep in? Start with the basics of computational theory and lead into a few languages that accentuate some of the key ideals in computational methodology. Lead into smalltalk and eiffel for the pure OO Lisp and scheme for some fun =) ML and Prolog for grammers, structure based definition madness. Or something like that. What do I know, I was just a CS/CSE major.
Safety First Day?
I am a Perl programmer, I truly love the language.. all it's little strangenesses and all. As a 'First Language' I'd really not recommend it though, a first language should allow people to learn the basics and also allow it to be easy to apply them to whatever language they ended up using. Java and C++ are similar, this is a useful thing since both are heavily used and someone who truly knows one should be able to pick the other up with minimal trouble. Personally I can see the advantage in doing what my Uni did, teaching the student a wide range of languages.. we had OO training in Eiffel and Ada, first principles in Ada, algorithms in C, AI in LISP, and also touched on Miranda and some others, and I personally did my dissertation using Java. With this range of languages I learnt how to program, not how to program in 'Language X'. It worked, I got a job doing Perl.. a language I'd never seen before.. and was up and running in no time.
404 Not Found: No such file or resource as '.sig'
A lot of good points have been made about not really being able to be a good programmer until you understand assembly and registers and such. And I certainly agree. As a CS student who has just recently been learning about microprocessor design, I have found the information extremely useful, and it has helped to make me a better coder. However, starting to teach someone CS that way would be a nightmare. How do you start with registers, ALU ops, and cache structures when you're trying to tech someone how to code? People are coming to CS more and more now to get a general idea of how computer programs work, and starting out by teaching them on a high level (a la Java) makes perfect sense. The simplicity of Java takes away the little headaches (memory management) which make learning algorithm design so difficult. Also, Swing allows people to easily create GUI based programs, which helps instill a sense of acheivement and keep students motivated. Of course, it only makes sense to move on down the line to lower level ideas as one progresses, but starting there would only confuse and frustrate the student. The key to effective teaching is to start with concepts that people can understand and then as they become comfortable with those, expand on them and allow things to grow more complex. You need not start from the very beginning, just work your way back there. From that point of view of education, starting beginning CS people with Java makes perfect sense. And as the progress, you can move into C/C++ and assembly and other more advanced topics.
"Is it a miracle that curiousity survives formal education." - Albert Einstein
The answer is "It depends on what you are trying to teach". We throw around the term "computer science" a lot, but it really means quite a few different things to different people. There are two major components to computer science: abstraction and implementation. You eventually need to master both of these, but it's usually convenient to emphasize one at the expense of the other at first. Here are some examples of emphasis and which languages would be used:
- Computer programming: This is what you will learn if you take a CS course at many community colleges... and many universities. The goal of the class tends to be to master the syntax of the language, and to be able to write some simple programs. You'll see things like Visual Basic, C, C++, and Java used for such things. The main things you want from a language is that it be easy to learn, and something that you see "in the real world". The availability of graphics (Java) and OOP is also a big draw. The advantage here is that you get people started quickly, and you don't lose too many people at first; more advanced topics can be covered in a later course.
- System programming: sophomore level; at this point, you want the student to master the internals, to know why referencing a pointer you've called delete on is a bad idea. C and C++ are okay, but there is really no substitute for assembly, even if it's on something like a Z80 or MIPS. With the newer processors coming out, it seems like very few people will be writing assembly themselves anymore, but you still need to know what's going on under the hood. The downside is that, in practice, assembly is too low level to start people off---you lose a lot of people that you didn't have to. It can be done, of course, but there are easier ways to handle things.
- Computer science: usually senior level courses will get into this, though many universities start off this way. To learn computer science (I'm using the word in a technical sense, in regards to languages here; I'm not talking about things like algorithms or hardware), you really need a functional programming language, like Scheme, ML, or Haskell. Emphasis will be on things like recursion, higher order functions, and abstraction. Computer programs written in such languages (at least the modern ones) look more like mathematics, and allow you to emphasize higher level concepts without having to worry (much) about things like memory allocation. So here, the goal is to understand what kinds of things we can do first, and then in a later course we'll get to worry about the implementation details.
You can use any of these approaches very well if you userstand its strengths. In a well designed program, the later courses will pick up where the other courses left off. For example, at UIUC, we start them off with Java (we don't have to spend so much time explaining why we picked it like we do with Scheme), the 200 level courses introduce assembly and C++, and the 300-level programming languages course usually uses SML. Furthermore, no matter which language you pick, you can cover all of these things; when I teach Java, I draw memory diagrams on the board to show what is happening under the hood when an object is instantiated, for instance.- Mattox
that ought to screw them for life
.oO0Oo.
There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
that ought to screw them for life
.oO0Oo.
There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
that ought to screw them for life
.oO0Oo.
There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
GUI has gotten a lot of ink recently, but it is not the root of computer science. I learned just enough code (printf, cout) to tel me what my programs were doing then got right into Actuall Programming (TM) It sounds like you are trying to teach CS to uninterested highschool dropouts who like flashy graphics but will never [Want/Need] to understand what a linked list is, or how to use new(). Graphics and GUI should stay in the 3rd and 4th year classes.
Also. I found it most anoying to have the professor hand me code and say fill in the blanks. Esp. when the code was poorly writen. A few worksheats with FITBs for `for` and `if` are fine but you have to know how to put the pieces together. What you do is like having a Spanish class where you translate from Spanish to English only. CS should start with a strong foundation in a strong low level language like c/c++ spend some quality time (freshman year) learning to program by learning the language. once you know the consepts it is a much easier step to scripting (perl, JAVA, VB) and asembly. If you start with JAVA it will be a real shock when the next Prof. has to break the news thatthe JAVA VM it just a Piece of software that hide all the real programming chalanges behind a blizzard of `.`s JFMILLER Those who can DO those who can't TEACH -- the problem with CS
Strive to make your client happy, not necessarly give them what they ask for
Our CS department has converted to Java as an introductory language to teach undergrads. We've found that most students find the language pleasant and fairly easy to learn (as opposed to Scheme, a language which most pupils and even some TA's dread... it made for a good "weed-out" course but not much else). Java provides a solid OO foundation for further software development, and enough C-like syntax so that if a student needs to learn C or C++, they can do so quickly. And though algorithms and data stuctures can be taught in almost any language, Java's clear and consistent syntax, and automatic memory management makes teaching the subject a lot easier than when I used C++ or C (ugh).
Still, from a more pragmatic perspective, Java sucks. We can't very well teach an OS course using Java (C is still preferred). When doing any major software engineering projects, Java is too slow to make it a very viable choice. And teaching Networking with Java is just too easy to be of any value to students (I use C again).
So Java is not universally used in all areas of CS instruction (at least in my classes). But, I find that more students learn more CS when using Java as an introductory language. And when it's time to shift to "real world" programming, it's not too difficult for them.
That being said, I would have to say that the switch from C++ to Java as an AP Computer Science Language is definitely a good move. And using Java in the college classroom is also a good thing for CS instruction (though less definitely so). However, I think its important for CS instuctors to force their students to learn "real-world" programming languages such as C, C++, and Perl. The more languages a student learns, the better they will adapt to future trends in industry.
To this Edsger W. Dijkstra rebutts with this:
and this:
I agree with the poster who said Assembly should be first. That's the first language I took (I started out as a hardware geek taking Tech classes) and it helped me a lot.
Under capitalism man exploits man. Under communism it's the other way around.
IMHO if I could teach a computer science curriculum I would teach Assembly and C++.
I say Assembly because you really should understand what is happening inside the CPU. I know that I'm more concientious about my code today because I have programmed assembly on Commodore 64, Intel, VAX, and Sparc's in the past.
I say C++ because 1) C++ isn't hiding anything. To understand the computer you SHOULD be forced to manage resources manually. You SHOULD be forced to understand that you - the programmer - are creating, using, and destroying resources and that those resources cost memory and CPU time. 3) It is precisely because C++ doesn't hide anything that it is much easier to transition from C++ to Java or VB or most any other language than it is to go the other way around.
One thing that I definitely would NOT do is survey many different languages. Learning how to say Hello world 10 times over isn't teaching much about computers.
--Richard
C++ has two big problems. One is cruft, and the other is memory management.
C++ has a long legacy. Too long. Not only is there the legacy of C, there's the legacy of early C++. Templates, exceptions, and references came in late. It shows. There are too many things that are done the way they are only for historical reasons.
C++ and C program design obsesses on memory management, because what you take, you must give back. The language provides little assistance with this. That's not what beginning programmers need to focus on.
C++ needs a major cleanup. I've been toying with a design for "strict mode" for C++, comparable to "use strict" in Perl, which would get rid of much of the cruft. C++ comes out of the 5-year ISO standardization freeze soon, so it's time to be thinking about this. But that's for the future.
If you *must know how a computer works at a fundamental level*, then assembler isn't it. I had a microcode class that really helped me to understand about assembler optimization. You can make the argument that you can't really understand level N unless you understand level N-1, recursively all the way to quantum physics.
Or why not start at the other end of the abstraction stack? Start with cognitive pyschology, perception, human-computer interaction, and the identification of human needs -- then you figure out an approach that best meets people's needs, which would lead to how to choose the right software tools and approach for any particular case.
For a CS class, I wouldn't start at either extreme. Choosing the right level of abstraction is important, and the answer isn't just automatically one below what the other guy suggests.
I think CS classes should start by making it clear that the point of it all is to create useful stuff for real people. Teach them what they need to know to get started ASAP doing so, and fill in the details with later classes.
"Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
First we're taught basic programming. CS5 is the intro class, intended for majors and nonmajors alike. It was taught in C++ when I took it a couple years ago, and now it's taught in Java. The idea is that it's an INTRO class, so you want a language that is fairly simple to learn and to use. Java is absolutely more simple than C++, you can all go and argue why to yourselves.
The next class (for majors) is CS18. CS18 is taught in a language called Dylan, which is a Lisp-like language. Dylan is fully object oriented, and has a consistent syntax. Dylan is used because it is scientifically interesting. Ignoring the fact that it is generally interpreted inside an aweful Java applet (NOODLE), it's an OK lanugage. Most notably, the class centered on teaching the students exactly what OO means and how to use it: my prof, for instance, told us all about how Java was broken from the beginning because functions aren't objects like they are in Dylan, among other things. Dylan was a fine language for this use. At the end of the course we were able to write most of a Dylan interpreter in Dylan. THAT was an interesting excercise.
One of the next classes, CS37, was taught in MIPS assembler. CS37 was a hardware class, so assembler was appropriate. Some comments have suggested assembler as an intro language, and I gag at the thought. Having a deep-down appreciation of the low levels of computing can be learned after the spark or interest has developed in a young computer scientist. If I had to write loops using JUMP and GOTO in the intro class, I might have been a (gasp!) English major.
Dartmouth's Networking class (for CS people, not for business people :) is taught using Java. That's really nice, because with the pleasant abstractions provided by Java's class heirarchy a student can get down and write a neat-o little program and not worry about Socket implementations.
I love Java now that I've learned it, and I really back it's use in intro classes. CLEARLY, Java should not be the only language used. If I were to graduate from college not knowing Java, C, C++, some form of Lisp, some form of assembler, and a few scripting languages, I wouldn't consider myself educated in the field. Dartmouth's problem is its nonuse of Perl or other such languages (I've had to learn a couple on my own). I love perl... but that's another comment altogether.
MyopicProwls
MyopicProwls
My homepage
Depending on your audience, teaching in hypercard was not a bad idea (really). For several years I worked for a CS textbook publisher, and we had a very successful intro to CS using hypercard book. It was called The Analytical Engine : An Introduction to Computer Science Using HyperCard. It made basic concepts accessible to absolute beginners. We're not talking folks who already have a strong enough interest to be declared CS majors, but as an intro class to spread understanding in the general population and possibly spark enough interest in a few students to go farther, it was fantastic.
This pair of authors (Decker and Hirschfield) also wrote one of my favorite intro to CS using Java textbooks, programming.java. (Disclaimer: I was an editor for one of the editions of this books). It approaches Java from an objects-early perspective, and uses the AWT so that you can actually see impressive looking results in the first week or two.
Of course, if you go on in CS you should learn multiple languages and get into the nitty gritty of the machine, but as an introductory language, Java excels in making programming accessible. Some have declared here that programming shouldn't be accessible, but that's what an "intro" is all about.
I just completely a Java language class at the graduate level for work (although I did English undergrad). I pulled out my old programming.java textbook and used it instead of the lame one we'd been assigned. We just got our grades for the final, mine was 3rd best out of 40, most of whom were full-time CS students. Although I do enjoy bragging, my point here is that almost any language can teach you important and widely applicable ideas if it is taught well. Most of the other students had taken several years of CS classes, and I had taken one quarter of C++ 6 years ago. But I worked publishing CS textbooks for several years, and learned a lot about how to teach (and learn) a programming language.
No language will serve you if it's taught poorly. almost any language will serve you if you can learn its lessons and extrapolate from them.
Doing my part to piss off the religious right.
Here in France, in some science cursi, there is a mandoatory choice between two languages to teach computer science: good (!?) old Pasca; and the functional wih imperative traits Caml (from which Objective Caml is a derivative, gaining object-oriented features). Java is popular in pure computer science cursi because of its wide use in the industry.
I think that if you want to teach OO principles to your students, you'd rather want to choose a pure OO language, where everything is an object, like Python or better Eiffel, which stresses reliability and good design. On the other hand C++ is also better than Java because it allows for a wide style of programming styles.
Xavier
Do I make sense? Please report if not.
I still recommend starting first term in Pascal. By the end of my first term I was comfortable programming loops, ifs, multi-dimensional arrays, and had seen pointers and recursion.
For kicks a while back I took a compressed 6 week first term java course....Week 3 we started writing code. We did loops and if statments in the same class. Can we say if loops for people who have never programmed? The first three weeks all we did was call library routines. No wonder the new programmers are confused. Believe it or not those integrated enviroments like Visual Studio and Delphi have are pretty overwhelming if you have never used a computer or programmed before. ( Do you give your kid a nail gun or a hammer and some nails when they are just learning? )
Pascal gave me a solid background to start from. Since then I have easily picked up Modula-2 and C. Which is where Delphi would come in at second term. It's OOP and allows RAD with the bonus of you already know the base language. Perfect for all those little 2nd term labs. And look, you still have time to touch on recursion, pointers, trees and other data structures and algorithms.
Once you know the fundementals of programming you can pick up other languages more quickly.
Delphi isn't portable
Okay this is mostly true. Kylix is now available for Linux. But how portable is the MFC? or Java? really? Not all Java VM are the same.
Delphi and Pascal have those evil pointers
What and Java doesn't? Check your error messages! At least they are fairly safe Pascal. So now if you learn Java as your primary, first language you are going to have a hell time with C/C++ pointer. And there is a lot of that code around. How do you think OOP works without pointers?
Yes, Delphi does
Web Services with XML Technologies
Web Application Design Platform
Web-Service Enabled Database Middleware
High Performance Native Windows Applications
Rapid Application Development (RAD) IDE
RADical Visual Development
Database development for any application
COM / ActiveX / COM+ Features
OpenGL
Just my take on things after watching my husband teach pascal -> modula-2 -> C -> C++ -> Java.
His favorite argument against Java is
How do you explain public static void main(String[] args) at the beginning of first term?
Why not MIX or it's successor MMIX?
If it's good enough for Knuth...
-Drewcifer
A java bigot.
It's what MIT teaches it's kids first. If MIT does it, does it make sense to follow suit?
Peace,
Amit
ICQ 77863057
[o]_O
Computer Science is not about the language being used. Computer Science is about the problems being solved. Yes, sometimes solving the problem involves writing a new language. As much as I dislike Java and C++ as languages, they can still be used to teach basic CS concepts without incident.
Computer Science is not about being as close to the machine as possible. That's largely branched off into Electrical and Computer Engineering. You can learn about the theoretic basis of CS using assembly, but it won't really get you anything over other languages other than a headache and a better understanding of ECE. It's still CS, but not magically "more" CS because you're working closer to machine level.
I learned the basics of Computer Science (not just "programming") in college using C and C++. I really don't like to actually have to use C, even though I think it's a nice language theoretically. I abhor C++. Java is annoying as hell, but I'd much rather do app-level coding in it any day over C++.
You can learn linked lists, hash tables, recursion, and everything else is almost any language. It makes a lot more sense and can be easier to teach CS concepts in some languages, but you can do OO, procedural or functional programming in most any language, it just may be a lot more work.
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
I was 13 when I learned my first programming language - BASIC. I did not have a computer, so I wrote simple programs on paper and later copied the programs into Atari 600 that I found in our school. At 15 I was learning Pascal and Turbo Pascal in my college. At 16, when I bought my first IBM compatible PC, I continued Pascal and started learning Assembler. About a year later, I started C and by 20 I was programming in C++ as well. I started Java in 1997 doing a project for AT&T Canada, and now I am going to tell you the following: :) )
Programming a computer should start from understanding logic and learning to express logic statements. In fact, the hardware should not matter for the first year of programming. Once you understand the logic well, then it makes sence to learn about the internals of your computer. Of-course this is debatable - I did not have a computer when I started, so all I could do was programming logic, not hardware. Later, when I got to the hardware, I was really interested to see my logic work. However I also became aware of things that are happening inside my machine. The hardware aspect came alone naturally as extension of my self training once I found out that logic is not everything in programming. I was building my first games and realized that the graphics libraries provided by Borland (such as egavga.bgi) are not fast enough and do not do everything I want. So I learned the memory management and video memory management for the 86/87 architecture and learned Assembler on the way to build my own graphic libraries.
Later came the object oriented approach, when I found out that I could not do GUI well in functional programming. I had such problems to solve as event handling, menu call-backs and AI for my games. So I learned that Turbo Pascal 7 (if I am not mistaken) handles these better by allowing real objects and event handling. Of-course C++ proved to be way more powerful (BTW at UofT - University of Toronto the first OO language they taught to us in 1996 was OOT - object oriented Turin
It seems to me that learning programming should be more intuitive and should be coming from the problems that need to be solved.
You can't handle the truth.
This depends on what you mean when you say "Lisp". If you mean the Lisp family of languages then the answer is that Scheme is a member of this family. Scheme's origins lie in a very old dialect of Lisp. In the widest sense of the term the Lisp family includes languages like Dylan and Python.
However, this is probably not what you meant. I take it that you are actually talking about ANSI Common LISP as described by ANSI X3.226-1994. In that respect the languages are very different. The Common LISP standard was created in an effort to pool the best parts of the various dialects in existence at the time (mid-1980s I think.) This included taking the most important advances made by Scheme (lexical scoping.) (Well, at least, what the designers of Common Lisp thought to be most important.)
The most important differences between Scheme and Common LISP are:
Scheme is a Lisp1 while Common Lisp is Lisp2. That is Scheme only has one namespace for all symbols. In Common LISP a symbol can stand for several things at the same time including a function name, variable name, class name, type name etc. What it actually stands for is determined by the context. The term Lisp2 is actully misleading since as you can see it has more than two namespaces. (I think the full number is around seven.)
Common Lisp has packages whereas Scheme. Packages map symbol names to symbols prevent name clashes between different libraries of code. This is much like Java.
Common LISP has very powerful exception handling. Better than Java in fact since the program can be restarted from the point where an exception was signalled.
Common LISP includes CLOS (Common LISP Object System.) A powerful OO programming extension intergrated with the type system. CLOS has generic functions, multi-methods, multiple-inheritance. It also supports dynamic class redefinition and usually comes with a MOP (MetaObject Protocol, a reflection and introspection API.)
Common LISP also has powerful macro system for arbitrary compile-time code transformations. A bit like C macros on steroids and hundred times more useful. Scheme has its own "hygienic macros" for similar purposes.
Scheme lacks CLOS, packages and exceptions.
Anyway, I hope this helps.
-- Peter
-- Peter
I've taught java programming as an introductory language for 3 years to students that want to learn programming. What I've learned from all of this, is that the students who started programming on their own (before walking into a classroom), it doesn't matter what language you use. For those who have never (and I mean never) seen a program listing before, I would (if it were my choice) use something more like LOGO or a general how do you do that introduction. Let them begin to think of things as objects or procedures, then we can teach the details. Otherwise you're teaching both at once.
I dont think teachers are paid enough to mark assignments written in Perl!
"...Should we start by teaching an easier, higher level language (ie Java) to get programming concepts down, then move to lower level "closer to the machine" language for advanced topics, or should we start with the lower level language and then treat additional languages as extras?...Personally I think the first option is the more viable..."
Now you're thinking like I'm thinking. If a small child were to ask about a car, would you explain its general use and major parts or would you immediately cover the finer points of the internal combustion engine? While it may be important to know about the internal workings of a car, these things are best introduced after a good general introduction.
I remember the first programming course I took in high school, and I hated it. There was a period where I fiddled around with my calculator, and I thought that programming would be fun to learn, so I signed up for a course in C. The person teaching the class was a originally a FORTRAN programmer, but had learned C on his own. He was so bogged down in the details of the language that he completely lost most of the class. Here I was wanting to be able to write simple little question-and-answer games, and this guy was covering the finer points of binary representation and overflow, right from the get-go. Needless to say, I bailed after the first semester, taking my barely-passing grade with me.
If we're talking about a good starting point for programming, it's usually the same answer as in other disciplines: start simple. Show some of the easy capabilities, and then peel back a layer, so to speak, to show what goes on under the hood. If you start under the hood, they're not going to appreciate it, because they never saw the big picture in the first place.
You can download Forte from java.sun.com, after registering. The "community edition" is free.
I've been running it on Debian potato, and it is far better than any java I've used to date.
Two gui's later, several hours of use, not a single crash.
The performance, as always, is the tough pill to swallow. But the component design and robustness are great for learners.
Treatment, not tyranny. End the drug war and free our American POWs.
Treatment, not tyranny. End the drug war and free our American POWs.
See my user info for links.
I will agree with the argument of C(++) being used as it gets one closer to the hardware, however, as someone who took the CS courses some time ago, I think that a CS course should teach fundamentals and be language independant. Of course at one point you have to actually use a language, but that should be a means to an end to be determined by one who knows the fundamentals. I may be getting off an a tangent here as it did mention it was an advanced course, but when I went through (hell) it was elementary structure etc. Getting back to the subject at hand, I think that C(++) has been time tested... should we just switch at a whim? It was not too long ago that we were all quiche eating ba#$%!#ds in those courses.
There are NOT that many people who will use Java, in their professional lives©
There are currently 5 Million java developers worldwide© Java is the main language used for eCommerce© Do you want your web site to leak memory?
Applets are a pain in the ass, because every browser / version on the planet behaves differently©
©©©and this is Java's fault? That's the browser's fault that java behaves differently, not the language© By the way, Mozilla's applet support is pretty nice© This brings up another problem: Applets are hardly used anymore© Java was clearly a failure in this area ¥because of buggy browser support so it's focus has been running eCommerce and enterprise wide applications©
Memory management© Real, professional programmers need to know how to manage memory, both in RAM, and on a physical medium©
Maybe, but when dealing with eCommerce or enterprise apps, additional hardware ¥to compensate for GC is still cheaper than programming time© I'm sure assembly programmers complained that C didn't give access to the registers and that activation records take too long to create©
Passing by reference© In order to pass values by reference in Java,
You obviously have no idea how java works© Changing values passed into a method is not OO practice, and should be discouraged©
And since your entire Java code is likely to be in one class
Oh no©©© Please don't code anywhere near my app© I hope all your C code isn't in one file©
Why are there integer and Integer? double and Double?
to avoid something like this:
Java is not pure Object Oriented
©©©and C++ is? You can write completely not OO c++© Try making one java program without defining at least one class©
HAVE TO use them both just shows that it's a horrible class library
Oh yeah, you have ints, and that negates all of the other objects in the class library©©© Come on© Java has one of the most useful class libraries of any language© Let's say the fact that you have to use ints might be a little sloppy© Dont' negate the class library though© It also saves you from oh, overriding the shift operator to become an io operator ¥"<<" a la C++©
is NOT cross-platform
I've had no problems developing in Linux and moving my executables to solaris or NT©
Some versions of Java crash when you ASK THEM WHAT VERSION THEY ARE!!!
This is a low blow© In RedHat 7©0, the vm was broken due to the new C libraries© RedHat shipped the wrong VM, yet it's somehow the language's fault that it didn't dynamically re-compile itself©
Java is a very nice, high-level language; while it may not be suitable for beginners, it provides a lot of things that make it useful to people who want to get things done in business©
"This is not a company that appears to be bothered by ethical boundaries."
Attorney General Mike Hatch on Microsoft
Ok... let's all calm down here. You stated repeatedly that you started out in BASIC then to PASCAL...etc. Your code snippets show that. Your function getNameAndAge(&name,&age) demonstrates poor cohesion (cohesion is the amount a method or object makes sense). Why should name and age be tied together? You could just have easily called it GetNameAndAgeAndAddressAndZipAndState(&name,&age,& address,&zip,&state);
Where do you stop?
You should have a Person object with accessor and mutator (get and set) methods for all its class-level variables.
I actually had to change some of my code, when switching Java Servlets from platform to platform - Vector.add doesn't work in Tomcat, apparently... It's Vector.addElement
You were developing on a 1.2 virtual machine and moved it to a 1.1 virtual machine.
Other than this, you make some sense. However, I think your argument is fundamentally flawed. Universities teach Computer Science, and they will continue to do so. You want them to teach raw programming, and I believe they would be derelict in their duties if they did. My computer science education taught me how to "Program". They taught me the fundamental concepts that most programming languages share. These concepts won't change for a long time. The language they use might, but the concepts stay constant. I learned pascal,modula-2, SPARC assembler, C, C++ and Java. I believe that if you want to train a bunch of Coders in a Trade School type setting, then by all means, teach C or C++. If you want to teach concepts of OO in a University, use Java. That way, the student can learn about encapsulation without fighting memory management and pointers. A University should also offer courses about memory management and lower level things, but Beginning students should not be exposed to that.
"This is not a company that appears to be bothered by ethical boundaries."
Attorney General Mike Hatch on Microsoft
University of Rochester appears to be using it for their starting language (Rochester, NY) I think it's a great place to start- the results are a lot easier to see then with C++,and it's a little simpler. It's just a friendlier language.
I agree that C is good as a first language, for exactly the reasons you stated. However, for an *object oriented* language, I believe LPC is an excelent layout, and really gives coders the "feel" of objects. C++ and Java really fail in their use of objects, in comparison.
;)
As to your term "garbage spewing", well, this obviously shows you have never used LPC. LPC actually is generally very memory-streamlined (since big muds have sooo much text and code to load at any given time). Garbage collection is left to the library - most libraries do object-level garbage collection, but not all, and it is quite simple to disable.
Using terms like "garbage spewing" also convey just the opposite feel of the language. It is *incredibly* coder friendly (thus, making it not a good choice for a first language, but a good choice for a first object-oriented language). It... quite simply, lets you do what you want to do, without making you do time-consuming workarounds. Think of the amount of time it would take to, in C++ or Java, do a switch on arbitrary objects from a handle a string-indexed hash table. In LPC, its one line of code
- Rei
P.S. - anyone know of a project to extend LPC to be a full-featured development environment? I.e., be able to attach a *graphical* description to each object, and to be able to handle visual input and output?
You know when it's okay to shout fire in a crowded theatre? When it's on fire.
Ah, I apologize too :) I didn't realize it was a technical term (I've never programmed in Perl, though I've been meaning to learn it). Glad we cleared this up :)
:)
I still feel that, for a first OOP language, its ok to be nice to the coder. They've already learned your basic language syntaxes, all of the little early "gotcha!"'s. Object "gotcha"'s differ with each language, as a general rule; in my experience, there weren't too many things you have to learn to deal with (such as '=' vs '==', pointers, threads, etc) that were the same across different object-based languages. So, I feel its ok to be nice to a coder for their first OOP course, so they can get the understanding of how to set up the interactions in a nice object-oriented design. But, its just my feeling
- Rei
P.S. - I've never used Lisp before, but I've used scheme, and I've heard they're similar. How close are they?
You know when it's okay to shout fire in a crowded theatre? When it's on fire.
That's not a switch. And its a lot more code.
- Rei
You know when it's okay to shout fire in a crowded theatre? When it's on fire.
Of all of the languages I have ever had the pleasure of using, none had such a beautiful object-oriented design philosophy as LPC (nor was as fun!).
;) ). For example, strings are basic types. You can do a switch statement on a string, and have string cases. You can do a switch statement on an object. You can use a 'mixed' variable type. A mixed could look like this:
;) And, with the power of the language, you could have incredibly adept functional elements at the same time as the interactive visual elements.
;) ). Then, I'd clone an object into their inventory which would prevent them from acting at all (or, perhaps, leave them the ability to scream or something, perhaps even changing their words ;) ) (ahhh, word filters were fun ;) ). I had my Star Wars dest, dests that were parodies of other people's dests... I always liked Blizzard's "Pulp Fiction" dest, though ;) Oy, that place was fun. Sometimes when I was bored, I'd destroy the main posting board, set myself to look like it ("7th Sign Wizard's Main Board says: What are you looking at?"). heheheeee..
For those unfamiliar with LPC, it was initially designed for use in MUDs - as such, it is missing many of the non-text interface and output features needed for a full featured modern language. However, what it had was so beautiful. There was one type of object variable - object. All objects can talk to each other, call whatever functions they want on each other, etc, just by obname->do_something(). You can even call functions on not-yet-loaded objects, by doing things like ("path/filename")->do_something(). You can call functions like FindObject to get the objects of a certain type. You can run through a list of all objects. Etc.
LPC is based on the principle of letting the programmer do whatever they want (I know, some people don't like this
mixed blee = { some_int, some_string, { some object, {some_object, some_bool }, some_float pointer, some_object }, some_object pointer };
It basicly acts as a struct you don't have to declare in advance (of course, you can still use structs to your heart's content). So, for example, if you just wanted to store a complex value, you could use a mixed of { some_double, some_other_double }, at any time.
Then, there's mappings. Mappings are a built in, arbitrary-formatted hash table that is an internal datatype. For example, you could have (and I may not be remembering the format exactly):
mapping blee = [ "foo" : 1.5, "bar" : 8.2 ];
Etc. (naturally, you can use mixeds, objects, whatever, as your indexes and values.
Most LPC libraries are designed to give objects a (text-based) visual representation. You give them a name, a description, a short description, etc. Objects are created in a virtual environment, and you can see them - hold them, place them inside other objects, etc. An object can talk to its environment (what it is inside), or anything in its inventory. A coder can manually call functions on various objects, or set up interface elements for them to be called at any time, not nessisarily by a coder. This visual environment, and "existance" within the code, leads for incredibly fun code wars, like you wouldn't believe
For example, I was the loki-type character coding on a mud once. At one point, I had fun by calling functions that would change the name of people's character-objects around, so that they'd be confused when talking to each other. Naturally, they'd seek retribution and fire off a dest, once they found out it was me (a 'dest' is a piece of code that artfully kicks someone off the mud). But, once I got to know other people's dests, I set up protective objects which would fire off counter-dests when I saw their dests start to go off. So, instant dests started becoming popular. So, I set up objects which propogated themselves into other coders's inventories and would filter out their commands. Instead of instant dests, to maintain artfullness while still preventing them from counter-desting, my dests first cleaned out their inventory and the inventory of the object (room) they were in, to wipe out all local protective objects (sometimes they'd mess with global commands, but well, if they did that they deserved to win
Ok, sorry, I got sidetracked. But... LPC is a fun language, and has the best object-oriented design I've ever dealt with. Its a good language "for love of the code".
- Rei
You know when it's okay to shout fire in a crowded theatre? When it's on fire.
I have never programmed in LPC, and my ignorance was clear. However, I think that my point is valid. A language that is *incredibly* coder friendly may be more of a hinderence to teaching the basics of object oriented coding than a benefit. Learn OOP on a language that still puts most of the work on the programmer, like C++ -- because I think that OOP should start while some of the basics are still not set in, and therefore my favorite choice for OOP -- Lisp -- shouldn't be used either (because Lisp is also too friendly and so doesn't offer the same lessons in stupidity). Maybe as a second or third course. Then, show off the power of OOP by using a language that does have automatic garbage collection, anonymous objects, good polymorphism (Javascript, IIRC, allows you to call myobject->myfunction() without shitting on you if myfunction isn't a member of myobject), and other features.
Network Security: It always comes down to a big guy with a gun.
I've used the Database library object for Perl for a mySQL database before. That was really sweet (hash table rowsets are great), but it still wasn't as user friendly as the ADO library for Visual Basic. Has anyone used a friendly DB library (I don't care which language) that they can compare to VB+ADO? And no, straight SQL is not the way to go for most applications, and if it were, almost any DB library would do then.
To move back on topic, I took a CS course that used VB (and pascal, and C) in high-school. I thought that it was wonderful. Having the IDE handle the binding of GUI objects to code events was fantastic... for me to poop on! Seriously, while it gave me a great sense of accomplishment to create GUI applications so fast, I didn't learn ANY fundamentals of programming... Unless click, copy, and past are programming fundamentals.
Network Security: It always comes down to a big guy with a gun.
With C, being so close to the hardware, it is often easy to see which calls waste the most time. It is easy to see where memory is allocated and deallocated. It is easy to find "beginner" mistakes.
if (x=5)
always seems to execute. WHY? These things allow students to make a mistake that can be learned from. A student should NEVER learn Perl as a first langauge. Why? Because even the shittiest of code seems to "do what it should." That is no way to learn the basics. CS courses are not designed to teach one language and then send students off into the work force. Chosing a language like Java seems to support that mentality, though. What happens when a CS student who learned on Java tries to get a job programming C on embedded systems? There are many pressing reasons to learn Java, C++, and Perl at some point durring the CS curriculum, but why start with one of those and then drop down to the less expressive languages like 68K assembly and C?
I see the reason not to start with something like 68K assembly: too frusterating for a first langauge. But C has some wonderful compiler warnings (assignment in a comparison statement generated compiler warnings when I was taking a C class) and syntax rules that are easy to fix and not too forgiving as to teach bad programming habits.
Besides, there is a lot of history and lore to be learned when taking entry level CS courses, and Java just doesn't have the history behind it to make it for those purposes. No "and this was the logical error that caused a whole sewage processing plant to shut down. So remember those break statements."
Network Security: It always comes down to a big guy with a gun.
1st term (semester): Functional programming language + some MIPS assembler.
Teaches that there's more than one way to do it, and makes even experienced coders expand their horizons
2nd term: C++ / OO concepts
Teaches pointers, some low level stuff. Gives an appreciation that an object is only really a chunk of memory like any other.
From then on Java:
This was never formally taught from the ground up, just the differences pointed out.
The advantages of java pedagogically (sp?) are that
a) Its great for teaching concurrency
b) Swing, although sucky in implementation has a very well engineered API
c) Allows easy exploration of sockets, distributed systems
d) Allows easy exploration of design patterns without to much bother of C++ idioms.
The other thing is that the year after me they switched the order & taught Java before C++. Most students became pathologically afraid of pointers and mem management and failed to 'get the point' if Java can do it anyway.
WHich language you use is totally irrelevant. Teaching programming using Java or C++ of Visual Basic, it's all the same. If you don't understand that the language is not teaching you how to program, but the teacher, you'll also not understand that the question if Java or C/C++ should be the language of choice is irrelevant and in fact, stupid. Yeah, stupid, since asking that question shows you don't understand what programming really is...
--
Never underestimate the relief of true separation of Religion and State.
I'm thinking +1 Unconventional. The parent of this post certainly shouldn't have been moderated Funny.
For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
I think that the question of what language to use in an introductory course depends critically on who you expect to be teaching. A lot of people here are suggesting that the first language taught should be a comparatively low level language in order to introduce students to low level concepts as early as possible.
That's great if you're primarily interested in teaching computer scientists, but that's not necessarily the case. Many people- and I might even venture to suggest that it's the vast majority- of people who want/need to learn prgramming concepts are not going into a pure computing career. Instead they're going into business, the sciences, or the arts and need to learn enough programming that they are not completely dependent on CS professionals to get their jobs done. There's a real need for an introductory programming course for non-CS students that teaches very basic programming concepts- data structures, algorithms, etc. Languages like Java, Python, and the like are very appropriate for that sort of introductory class specifically because they do free the programmer from worrying about low level functions so that they can focus on high level concepts.
There's no point in questioning authority if you aren't going to listen to the answers.
However, we should look at a few requirements for a good teaching language:
Programming is hard! A teaching language should not be unnecessary difficult. This, IMHO pretty much rules out C++ and Perl. Not that those languages doesn't have their place in the real world (they certainly do), but their complexity distracts from the purpose of learning to program well first. It should be simple to make a simple program to experiment with ideas (hello world line count is not such a bad measure). A top-level interactive loop helps this further, but equally good is a fast compiler and a good development environment. Languages that are simple to learn would at least include Pascal and it's cousins, most scripting languages, as well as various lisp-dialects
Students want instant gratification. This can mean different things to different people, personally I was instantly gratified when I learnt C and later assembly language. It made me understand more of how the machine really worked, and gave me an opportunity to actually improve on something (e.g. a faster strcpy than the one in libc) without really putting too much effort in it. Programming simple games and animations, usable GUI's and so on is also something than can be very rewarding for a fresh programmer, provided the language facilities for this are easy to use. So put in logo, Visual Basic (I've never really learned the language, but it doesn't seem to be as bad as people will have it), Tcl/Tk, Postscript and others as well.
Good software engineering skills should be taught from the start! Therefore it's important to have a language that supports at least reasonable levels of modularization. Java fits this category well, as does Python, but also many others, such as Common Lisp, Eiffel, Ada, and SmallTalk.
Depending on what direction the students are going in later, it might be a good idea to introduce some advanced concepts early. For the EE direction, more low-level languages might be better, such as Forth, C, or assembler. But eventually, everyone should know something low-level stuff so it could be done by everyone.
For the same reason, Haskell and other functional languages (such as scheme, although it really isn't functional) is popular among CS people The value of choosing a CS-oriented language (most functional and logic-programming languages will do) are that they pave the way for understanding more advanced concepts later, such as term-rewriting, parsing theory, the value of trees, and of course recursion. I would really believe that a student who only knew Haskell would most likely know more about how to build a compiler than one who only knew C, as there are more advanced concepts gained simply by choosing a more CS-directed language.
Market and bragging value is important for ambitious young boys (although perhaps not for girls, who usually accept that they are there in order to learn, and don't think they know more than their professor). I would believe most students would be pretty alienated by finding out that their first programming language is a weird ivory-tower programming language that nobody except in academia uses, and that has little in common with C++ or Java (which their friends uses, and there are ads in the papers for programmers). So unless you really want to limit your audience, your language should be somewhat mainstream.
To summarize, I have tried to tabulate some languages below on various categories from 1 to 6. Note that this is highly subjective, and most people would probably not agree, but at least they summarize how I feel about them. The categories are (in this order): EasyToLearn, InstantGratification, EnginerringSkills, HowItWorks, CS-skills, and Bragging (unfortunately /. doesn't allow tables).
Java: 4 4 6 3 4 6, total: 27
C: 2 5 3 6 1 5, total: 22
C++: 1 2 3 5 6, total: 17
Perl: 1 5 2 1 1 6, total: 16
Haskell: 2 3 6 1 6 1, total: 19
Forth: 3 3 1 6 4 1, total: 18
Postscript: 5 6 1 1 3 3, total: 19
Common Lisp: 4 4 6 2 6 1, total: 23
Scheme: 6 4 4 2 6 1, total: 23
Python: 6 6 6 1 4 4, total: 27
Logo: 6 6 4 1 4 1, total: 20
Pascal (or cousins): 6 4 4 5 3 3, total: 25
SmallTalk: 6 5 6 2 5 3, total: 27
Assembler: 4 3 2 6 2 6, total: 23
Well, I guess the winners are Java, Python and SmallTalk (on the other hand, the differences between all the languages here are so small that all would make good teaching languages, depending on how you weight the factors). Java is a relatively good all-round teaching language whereas most others seems to lack something (a 1 or a 2) in at least one of the "requirements".
MIT and Berkeley were pretty well known for using Scheme as an intro computing language. It gives a pretty easy transition into computuational issues and if you "get it", you learn powerful metaphors which can be implemented in many many languages. For O-O, I think Smalltalk (or right now Squeak) are utterly appropriate. For the same reason -- you get used to metaprogramming concepts, and Smalltalk's probably the best environment I've seen where you really grasp the implications of the concept -- "everything is an object." Java, C, COBOL, and C++ are industrial languages -- they were designed with industrial tradeoffs which have nothing to do with educational forces. I've got a huge problem with treating CS programs like job training: if you want Java for a resume, go to a Sun training class. In SF there are "learn IT in 3 weeks!" posters in bathrooms. Blah.
A few European Universities use Oberon - it's a nice language to learn programming. More at http://www.oberon.ethz.ch
... you are spending time at school not for learning somewhat that will become old in a decade or less (or more, it depends ;-P). I find it more important that you can learn how to build complex and correct algorithms in each situation. For example, once you've learned how to implement an AVL Tree, well ... I do not find it too difficult to implement something similar on other languages. After all, you have book for this (reference manuals of different languages, I mean). In every modern programming language you have similar structures. So, if someone wants to teach Java, or C++, or Oberon... i really don't care, it just matters that the language is modern.
Bye
-hornet
Is it really so difficult to switch between different languages? C'mon
I agree with you - didn't read your message first, I posted something similar here below (about Oberon) [don't post as anonymous coward, some messages have to be moderated up! :-)))]
:-)
:-)
IMHO., I am at ETH too, and Oberon-2 is nice
Bye
-hornet
p.s.: hey guys, moderate this up
There was a thread about this on the UW undergrad newsgroup a while back. It consistend of the students yelling WTF?! and the administration keeping mum.
The worst part about this isn't that Java is used as an intro OO language. The problem is that Java will filter in to later classes. Data structures will naturally be done in Java, as the language is perfect for it and all the students will know it. Suddenly a student's first exposure to C/C++ will be in a 400 level class like networks or OS. Some will be doomed to learn C and re-write the TCP stack at the same time.
Not pretty.
"Faith strikes me as intellectual laziness." -Robert A. Heinlen
That sounds like a fair and balanced approach. Here at NYU (where I just finished my Junior year), the core CS curriculum is four semesters: 101 - Intro to Programming (Java), usually skipped 102 - Data Structures (Java) 201 - Assembler 202 - Operating Systems (C++) Thus, a suitable language is used for each task.
Well, not everyone is applying for a position at your company. Not saying it's bad to know both (I'm fluent with both, and have eventually learnt to almost like C++ again), just that YMM definitely V, depending on what the company is doing. My last job was mostly C, some C++; knowing Java was pretty useless; at my current job it's vice versa. And both jobs are/were interesting and challenging.
I like paying taxes. With them I buy civilization -- Oliver Wendell Holmes
The school I am attending used assembler to introduce students to the wonders of computing. The class size dropped from 120 students to 60. The school then proceeded to teach COBOL and CICS arguing that "It has the most user licenses".
I agree that smalltalk should be the first language covered in a four year college level CS or Comp Eng track. It was designed to show how OO would work.
I also think that CS majors should be exposed to most of the languages that have been used through the ages. FORTRAN, BASIC, Pascal and the like will give perspective on what they are supposed to learn. The amount and timing of that exposure is certainly debatable.
I know that a historical perspective on why core files are called core certainly indicated opened my eyes to how there is hard to get rid of cruft even in a fast paced young disipline like computer science.
If the question is focused on a highschool AP class, then it's entirely different. The emphasis should cover the broad themes of computer science:
A. critical concepts like algorithm, mathematical logic, and design;
B. application areas familiar to HS students such as computer generated graphics;
I think you have a slightly wrong idea of what AP Computer scienc in high school is. As tudent finishing an AP class in hoigh school and doing well on the test is given college credit for that course. An AP computer science course is expected to replace Computer science 101 or whatever the university calls it's freshman computer science for computer science majors course. It must be designed around the same concepts.
I don't need a million points of light, just two points of multi-mode fiber and a 10 Gig-E router.
When I learned to read, I didn't start by memorizing oral poetry, and get to actual books after three years.
You didn't? I did. Or something close to it. I learned to read by memorizing the stories my parents read to me. Then I would "read" (actually recite) them to myself. Eventually when i had enough books memorized and recited them to myslef while following the words, I realized what words were what writing. Most peolple don't learn to read that way though... they learn simple stuff: letters, then build to words, then sentences... Similarly Computer science should start with simple stuff, then move on.
When I learned chemistry, I didn't start with colossal proteins, and wait for the third year before I found out about the periodic table.
Exactly, you learned simple stuff: "Here is a table of elements.. elements are whole in and of themselves. They are ALWAY like this". You're confusing your metaphor here and validating my point. Chemistry is taught from the simple(elements) to the complex (molecules).
When I learned about literature, I didn't start with 20th century authors and work backwards to Virgil and then Homer.
This is apples and oragnes. Literature is non linear, and is not taught in a linear way. It's assumed you know the easy stuff (grammer, poetical construction, etc) and are now learning how certain great writers applied them. You can teach lit in any order, The works of Plato are no less worthwhile or important than the works of Tolkien, nor vice versa
Why is CS being taught backwards? CS is taught in universities, to a group of students with sufficient background to understand Gödel and set theory. Why don't we start CS with Turing, and get to OO programming at the end?
What makes you think they have that background? A Comp Sci major in college might never have written a program. University programs as a rule assume that a student has a generalist background when they start (at least in the US), it's not like grad school where the Uni can look and see what the student did his/her bachelors work in.It is valuable for programmers to understand the basic logical structures upon which the computer operates. These are interesting and would succesfully weed out the tourists. The truth is that most of the people who are entering CS programs these days are doing so because they think that "computers are full of lots of wires and stuff; and oh, yeah, a future" (quotation from an actual public transit ad that I saw a while ago).
Coding has become something like medicine and law: a career worth entering into just for the money. I am not profesionally connected with computer programming, so I can afford to be a bit of a purist on this issue. To tell you the truth, though, this is not a job market that will remain staggeringly profitable for any particularly long amount of time. Um, I have to admit that I find that kind of funny.
Yes, it is valuable for a programmer to know those things, and they are very appropriate to an upper level class. Why the hostility to people entering the field for money? I'm sure many execllent doctors and lawyers originally entered their fields for money. Eventually they found that they were good and enjoyed the work as well. If a student enters a CS program dreaming of easy money, they will be awakened. There is no need to deliberatly turn the programs into a torture test to "weed out" students. Today's "tourist" might be tomorrow's Turing. (Man, I've beem reduced to bad puns. It's time to stop now.)
I don't need a million points of light, just two points of multi-mode fiber and a 10 Gig-E router.
I think the question here is this: Should we start by teaching an easier, higher level language (ie Java) to get programming concepts down, then move to lower level "closer to the machine" language for advanced topics, or should we start with the lower level language and then treat additional languages as extras?
Personally I think the first option is the more viable. Java is a fairly easy, very portable language on which students can create fairly elaborate programs somewhat quickly. With the Swing classes, one can create GUI based programs that will run almost anywhere after probably less that a semester of learning. Java has all the necesary pieces of a fully functional OO language, and it spells them out in a very easy to understand way. It also enforces compartmentalization. I remeber as a freshman, one of the most frustratin things about the way CS was taught was that none of the programs we wrote seemed "real". The assignments were written to develop skills in algorithm analysis and to point out uses of specific structures, but they always looked like a home work assignment, not a useful piece of software. With Java (or hell, even an interpruted language, like Perl or Python) I think the same skills could have been taught while allowing for more... err.. Satisfying .. assignments.
Once the basics of programmiing and software development were learned (and I don't know about anyone else, but my Uni spent most of the first year, and a chunck of the second on these skills. learning "how the computer works at the lowest level" was Sophmore and above classes) C would certainly be appropriate to tech as a lower level "how the machine thinks" langauge. Our low level systems classes were taught in Vax assembler (I never actually learned C in collage, we used Pascal as the teaching langauge, them SmallTalk and assembler in later classes), and I'd have found C both easier and more useful in "real life".
I don't need a million points of light, just two points of multi-mode fiber and a 10 Gig-E router.
Back in the day, you learned machine code. Or assembly code, which I believe is the next layer up. Then everyone started learning C.
I think it's time to start learning something above C, something OOP. Java is the first choice cause, well... it's the first thing that comes to mind. Python would be another example, but Java lets you make more programs in the typical "I wanna add shiny GUIs to my windows app" sense of a program. C? C++? I can't speak for C++ as I don't know anything about it, but my (laymen) understanding is that C doesnt do object oriented stuff, and C++ does, but the learning curve is steeper than Java. So...
Seeing that (laymen!) a lot of this stuff seems to happen automatically now (memory allocation, et cetera) and that we've built these routines... let's move the next layer up.
See, eventually... we'll write programs in regular old English. It'll take forever to get there, but that's how I envision programming developing, as a person who "gets the basic idea, kinda".
So much for brevity. Hey, someone reply with some official names for those different layers I am referring to.
slashdot: where everyone yells sarcastic metaphors to themselves to understand the issue
slashdot: where everyone yells sarcastic metaphors to themselves to understand the issue
- Java can be used on the web (ooh ahh).
- It is object oriented, even if clunky and weird
- More "user friendly", but many people would debate if thats a good thing, I mean Unix isn't exactly user friendly.
Anyway we then go on to take C++ on the next course, and use that in most classes down the line. So people who just take the intro can get a nice feel of applets and coding in a fairly simple, if weak, programming language. Now I dont really agree with the industry standard of using C++, and I wish that a functional programming language was a required course, but many people seem to like C++. (let me just say that its syntax can be quite frustrating at times, I mean how many different ways can you use the ampersand?) anyway thats just my two cents.I agree completely. I've long thought that Smalltalk should be the first computer language taught for three reasons:
1. It's a very clean and succinct language that allows developers to focus on core design issues, not idiosyncratic implementation ones.
2. The Smalltalk environment (class hierarchy & GUI framework) is a wealth of terrific design patterns that are used in most other GUI frameworks. Practically every good idea in other frameworks (Swing, JGL, Collections API, etc) comes straight from the Smalltalk environment.
3. It makes you use OO & design patterns. There's no way around it in Smalltalk. The flexibility of the environment (incremental compiles) fosters the habit of constant refactoring, which is extremely valuable.
As for the comment above about using C so that beginners become aware of hardware issures, I strongly, strongly disagree. I'd much rather have a developer who can think in objects from the get-go, who has the discipline to constantly refactor specific classes into a generally useable ones, who uses design patterns. In my experience, developers who focus primarily on issues like optimizing memory tend to cloud up the code and lose the "design forest" for the trees.
Another question is: is Smalltalk too advanced for a college freshman? I don't think so, unless the college freshman spent his high school years coding in C or VB. The largest part of the Smalltalk learning curve is *unlearning* the procedural mindset.
However, if you want to teach them ideas, and techniques, and how to think critically about computing problems, languages like Lisp and Scheme are the way to go. Impractical? Most students feel that way. After all, how many companies out there want people who can write in Lisp? It pays off in the long run, though. Lisp and Scheme have minimal syntax, but allow you to express complex ideas. You can spend more time on teaching computer science fundamentals and less time on syntax. This pays off when then students learn C++, or Java, or Perl. They are capable of learning the syntax in the context of "doing it right," rather than just in the context of "getting the damn thing to compile."
Now, to further complicate the issue. C should be taught before C++/Java. Learn syntax, structure building, and clean programming practices. Then teach C++/Java in the context of OO Design and Design Patterns. After all, those areas are where C++/Java shine, so the languages should be taught in that context to prevent the formation of bad habits (more so in C++ than in Java).
The main problem with my philosopy is that it takes planning and discipline to implement it. Most people are too short sighted to handle it. I was lucky. For the most part I took the path described above. It lead me to a lead developer position in a research and development firm. I feel like my work is (mostly) effortless, yet I constantly amaze people with what I produce.
Two cents; take it or leave it.
The middle mind speaks!
i disagree! i think the von neumann architecture is certainly fundamental, and worth studying in detail, but i think it is doing students a great disservice to educate them with that as the starting point. what about logic? what about the lambda calculus? what about mathematical computablility? what about type theory? object theory? another example: most people who program today faced concurrency as an afterthought, as an unfortunately ugly beast that they dealt with only when forced to... how much better would we all be at concurrency if we had dealt with it as a fundamental conceptural part of programming from the very beginning? and how many major software projects today can ignore concurrency? i think these are the fundamentals that sould be taught in an ap c.s. course.
most students taking such a course in high school can already write passable code in one or more languages. arm them with the concepts behind programming, and you're giving them a much stronger edge for further education, as well as introducing them to a far more widely applicable mode of thinking about computation.
however, i don't think that java is the right choice for illustrating those fundamentals, either. i'm not sure what is. if i were forced to choose, i would go with a modern functional language like standard ml or haskell.
all that said, obviously the whole point of ap classes in high school is to prepare the students for some kind of standard ap test, so the curriculum can only be chosen by the school within a very fixed set of margins... i'm not sure what organization actually decides the content of ap curricula, but i'm sure some astute reader does...
I think Scheme is a wonderful general-purpose language. I also think it's great for learning. It's abstract, flexible, and powerful. As for not using it on the job... well, I've used it once or twice for "serious work". :) Then again, I've got a bit of leeway in some areas of my work. These days, however, trendy languages that are likely to be used by employers are the languages that are taught in class.
N4st0r, trixx0r h0bb1tz0rz! Th3y st0l3 0ur pr3c10uzz!
Scheme and Lisp support macros, but they're a bit different than the C preprocessor. A macro in a Lispy language is an expression that gets evaluated, and the result is an expression that gets evaluated again to give your final answer. It's quite powerful, actually, as it allows you to extend the language inline.
Lisp and Scheme are not really heavy wizardry, unlike hacking DSPs on the bare metal. It requires a different, abstract mode of thought, almost like that of an artist. (Please, no K5-esque "code-is-art" debates). Once you understand how these languages work, they are literally a snap to use. Students don't get bogged down in syntax because there is no syntax to speak of, except that whatever is in parentheses represents a function and its arguments. The read-eval-print loop enables students to talk to the computer, and see the results of their experimentation immediately. The functional and recursive approach lets you see with crystalline clarity the proper way to analyze the problem you're solving. (This translates well to other languages, by the way, even icky things like Visual Basic.)
In order to learn programming, you need to dig through all the design cruft and really understand the principles behind solving problems with a computer. Once this is done, that knowledge carries over into every programming language out there.
N4st0r, trixx0r h0bb1tz0rz! Th3y st0l3 0ur pr3c10uzz!
Stick with one language all year? Why even study computer science?
Sam Coskey
I was taught Scheme in my first real CS class, but I learned BASIC and C on my own long before. A lot of code people will end up working on will either be stupid VB or legacy C.
Anyway, I thought Scheme was good because it's very abstract -- it's based around mathematics and (to a certain extent) symbolic logic. It's also really, really simple: (cmd1 arg1 (cmd2 arg2 arg3) arg4), and so forth. Never in Scheme did I see something and think, "Well, that's counter intuitive." After Scheme I recommend going with real-world choices -- C and C++. I've never taken Java as a serious option, because it feels to distant from the computer.
Mike Greenberg
http://www.yourmothernaked.com
When I started out at the University of Michigan, Ann Arbor (2 years ago, I'm a junior now), we had a class called "Introduction to Computer Engineering (EECS100)". This class started off with LC2 (the "little computer 2": a simple, made-up processor) machine and assembly language, and progressed to C. When writing our first C programs, we also had to convert them to LC2 assembly language. This class gave us a *great* introduction to computer science; now even those who came into the University knowing nothing had a pretty good grasp of how programming languages work. This class is quickly followed by EECS 280, a C++ class, that taught higher-level programming.
I think this is a great way of doing things. It's my opinion that if CS/CE students do not grasp the fundamental nature of languages at an early stage, their learning in the future will be inhibited. Donald Knuth says, in "The Art of Computer Programming", something close to "Anyone who has more than a casual intrest in computers should learn an assembly language for at least one machine".
The thing that convinced me of the above point was the fact that later on, in EECS380 (an algorithms class), the students who had taken EECS100 instead of the new watered-down equivalent (EECS180, Intro to C++) were always at the top of the code execution speed rankings (with few exceptions).
Unfortunately, EECS100 was removed from the curriculum as of this upcoming year; too many students were failing (sometimes around 40%). Though I think that it is a good thing to weed out those who don't breathe computers (it gets rid of the students who are in it just for the money), the UM CE department thought that this was discouraging to beginning students.
Mike Feldkamp
Programmer, All Media Guide (http://www.allmediaguide.com)
Remove the stars to email me:
m*i*k*e*f*e*l*d*@*e*n*g*i*n*.*u*m*i*c*h*.*e*d*u
I am an assistant at a university in Europe. :).
Today we teach mainly Java for CS. So, basic courses about algorithms and data structures a taught in Java.
But then we have a mandatory system programming course, where the students must have a deep look at the sparc processor and have to learn it's assembly.
Another mandatory lesson teaches some basic of the different programming language styles (imperative, logic, functional): there we use Eiffel, Prolog and SML.
I must say this leads to a student being aware of many thing, maybe the real problem is that they don't have a deep knowledge of any of these languages.
Lately I have been playing with Python, and in my opinion it should be a great choice for people learning to program for the first time.
Personally I would also advocate for the use of a bit of C in some course, just to give the students an idea of the real world
It has uncertain semantics (Deep copy vs shallow copy)
It encourages inneficient coding style. (memory bloat)
It introduces object-oriented concepts. A beginner who doesnt understand procedures and data structures yet isnt ready for that.
It is not useful as a foundation from which to learn other languages.
Otherwise I think its a fine language, I just dont think its most approprite for learning.
C or Assembly should be studied first, to understand how to relate an algorithm to a machine. You cannot understand what java really does if its the only language you know.
Speaking as a student that was introduced to OOP through Eiffel, I must say that CS students at my school were very happy when they switched over to Java as the language of choice for introducing freshmen to CS.
I would be interested to see any comments by students from RIT who went through those trials.
---Lane
What's the point of moderating?!
--I decided around Java 1.0 that I was going to learn to program with Java.
--I bought some books and began failing miserably almost immediately. In one of the books it said something like "If you know Visual Basic, you'll get this."
--Back to the book store I went got some VB5 books and did fairly well with them. Then I started reading about this wonderful thing called Perl. I still have Learn to program Java in 24 seconds and Mastering Java and both look like new.
--I would recommend Python or for the brave at heart Perl as a 1st language. But really Python.
---
This
Object oriented language shouldn't be the first one to teach. OO thinking is quite hard to learn if we for example compare to functional. C is better choise, and some knowledge of C is really handy when learnig Java. With Java you can make some REALLY slow code, and knowing some lower lever programming language helps you to avoid these traps. Worst thing in C is that many students have made some software with that before entering course, so people participating are in inequal position. Noticed that there were quite many comments here about Scheme. It's syntax is amazingly simple, and it for example hasn't got any loop commands, so everything has to be implemented by yourself. Iteration, recursion and also streams really come very familiar to you, and it even has some OO like things(noticed this later - hell, didn't even know what OO ment when I took the course). With Scheme you can do some amazing stuff that wouldn't be possible with C and Java. People that hadn't done any code before the course were hacking Scheme interpreter which was made using... Scheme!
Teaching about computers or programming shouldn't be about what language makes you feel good inside or what language is cool to like when you're trying to be a part of the slashdot (or any other) crowd.
There are different uses for different languages. There's no one perfect or best language.
If we are trying to teach the inner workings of a computer then assembly is the best bet.
If we are trying to teach programming languages then we should teach a variety of languages as examples of different types of languages and different language properties:
Imperative languages:
e.g. C, Perl
Functional languages:
e.g. ML, Lisp
Object-Oriented languages:
e.g. Smalltalk, Java
Garbage-collected languages:
e.g. Perl, Lisp, Java
etc.
So, java is fine as a teaching language because it can teach about such things as imperative as well as object oriented programming, etc.
Does that mean it should be the only language taught? - No.
Does that mean that java is some perfect language? - No. The fact is, java's problems aren't because it's not the fastest language (it's plenty fast for many applications), or because it is garbage-collected as many people have posted -- it's problems/annoyances are properties such as covariant arrays, lack of F-bounded polymorphism, invariant arg and return types for methods, lack of pattern matching, etc.
In fact, any language's shortcomings can be used as a teaching tool as well.
Worry more about variety of languages, not specific languages.
Back in 1983, my intro CS course used APL. Believe it or not, it was a wonderful introduction, and, thanks to the power and concision of APL's operators and the internal coherence of APL's way of looking at problems, it achieved something quite easily that would be much harder to do with most other languages -- demonstrate that a computer language is, among other things, a way of thinking and a mode of expression, capable of eloquence and wit, where the idionatic combination of words (operators/functions, what have you) can enable one to express a kaleidoscopic array (I suppose I should say "vector") of concepts. It impressed on me strongly the magical beauty of computer programming that is so much a part of its appeal.
Now, granted, APL is probably a terrible introductory language in other respects -- no argument needed here -- but it had the advantage of having a strong point of view, and the experience of inhabiting that Weltanschauung was intoxicating for a young romantic programmer (and every young programmer should be romantic! Isn't changing the world a romantic project?). If I were teaching a intro course (which I'm not qualified to do), I would probably use Python; but Python, fantastic though it is, has less intrinsic character -- the programmer has to bring the character to it -- and would not necessarily be inspiring in quite that way. Another tempting possibility would be to take students on a whirlwind course of comparative computer language linguistics -- show them APL, LISP, and C, write a little in each, and concentrate on attaining fluency in Python. Does that sound like a fun semester?
Java = Hyped up language which is pretty much worthless when it comes to real world use.
Sorry guys. But not only is Java a closed standard - but its a hideously over complicated and slow one at that. CS students dont need to be burdened with too many language specifics in those first few months of learning.
As for my schooling - I went to some dipsh*t community college (didnt much care for going to an actual university) - and I remember the introduction to programming class used old VAX Basic (they now use QBasic).
You would be amazed how many people just dropped that class by the end of the term. Not because of the language but because the teacher made it quite clear that if you couldnt grasp BASIC - then you wouldnt be grasping anything else either.
As far as CS is concerned - start working with basic concepts and work your way up. Alot of people on this thread argue that CS students should be learning Assembler as a language FIRST - I disagree completely. While Assembler does have its uses (such as teaching you how your computer actually works) I believe it to be overrated considering the technical environments that exist today.
99% of IT people I meet (yes I know this is sad) wouldn't have a clue what I was talking about if I mentioned the AX register on a processor, IRQs, or DMAs. The IT world today has, to say the least, has become soft. Thats because there is such a demand (except for maybe in the Valley - hehe) for these people - the local colleges are pumping them out like an assembly line with the minimal and most desirable knowledge. (Assembler NOT being on that list for most companies)
But I digress: C or BASIC should be the initial languages learned by CS students. I lean more heavily towards C in this case because alot of the knowledge is easily transplantable into C++ when it comes time to learn Object Oriented stuff - whereas with BASIC - VB's object orientation can leave a bit to be desired at times.
Visual Basic isnt difficult - but it does present more of a transition problem than going to C++ from C. Simply put - not only will you learn some Object Oriented concepts from VB (albeit they are not truly Object Oriented as of yet) - but CS students would be forced to grasp the concepts of Event Based Programming (yes this can be a bit of a bear).
Gam
"Flame at Will"
I love idealists not because I am one, but because they make life bearable for pragmatists such as myself.
the reason the AP people have probably chosen to change to java is that it has so many internet related uses. C++ on the other hand, does not have many at all. They made this decision while the internet was this huge new thing that they thought everone should be in on. Unfortunately, during the delay before the switch, the internet, though going quite strong, has passed its prime. It will continue to go on strong, but with the economic troubles of the IT industry and the country as a whole, the internet is becoming more expensive. The industry is supersaturated with all these "budding" companies. Currently, though java is a useful language, it should not be the basis of programming knowledge. C++ is must more logical, faster to run, and more useful for general purposes.
-"Hey, Baby. It's not a rash, it's textured love."
One point that everyone seems to ignore is that it's possible to write "Java" programs in assembly language as well. There's still an machine code under there (witness the abortive Sun Java processor concept). A couple of years ago I wrote a JVM for a company I worked with, got myself a copy of Sun's "The Java Virtual Machine" and away I went. It's important to know at least one assembly language (even JVM code), just so you start to appreciate the size and performance implications of whatever high level language you're using - lack of that sort of understanding is what gave us Windows and 40Mb word processors. PS. When I was at Uni (Newcastle, England), they taught programming algorithms in Pascal, then moved on to assembler, C++, Miranda/Haskel/Gofer, later. Java hadn't even been invented then. And I wrote my own assembler for the Dragon32 when I was 12, using op-codes taken from the listings in magazines - heady days ;)
+++ BASELINE REALITY FAILURE+++ +++ PLEASE REBOOT UNIVERSE +++
I thought I'd through my two cents in here. At my University we are taught C/C++ in our CS course. Even non computer majors in the engineering department are required to take the introductory level class on C. Anyway, when one of my professors was asked why C/C++ was used as opposed another language he said,"Because if you know C, you can learn many other languages." And that's not just OOP languages.
Personally, I think this is a great reason. Once somebody gets out in the real world, they'll find that many other languages are based on C/C++. In fact, I believe Java is. I've also had one or two occasions where, although I have not known the specific language, I have been able to understand some pieces of code because the language is build around C.
Teaching C just teaches good basic programming skills. If you teach only Java to a student, they'll be great OO programmers. But, what about other languages? How well will they fare if they get out in the job world and are forced to learn a non Object Oriented language?
All my statements don't even take into account the fact that C/C++ is a much more versatile language. Hell, I can't see many advantages that Java has over C. I feel that by teaching Java instead of C, schools and universities are merely serving to handicap their students.
--------------------------------------
If Murphy's Law can go wrong, it will.
First off, let me say I am a supporter of Java as a language and platform. I started with a working knowledge of C before C++ or Java entered the mainstream consciousness, but I found picking up C++ to be troublesome whereas picking up Java was a snap. Then, having a good knowledge of C (for the syntax) and Java (for the OO concepts) making the final transition to C++ was a snap.
Personally, I find these accusations of Java being clunky to be interesting, as I see Java as being more clean and consistent with its class API than what I've seen in C++, and ever time I try to accomplish something that was trivial in Java into C++, I come up against syntactical brick walls. (Okay, I will grant that I don't *know* C++ nearly as deeply as I do Java). In fact, I have a RedHat box at home that is serving various utility services to my two other boxes (one's for the wife running '98), and it is all being done with Java since client/server code is hardly any more difficult that printing "hello world". Speed is not a problem once the virtual machine loads up the classes, and this is what I think most people perceive as slowness. (And it also bears noting that load-up is a bit faster with whatever JRE I have under linux (IBM, IIRC) than with Sun's JRE under windows.
Anyway, I digress. If the course material is mainly about the OO approach to code design, then I would favor Java over C++ just since Java's syntax seems to get less in the way, and thus seems to distract less from the matter at hand. In fact, in less than a week, I am presenting OOP to my fellow engineers (many of them "greybeards" who grew up on FORTRAN), but my presentation is neutral of any language mainly because I don't want implementation details to interfere with the larger picture.
Sure, C++ has more in terms of raw power, but is that the focus of the class? Cool tricks we can do with pointer arithmetic in a double-ended queue? Yes, CS majors should delve all the way into C++ (and or assembler, as some posts are mentioning, if hardware becomes a focus), but for the conceptual differences that OO presents compared to procedural code, Java gets less in the way and leaves more mental resources available to the student.
Most non-US keyboards aren't made for programmers.
If you want a good keyboard for writing code, order a US keyboard.
If you're using a Sun workstation, you might want to check out their "UNIX/C" keyboard.
Another option is the "Happy Hacking Keyboard" from PFU, Inc.
My other first post is car post.
My alma mater made Java the cornerstone language for their CS program. They also eliminated assembly language programming as a graduation requirement. These are both *bad ideas*.
It is *much* easier to learn other languages when you have a background in C++ than in Java. Knowledge of C++ will get you more jobs (and better) than knowledge of Java (however, knowing both is a good thing, too). And, truthfully, dealing with the additional programming issues that C++ introduces will teach you to be an all-around better programmer.
As for ending the assembly language requirement, I'd have to say that, while I don't really program in it anymore, learning assembler was one of the most important things I learned. It taught me to understand how the processor views data.
Not that I'm particularly fond of Smalltalk, but it is a simple language to learn, it's well-connected to its development environment (thus, very, very simple to prototype in), and Object-Oriented at its very core. Java, on the other hand, is much too complex and idiosyncratic for placement as a learning language ... ditto C/C++. I think a more straightforward language benefits the student of OOA&D.
Plus, some of the better CS departments (GATech, etc.) seem to agree. Check out Squeak.
What'dya mean there's no BLINK tag!?
Man, I got that thrown at me, too. Don't get me wrong, FORTRAN has it's place (garbage pail, septic tank, the city dump...kidding), but it's just not terribly relevant to modern software development, except as an historical exercise. I was actually stuck with FORTRAN 77 (in about 95) for a grad-level course on Scientific and Numerical programming I was taking from a local university. Talk about USELESS. I've been a professional developer for 10 years, write component-based (COM/CORBA) code in C++, and have absolutely no FORTRAN tools excepting the GNU stuff. How was I supposed to apply this course?!
I suggest closely reviewing the curriculum of any CS school you might attend. It becomes pretty obvious who's real and who's not.
What'dya mean there's no BLINK tag!?
Also, another common misperception about Java is that you can ignore things like memory. You *can* have memory leaks in Java, they just show up in different ways. I think that a lot of the arguments given here against Java can really be avoided by a dedicated teacher/professor who targets the class at Java - not one who reuses the C++ class and just changes the syntax. Things like hash maps are provided for you, but that doesn't mean that the professor can't make you write one from scratch anyway.
Java is just like any other language - use it well, and it performs well. But, also like any other language, it has its flaws. And those flaws can show up a lot more readily if you teach Java as though it were C++. Teach Java as its own language, and I think it's perfect for teaching.
This is true - but, a couple of thoughts on that: I would argue that most (though certainly not all) programmers are either a) going to be using Java, VB, Perl, or some other higher-level language to write their code -or- b) going to be developing applications for one particular platform. In either case, the specifics of platform architectures are less relevant. And, in any case, I certainly did not learn those things in my intro CS class using C++. Those sort of things popped up later in more advanced classes, if at all.
java provides things that students wont find in other languages.
I would say that this is a good thing ;-) With the (supposed) advent of .NET and the increased popularity of Java, programming is becoming less focused on bits, bytes, and pointers and more on higher-level concepts like design patterns and system architectures. Not that C/C++ will ever go away, I just think that they will become the more specialized case, and languages like Java and Visual Basic 7 and C# will become more dominant, just like assembly moved out of the way for C/C++.
Much of the discussion here has centered on students who are planning to make a career out of CS. However, an Advanced Placement Computer Science class has an entirely different goal:
To prepare high school students for the AP Computer Science test.
The curriculum of any AP class is very strongly dictated by what ETS decides to put on their tests. Of course there are principles to adhere to; of course there will be students who are taking the class out of love for the subject. But if the class is called "AP Computer Science," then it is a disservice to the student if the class is anything but a preparation for the test. The impact on college admissions makes this a necessary evil.
The AP test, of course, is a crock. A real high school CS course should be able to use any approach, any language, any curriculum, that is necessary to teach the students -- and to change those requirements according to the needs of each particular class. Instead, teachers are shackled by the often inexplicable design of standardized tests.
This is a shame, because computer programming has enormous value beyond getting a hot job. It teaches a mode of thinking and analysis that is unique, powerful, and broadly applicable. To that end, it is absolutely worth the effort to coddle students who are less talented or less interested. There are posters here who advocate weeding out these students, for no better reason than to eliminate the mere possibility of a "bad programmer" entering the workforce. How petty. I would submit that the appalling lack of critical thinking skills in the general population makes any exposure of computer science to any student a worthwhile endeavor.
(And, just to be complete, the appalling lack of analytical breadth in tech. industry and tech. education makes any exposure of liberal arts to any engineer a worthwhile endeavor. =)
---
I like canned peaches.
Freedom is not the license to do what we like, it is the power to do what we ought.
I don't think it serves the needs of students looking to fully understand the internal workings of a computer, which is in my mind what an AP computer science course should be directed towards.
IMHO, then the course isn't Computer Science anymore, it's computer architecture, or computer engineering.
I remember in High School, my first experience in programming was with a basic program for the mac, then we moved on to Pascal, and we covered the concept of a compiler and an actual program executing. The actual AP course was then in Pascal, and it covered (for the most part) pure programming. Language syntax, construction of a program, debugging, and actual results of the program were what was stressed by the AP course.
When I started college (at RIT) our initial exposure to OOP was Eiffel (and I still think it's a decent teaching language, but not overly practical (read: not used too often). Where did that leave us after our freshman year? Unemployed in our field. Not having any practical language experience (read C++, Java) hurt our chances of finding any summer employment with the skill sets we had.
RIT followed up the first year of Eiffel with one quarter of C++ (10 weeks). That was about it for languages directly taught.
RIT has since switched over to Java. Those of us in the last year of Eiffel were kind of jealous because now the freshmen had marketing skills having 30 weeks of training in a demanded language. (Translation: They were more employable than we were.) By the time the department got around to offering a Java course to the upperclassmen, most were ineligible because of the requirement that students had not taken a Software Engineering course, or other course in Java (which most of the upperclassmen had by that time. Also twice offering only one section of it with 25 seats didn't help matters much).
In all, I think Java is a decent teaching language if you can work around the 1: speed issues, 2: IDE issues, 3: building simplified libraries for students to use until they knew what they were doing.
--You will rephrase your request for me to go to hell. Goto statements are not acceptable programming constructs
The move to Java is not, however, motivated by the fact that it may or may not be more valuable on the market. Those who enter the major currently have to learn Java anyway in our programming languages class. Our department is really into teaching the concepts of computer science and not the particular applications. It has been decided that Java a better language for teaching those concepts, without the pain and suffering associated with dynamic memory allocation, dangling pointers, useless error messages, etc.
There is a good paper by Ben Dugan, who argued strongly for the switch to Java today and against our switch from Ada to C/C++ 7 years ago.
-Jordan Andersen jordan@cs.washington.edu
Java is a good language to use in learning OOP concepts, even better than C++. This is because Java is a very straight-forward, strictly-typed lanaguage. As such, the language helps to build good object-oriented programming and design practices because of its "simplicity". C++ has too many "relics" from its ancestors (C and CPML (?)) that cloud the OOP concepts.
Completely replacing C++ is probably not the thing to do, though. C++ is a very powerful language that includes such concepts as Generics (templates), Multiple-inheritance, and lower-level resource management. These are facets of general programming that all students of CS should learn.
Continuing to base a Computer Science curriculum on languages like C and Pascal (even VB) is a disservice to the students. The science of computer programming has progressed, and so should the academia. I am not saying that these languages should not be offered at all, rather that the emphasis not be on these older concepts. Teaching older concepts is worse than teaching older languages. I have found (through both personal experience, and from outside observation) that as long as the concepts are (thoroughly) understood, then the language starts to become irrelevent. This is why "object-oriented" has come before us: because procedural and declarative concepts could not adequately solve every problem.
Procedural and declarative programming concepts still have their place; object-oriented concepts bulid upon the foundation that these other concepts provide. Languages like Java (although not Free as in "libre") reinforce the procedural and declarative concepts, and also more solidly present object-oriented concepts.
For a first "lets learn how to make the computer dance" programming language, C cannot be beat.
....
... This lead to the most important lesson I learned .. test, test, test ... we would really be screwed if a bug was found and all those EEPROMS had to be replaced [no flash available back then].
Later, with OO, introduce Java or C++, etc
Then (or even first before C, like I had) Assembly.
The advantage of Assembly first, is everything appears simple after that. And, you really can understand what the hell all those functions / API's do.
The best education I had was doing Assy / C in a firmware environment. This firmware went in cards, which were installed under a few hundred manholes in Manhattan
-- www.globaltics.net
Political discussion for a new world
In fact, language inventor PATRICK NAUGHTON developed Java to help him write software to find and download kiddie porn.
Part of his DEAL WITH THE FBI is to use his JAVA SOFTWARE to catch more pedophiles.
Please check out my references and you'll see that I'm right.
The University of Wisconsin Madison teaches Java as its introductory Computer Science course (they switched from C++). Interestingly, the UW Oshkosh (a full 4 year school in itself, 1/3 the size of Madison) still teaches C++ as the Introduction to Programming class.
So at least in some schools Java as a CS intro language is not a question, it is reality. It has been for over 3 years (I'm not sure when Madison switched). However, a computer science major still has to take classes in assembly, c++, even Visual Basic to complete his or her degree.
"The universe seems neither benign nor hostile, merely indifferent." --Carl Sagan
when I first started at CS, I was taught a specially designed imperative language, not quite unlike C, but without the hassels of a real-world programming language.
The language implemented only some simple types: int, real, char and string. More advanced type could be constucted as tuples of other types (struct) or choice of other types (union, with tags).
The language prevented accessing a union without branching on the type-tag (a bit like functional style: case e of X(x) => f(x) | Y(y) => g(y).
Funther more, pointers, and recursive types could be created for any of the above types.
The language had only one kind of branching: if, one kind of looping: while.
The language had nested scope of variables and functions, and type-polymorhic code using a construction not wholly unlike C++ templates.
We were taught the sematics of the language in terms of transition theory between states in the computer (well suited for the imperative paradigm).
Fast execution type was not a goal for the language, cleanness of semantics of the availible constructs was.
We were the taught (and given exercises) to implement various programs, and other language constructs, such as: for, switch, recursive types using pointers and other nice stuff, and charged with proving the correct semantics of our solutions (including, of course, loop-induction).
This has given a clean, well defined understanding of programming, which we can "adjust" to any given imperative paradigm we encounter, somewhat like: Oh, the for construct of C is a way to structure loops, their invariants and progression
We were given a lecture in, how the world would have looked if all was nice and pretty, and the means to understand the more "polluted" (i.e. post-increment; i++) semantics and "real-world" languages in terms of well-defined simple building blocks.
This approach has given a very flexible way to understand the exact semantics of other languages, as opposed to knowing, partly how i++ works in C++ and not understanding the full implications of that semantics
Morale: Learn the "pretty-stuff" in the beginning, you want code anything that's work anything the pair of years anyway (that's true, don't kid yourself, you'll do everything much better, cleaner, more efficient a couple of years from now ;)
SLOGEN [ http://ungdomshus.nu : Sebastian cover music]
Chris mentions that Java should not be used as a keystone language for CS education. I agree: No language should be keystone.
-qabi
I don't quite agree. You don't have to learn Sun's libraries, any more than you need to learn the standard libraries or namespaces in C/C++ to do the same thing.
Try making a highly graphical multithreaded networked application in C/C++ and in Java, and then tell me: which required more knowledge and technical bickering?
Besides: There are other libraries than Sun's (except for the lowest level stuff, unless you make your own VM). You could even make your own library.
-qabi
There are several possible motivations why Java is being chosen as the language du jour for intro-level CS courses (though for the record, I am just speculating here; I don't think any of them are necessarily good ones):
Sometimes even a bad programmer is better than no programmer at all.
When is this true? A bad programmer usually decreases the productivity of the other programmers.
How does one learn software design without learning how to program?
I've interviewed candidates that came out of those schools which spend a great deal of time teaching specific languages (Java, JSP, Visual Basic, ...),
and they don't even know what the hell is a linked list, or don't know how to traverse a binary tree. Sorry, you simply can't be a good designer/programmer if you don't even understand the building blocks of computer programming.
Java is a fine language, but if I were a professor, I'd rather have my students going through the pain of writing some data structures on their own using C, and going thru the pain of debugging it. That's how you learn how computers work, and that's how you learn to be a good programmer and a good debugger.
I just realised I should add something in important. In the lights of concepts like Extreme programming, UML, reafcotring and pattern design concept, Java really does perform a lot better than C++. In fact, Java is itself build on these concepts. It's allready IN the language, whereas C++ just allows for these concepts to happen. This gives Java a much more high level entry point than C++ does. It might be interesting to teach students the high level concepts first and work from there but I think it defeats insights in the historical growth of languages allttogether if Java is the first language people get to get their hands dirty on. Furthermore, I think it's too abstract. You don't feel your registers ticking. Experience on that level IS important, as it aknowledges the theory in practise. You can allmost touch the evidence, whereas a Virtual machine is something you'd have to live with. In that regard, C++ also connects with other courses that deal with how the metal side of the picture works.
Best regards,
Ignace
With great power comes great electricity bills.
We have had the same question discussed. Normally in the first year of the course, we teach students about OO programming concepts using The Oberon language, a wirthian language much like Pascal and Modula-2. The benefit of starting with this language, is that practically no one knows about this one when they start. This levels the field for everybody starting the course. The second benefit is tthat it is fairly similar to Pascal and Modula-2 syntaxes, but allows for concepts like pointers and garbage collection to be explained. Basicly, it as good as any other OO language, but we have satisfactory results in teaching OO with this language. The incredible downside to this language, is that students will never ever use it again. That's the first year, in the second they are taught C++ in a strict Stroustrup way.
Our question has been whether Java would be better. Certainly, as an assistant, I would have said Java all the way 2 years ago, because I just like Java much more than Oberon (and incidently the students do too), but Java really misses out on a lot of key concepts that C++ do have. If Java would ever be taught on our university in C.S., it would replace Oberon, not C++. We consider C++ a difficult but necessary level of experience students should have endured, simply because when they will work in a company 3 years later, the majority will be either in Java or C++. BUT. In the Mathematics and Physics classes, we HAVE switched to Java. To these people, a language is more a tool than a subject on it's own. In fact, we didn't just teach them Java, we gave them a Java environment that allows for allmost functional linear programming, an interpreter which simply translates their code (which looks just like Java code, only everything is purely functional) into 'real' Java. So far, the results are promising. They actually get the concepts of recursion, which, for a mathematics and physics 1s't year class may be easy to get down on paper but harder to get done in reality. This is the first year we're doing this, so we have to consider the end results in a few weeks when exams are over. We have also taught Java to Physics PhD students, with very good results. Most of the programming in Physics labs is now in Java because it delivers faster than C++ and is simply easier to maintain and update.
From personal experience, I think C++ has a few benefits on it's own. First it is a valuable leach that leads into the UNIX world, something most people have never had the chance to experience before. You will simply have to get the UNIX concepts and commands and syntax and phylosophy right before you can say you're able to pull a C++ thing off on a server compiler. Second, I think C++ is obviously valuable once you are done studying. This should not be the major issue here, and we dislike the idea of studying C.S. because it makes good money, but it's a reality nonetheless. Thirdly, C++ has influenced more languages in the 10+ years it exists, and thus makes transition to these languages, including the Java language, easy. Fourth, c++ allmost offers every concept that an OO language should offer, so in the world of paradigma's it's a fantastic example of OO programming. Fifth, the syntax and semantics makes people think mechanically, and the ancient C subset allows for making the distinction between lowlevel and high level programming. Learning how to debug is one of the key elements that C++ offers and needs, and students will benefit from that knowledge. And finally, transitions form C++ to Java are easy, but the opposit transition is incredibly tough, even if you DO know C++. I've made the transitions about 4 times in the last few years, and I can tell you every time I had to switch back to C++ all hell breaks loose again. You simply forget the hard parts because that's what Java is, the 'nice' version without the pitfalls that C++ experienced in it's more or less uncertain growth.
I hope this has some valuable insights for you.
With great power comes great electricity bills.
However, I've changed my mind. Do not teach ASM. Ever. Why? I'm tired of wondering, in the back of my mind or while I'm sleeping, did the compiler really optimize that loop? did it catch that redundant assignment operation I think I did? should I have shifted left instead of multiplying by 2? will my excessive recursive functions cause stack problems later? should I ADD cx,1 or INC cx? I can't stop thinking about that kind of stuff... it drives me nuts! I'm afraid I'll attempt a conversation about intermediate variables or nested for-loops with the person next to me on the bus.
hehehe
You go to learn sound CS fundamentals. The whole idea here is that you learn the art of programming without getting mudded down with specific syntax. Then later on when "C###" comes out and your boss hands you a copy and tells you to learn it you wont even bat an eyelash.
To that end, choosing java is a perfectly valid choice. It's cheap which is a major plus for our cash-strapped education systems and it teaches students OOP concepts.
I'm no mega-coder but thanks to my CS experience I can pick up pretty much any language in no time at all because I've seen and used so many different types.
"mastering" a particular language is something that comes thru years of experience. It's not something you should be striving for in basic CS courses.
- Toby
What is this "C/C++" everyone keeps talking about? C and C++ are two different languages. They're similar in many ways, but treating them as one language leads to bad C and bad C++.
I teach Java and C++ at the university level. C++ is more powerful, since it supports non-OOP design paradigms, but for the introductory courses, I actually prefer Java. Java, once you get beyond the froth, is a decent language that is a bit safer than C++ and avoids pointers. I'd start with two semesters of Java or C++ to teach basic programming skills, and then I'd move on to C++ for data structures, algorithms, and generic programming.
...
how about smalltalk. for teaching, it enforces Object Oriented methodology.
Tell me how to write this in Java:
void ChangesA(int *a) { *a = 1; }
calling it?
with obvious optimization if you are calling it frequently...
Java primitives are clunky and are IMO a holdover/crutch from C++.
I think one of the biggest problems I see with newbie Java programmers with a C++ background is that they never learned proper OO techniques. So they find clever ways to write procedural programs in Java...
I am a student at Saint Louis Univ, and in the computer science dept here, students learn c/C++. (C is taught as the intro course, and C++ is used to teach object oriented concepts). Conversely, in the MIS dept. here, the MIS students learn Java as their programming language of choice. I am in a unique situation where I have taken both sets of classes (I took the Java course(s) because I wanted to learn Java).
Overall, I feel Java is a better language to learn with initially because of two major reasons:
1) Java does not use pointers - and therefore does not create 99% of the compilation errors that often occur with C++.
2) Java was designed with Object Oriented design in mind. C++ was not - C++ is basically a bastardized version of C, with a hint of OOP concepts in place.
This does not mean, however, that Java does not have its drawbacks as well. Java is SLOW compared to C/C++, Because things like pointers do not exist in Java, when a programmer comes across such structures in another language, they often become very confused. And finally, Java is also too "easy" to "program" in. Meaning that I can go out and buy a Java development program that will allow me to do 90% of the things that any decent Java instructor will want. Once I figure out how to make them using the tools, I just get rid of the extraneous code. The only Visual C++ tool like that that I can think of is M$ V-C++ - which is non-ANSI compliant anyway.
Overall - Java is a good training-wheel language and is good to start out in.
However, C/C++ have the robustness and the concepts needed for a learning language. Comparitively, Java does not provide key concepts to would-be programmers.
SO - decide what you want to be and pick your poison
In a contest between C++ and Java, I think C++ wins, even in this category. Here's why:
I learned C/C++ in high school and had a fair amount of experience with it. In college, I took a CS class that taught Java as an intro to programming. My experience was that the ease with which my classmates learned the programming basics was not dependant on the language, but on the way it was presented. Ultimately, I think my classmates learned much faster in high school because they were able to jump right into programming basics with little infrastructure (just some cout commands). In my Java course, our FIRST program was a windows program. The problem with this approach is that everyone gets dunked into setting up the infrastructure for a windows program before they even know what they're doing. Even though we had a nice MFC-like package to help us with it, it was VERY daunting to many of my peers with little or no programming experience.
Of course, everyone eventually got over their learning curve, but ended up knowing a language that didn't have the capabilities that they need to have. It seems to me that Java is being applied in ways that it is ill-suited for - namely it can't be implemented for the variety of programming projects that C++ can.
I can't handle this, I need a beer.
It was recently announced that Java has the most developers worldwide at 2.5M expected to ramp up to 4M by the end of 2002. Anyone in Telco, especially wireless, is looking that way. Nokia, DoCoMo, Motorola are looking at 1 Billion new wireless, Java-enabled platforms in less than 1 year from now. What I see missed in these posts is that we need to evolve. CS is getting bashed because it's not innvovating as fast as other industries...there have been multiple /. posts about CS not advancing the UI, for example, in the last 10 years. Java is an evolution.
And for those that bash the speed, I'd be curious as to what is slow. I've seen enterprise applications, data processing infrastructures and full 3d games (at 50+ FPS) in 100% Java. The Java VM is only a C program, so maybe we should be bashing C for being slow!
While I'll immediately acknowledge that C/C++ is a much more versatile tool than Java and a more essential piece of any programmer's toolkit, Java strikes me as a much better learning language. At my university, CS majors are given an intro course in Java (although not about Java) and a great deal of theory before they hit classes that require C++ (In many cases, higher level classes are language agnostic, although C++ is a req for upper level OO Software Engineering workshops). I'm not sure about AP classes, but at the university level students are expected to pick up specific languages on their own. Java is used in intro courses because the API is so easy to jump into and is so well documented. Java is so simple to pick up that professors can spend their time teaching software design techniques, not programming languages. Once students get a feel for programming techniques they can get closer to the metal. When people dive into C/C++ right away many get so bogged down in the semantics that they learn little about technique, efficiency and style. In any case, Java is a useful tool in and of itself. I'd rather do network programming or lightweight sever-client stuff in Java any day.
Don't give up on BASIC yet! There's a whole family of BASIC-like programming languages out there. A couple summers ago, I spent some time teaching at computer camp, and we used 'True BASIC' to start kids off. It's a very straight-forward procedural language, and we pretty much just taught the kids variables and basic control structures. (Maybe using functions, if they were really quick).
After that, it wasn't much of a jump at all to move the more advanced kids (who came back from the previous years) up to some basic C++. As a first language, True BASIC teaches very clean habits that serves kids well when they move onto more sophisticated languages. One of the things that works well with younger kids is that you start off working with a GUI. (Drawing lots of squares and circles to make a house, that sort of thing.) Working of a command line is fairly boring for kids when it is their summer vacation.
You'd be surprised how much you can do with the language, actually . When the instructors started competing with each other, some nifty things started happening.
-Cassia
Vericon is coming!
Try the book "Refactoring" by Martin Fowler. Every programmer should have the chapter "bad smells in code" tattooed onto the inside of their eyelids.
The problem with the patterns book is that it does not really say why the patterns are "good things." The reasons of course have to do with coupling, cohesion, encapsulation and controlling connections and communication. The patterns in GoF are mostly just examples of these more basic principles. (check out Fundamentals of O-O design in UML by Meilir page-jones for an interesting discussion of fundamental principles.)
I've been programming commercially since 1987. I've been on projects that used objects and those that don't. The benefits from objects come in larger projects. I have no doubt that objects appear to be of little use in the little assignments that students do.
The really interesting stuff in the OO world right now is happening with extreme programming.
Also, The guys who mention that intro classes should focus on assembly language are totally clueless. The intro classes should focus on using computers as a tool for solving problems. We get plenty of comp sci graduates who are useless because they cannot solve problems that can't be solved in a few hours. It takes about two years of on the job experience to turn a college grad into a decent programmer. All of that time is spent teaching them how to talk to people, work with people, and organize their thoughts and their time. Success in pogramming has a lot less to do with machine architecture than with these things.
I disagree, assembler is still too high level. What I cut my teeth on and cursed it going through it, but understand now that it was for the better; was good old psuedo code. Exactly what is a "while loop", what are it's parts, where should it be used. Syntax does not matter, methodology does; once one has the proper methods down using/learning Java, C++, Assembler, etc. is fairly easy. I think the first 2 semesters we actually did maybe 10 programs total on a computer; we did a whole lot more on paper using psuedo code (in fact not a single test was done using any computer equipment). As I moved through the courses, I did assembly, heavy duty algorithmic design, project programming theory, built our own pascal compiler with pascal, and even did some coding on a bread board. That gave me a very broad understanding of how a computer works and how best to get it do the things I want/need it do to.
CS students, it seems to me, are getting introduced to programming languages too soon, before they have a firm grasp on actually being able to program properly, not just syntactically correct for whatever language you are using.
I am a Grad Student and full time programmer.
DePaul University is going to switch to Java as its primary programming language. I have to agree with the poster that this will be a dis-service to students. A good developer will know how to solve programming problems using several types of languages Java/OO is only one solution. There are times when C or some other non-OO solution is going to be needed.
Why bother debugging a funny memory bug when you can just rewrite the code? Sure it's a quick fix, but there may be a more subtle point being missed. One of the most valuable experiences I had in college was when I was doing some math-intensive code, and could not make the algorithm work right. Many hours later, I dug down to the assembly, and discovered the compilier had made a mistake while optimizing. I wasn't programming in assembly, but it saved my ass to be able to read it.
If you're gonna be an engineer, be an engineer.
I think it's generally wrong to look for the coolest/newest/most elegant language to use. It's better to stick with the simpler one. During the last year, I've had had two courses in beginning to program: Pascal at school and C++ (without OO) in the university where I've been taking courses. I knew C, C++ and Pascal beforehand, so I had a plenty of time to reflect upon the teaching progress.
I've reached the conclusion that students who do not program have difficulty even with loops, pointers etc. I've come to the notice that often understanding of procedural programming is crucial for OO work. That's why it is important to teach pupils a procedural programming language.
The language of my choice is C. It is one of the most prominent procedural languages, has a simple and ubitiquous syntax, and can be easily used for advanced work. Knowledge of C has some real weight in the market, unlike, say, Pascal. To sum up, simple is beautiful
But you have to take into account the fact that there is already a serious shortage of programmers worldwide. Sometimes even a bad programmer is better than no programmer at all.
The other thing is that this would not only drive away undedicated people, it would also drive away those potential future computer scientists, who are more interested in other areas like software design, instead of programming.
Remember, we are talking about introductory level CS courses here. Is the actual language that important, so long as it introduces the fundamental concepts of computer programming?
I took Java as an introductory language in 1994. At that time, the university was phasing out Pascal in favor of Java as the teaching language. Sure, we covered OO concepts like inheritance and polymorpism, but what did I really take away from the class?
Stuff that I used again and again in later CS courses-- stuff like iterative loops, conditional statements, etc.... how to actually do stuff with programs. How to solve problems. How to debug. Stuff that applied to every other programming language that I would later study.
Besides, although CS classes may introduce you to programming, the real learning begins when you stop studying and start writing real-world code. I learned more about programming in my first two or three months on the job than I did during the duration of a Fall class.
Bottom line, I just can't see the importance of which language you use to teach the fundamentals of programming-- that's why they're called fundamentals.
Then give them a complex data manipulation program to think about (say, converting a Postscript font to Truetype). Start them thinking about better ways of handling the data.
During this discussion introduce OO concepts and a clean OO language (Smalltalk, say).
Once some progress has been made introduce them to a "real world" OO language like C++ or Java. They'll then have three languages and a grounding in what OO actually helps with as well as what compromises are made between the "ideal" OOL and the ones in use.
Personally, if I need OO I use Forth. That way I can define "OO" to fit the problem. Anything that doesn't need OO I just use Perl, C, or assembler depending on how important speed is.
TWW
"Encyclopedia" is to "Wikipedia" what "Library" is to "Some people at a bus stop"
obviously everyone's first language should be python.
I think c# would be a very good introductory language for a computer science course, ignoring the Microsoft stigmata and the fact that since it is a new language there are few books/compilers/debugers/teachers out there.
.net language for server side stuff. So you could go get a job after your first semester at college.
1) It has support for many Object oriented Mechanisims.
2) It looks like c/c++/java/javascript so you could move onto them after you completed the c# class.
3) It has automatic garbage collection, but you can work in unsafe mode and have access to pointer arithemetic. So it is nicer than both c++ and java in that respect.
4) It is the Microsoft
Having said that, I'm not sure that either one is a good introductory language. Personally, after reading the book The Structure and Interpretation of Computer Programs (which, I think, is used as the intro CS course at MIT -- not that I could get in there ;), I think an alternative language like Scheme might not be such a bad idea.
Now, I don't think that Scheme is a great general purpose language, but it's very flexible and allows you to experiment with a couple of different paradigms. (You don't need to use an 'Object-Oriented' language to leran or program in good object-oriented style.
Plus, since it's a language that one will probably never use in a job, it will give the students a little more diversity (rather than tying their minds to one particular language).
--tim
Brown University, debatedly one of the best undergraduate computer science programs in the country, had been using Java as its core language for a number of years (before this was OO-Pascal, ugh). Recently though, an alternative introductory sequence was added in which scheme was the core language, and java was taught later.
The question, in an undergraduate program, should not be necessarily what language prepares students best for industry. A huge majority of industry applications are still written in C, so if training students for the real world is the goal, then all courses should be taught in C. That is not the point of an undergrad education. A computer science program should be teaching computer science (programming is just a part of this). Hence, Brown's addition of the scheme intro sequence. Scheme allows students to learn difficult concepts such as recursion (remember the first time someone explained recursion to you?). Java allows students to learn the OO paradigm to programming without needing to know the intimacies of the hardware. No one should be dereferencing pointers before they've learned how computers work. (this is usually taught in an architecture class, usually taken sophomore year). Basically, the advantage of java is that it makes students learn how to write good, clean, OO code, before they learn how it is implemented on a real computer.
The real question is not what language is best for an intro sequence: the real question is do students learn more in a top-down approach to learning software engineering, or a bottom-up approach?
how about implicit copy construction? did you know about that when you learned C++ in high school? what about the order in which operator overloads are found? how about virtual inheritance, how a v-table works, or static object construction/destruction order?
anyone who thinks C++ is an easy language either has no clue about 99% of the crap that it does, or is a complete moron. writing code in C++ is easy. writing hello world and other small programs is simple in any language, thats just syntax, but there is more to programming than syntax: C++'s implicit semantics make it a very difficult language to learn CORRECTLY, and to write CLEAN code for.
Powerful, yes. Easy or straightforward? not a chance.
ObPedantry: This isn't begging the question at all.
"Begging the question", otherwise known as circular reasoning, refers to the (fallacious) practice of assuming the truth of conclusion in an argument in the content of the argument.
Here's a reference.
Steve
The degree module I took about 3 years ago, used smalltalk as its teaching language, i believe this was because:
smalltalk is very strict.
the limited syntax of small talk stops students from wandering off and doing something creative(which you don't want in an enginering profession;->)
there are clean room versions of smalltalk designed for teaching.
in my opinion these are all the wrong reasons for choosing a teaching language.
Java which i have programmed in for about 4 years gives you a lot more freedome than smalltalk, and allows you to implement most design patterns a fairly clean and efficient manner,
Good java ide's like JBuilder foundation are freely available. On the down side Java to OO and has garbidge collection which doesn't teach you about memory management, and efficiency needed in a lot of real world application, Java students will probably produce bloatware.
Visual Basic which i have used for about 8 years , well it's kind of oo, you have to be very creative to get even a fairly complex oo design patten working, the ide is good and jit compilation/interpreting makes it very easy to see what going on and change the programme flow. there are also cheep/free? versions of vb for teaching and you can always pratice at home with a bit of vba. overall VB lacks in power, consistancy and OO features and should only be considered as a freak language.
Visual Prolog (not by m$) has a reasonable object orientated structure, has a good ide, great debugger, a free personal version but you'd have to take a pot of pain killers in with you-!;
Object Pascal(Delphi/kylx),
Object pascal is a nice language to use and is very powerfull, easy to understand and feature packed. Pascal has a strict declaration sequence which is a good thing to have in a teaching language, inheritance and overloading is handled very nicely, and properties beet getters and setters hands down. Borlands IDE is great, the help is usually spot on and I can get into the flow of object pascal quite quickly.
C/C++, i have used both c and c++ of OOP, C++ is a very powerfull and possibly the fullest OO implementation i have seen in a language, features like operator overloading, abstraction and properties/closures(in Borlands version) make C++ a good language for teaching oop in full, the flexability of C++ requires a hugely mature approach to programming, and memory management, lost pointers etc could make finding bugs in students code a nightmare, having said that the only way you learn to set pointers to null, do bounds checks and declare everything cleanly is buy debugging badly written C++. There are some good C++ ide's out there CBuilder is great, Visual C++ has some nice debugging features, KDevelop is getting there, and plain on RHIDE or Emacs make reasonable ide's.
Python is meant to be a very good language, and was given a good review by mr X Microsoft. I haven't used python but I have heard good things about it.
overall,
well I'd prefer it if everyone spent 5 years learning C++, but that isn't really practical, if i was going to pick an alternative it would be Object Pascal(i don't know enough about python). It's a good clean language with some great ide's out there and you got that huge base of pascal teachers out there(there the ones with white beards).
--all speling mistaks ar intentanal --
thank God the internet isn't a human right.
As an introductor language to programming I do not think that using Java is a good idea. To me I feel that before you start learning languages you should learn first how to program. To do this I feel that the first thing a group of students should learn is pseudocode.
Now I am sure that some people are groaning over that last statement, but I truly believe that pseudocode is the most useful language a programmer can know. I am a just finishing up my CS degree at Georgia Tech and I have been working in the industry for 3 years and it has been very useful. At Tech I was a Teaching Assistant for the intro to programming class and we taught pseudocode there. The purpose of this was to get the students to learn how to think about how a program is going to flow and how the individual modules will be structured. They wrote their projects in pseudocode and turned them in and the TA's would then act as the compiler/computer to see if they worked. By doing it this way the students dont learn how to code in Java, and then learn how to code in C, and then in C++. Instead they learn how to code independent of a language.
Unfortunately the CS department has quit teaching pseudocode in the last year and is now teaching Scheme as the intro language(GAG!).
When it comes to teaching an introductory Object Oriented Language so that students can learn what OOD and OOP is I think a great language for that is Squeak(SmallTalk). At Tech we have a group of students who do a lot of work with Squeak and the OOD class is in Squeak. When I took that class all of the questions I had that the Java class did not answer about OOP were answered. It takes OO to a whole new level and is very easy to learn so that the syntax does not get in your way.
Now, when it comes to AP Computer Science and think C++ is a better decision that Java simply because I think it is important that students learn about the guts of what is going on instead of having all of that covered up by the language. However, your school will not have any say in this because if the school does not teach the language choosen by the AP board then they loose their AP credit for that class. Just be glad you are not learning Pascal and Carrot like I did.
Also I think pseudo code would be a good thing to teach to high school students at a sophmore or freshmen level instead of basic or pascal. That is what I am trying to work on with my old highschool, the AP coordinator is trying to get people w/ CS and other Engineering degrees that have experience in the real world to teach a class or 2 at the school for the Magnet program in a college format so the students can see how things are done.
Rich
Last year, my Junior year of High School, I took AP Computer Science I, and I am taking AP Computer Science II next year. C++ is an incredible language. Never really messing with Java, my impressions are that it's quite bloated. Yes, it's great that it can run on almost any platform, but like other comments have said, what good does that do you when you are trying to learn how a computer works, "thinks", and interprets the commands we give it. My second hand knowledge of Java makes it look like it does most of the work for you, to me at least. I may be wrong, but who cares at this point. Teach C++.
-tyfighter
I'm a student CS at the Antwerp University (Belgium) and the way OO programming has been brought to me, may inspire many other's ...
I think, learning the OO prgramming concept in Java can be done, but is far from ideal. There are too many very relevant concepts in java that are kept hidden (especially pointers). The arguments of java being slow or ugly don't make any sense to me, but that's not what this discussion is about.
We have learned OO programming in ... Oberon. Ik can hear many of you think Oberon, what the ... ? Well Oberon is an educational language, developped by Wirth (yes, the one from Pascal) and which runs in a specially designed environment (also called Oberon) which can be run inside any OS (win-linux-unix) or stand-alone.
the idea of choosing Oberon as language to teach us how to program comes from many reasons:
However, not all is in favor of Oberon. It's environment is special and may lead to friction with the user (especially in the beginning) and Oberon programs are not portable to other platforms than Oberon.
Anyway, I think that having learned the OO-Programming concepts in a neutral language like Oberon makes it easy to make the step to C++ and Java. Philippe
I thought we were talking about LEARNING how to program. The fact that Oberon in practice is unusable is irrelevant. Not all of the Math subjects I took at Highschool are of any use to me. Should we kick those subjects out then ?
If your first program doesn't SEGFAULT are you really learning anything?
Personally (as a Junior CS student), I think that one of the hardest concepts to wrap your head around is recursion. I have more than a few friends that avoid it like the plauge. Maybe the second biggest problem for intro CS students would be syntax. I would advocate the use of a scripting language (lisp/VB/scheme) (PL Scheme or Dr. Scheme) not only do the schemes have a command line interpreter, but there are no tricky missing semicolons. You can also still teach switch/if/while structures. The first language I had was QBASIC, the next VBASIC. The one good thing about VB is that you get pretty results as soon as possible, and get to have buttons and pretty widgets. I am glad that I learned simple data structures in VB before I got to C++, because eveyone in the class was still struggling with syntax, when you really want to teach logic. I'm not going to repeat the reasonong behind not starting with ASM, because I must've read 50 of them by now, but suffice it to say that intro classes have NO business around anyhting remotely like ASM. Any move away from specifics and into concepts should be a welcome one.
Intro classes are about ideas, not languages.
George II -- Spreading Freedom and American values, one bomb at a time.
For those languages such as Spanish, French, or German that have only a few more extra letters than English: do they use "american" (standard qwerty) keyboards and change the keyboard layout combos to support the additional characters, or are there actual keyboards with extra keys for those languages? One would think that for a language with, say, six extra letters, a 110-key keyboard wouldn't be a significant change from a 104-key keyboard... right?
Just a thought.
eudas
Blessed is he who expects the worst, for he shall not be disappointed.
The new first years had a change of sylabus, they are taught Java as there introductionary language. From what my friends in that year said I believe they found Java more of a head fuck than the people in my year did with Pascal.
The main problem I feel that the big picture is coming into focus.
IMHO it doesnt matter what language you lecture on its the quality of the lecture. I've came out of this year with my average at 80-90% but I dont know what this means in real world terms, ok so I can display Hello World to the screen, I understand the differences between a class and an object and I know a bunch of algorithms for common tasks (sorting, stacks, linked lists etc.) but what will this get me in the real world? How much more do I need to learn before I can consider myself a programmer?
Da Cr33p
A university should really teach you a mixture, pure object-oriented (like Smalltalk), imperative (like modula-2 or C), functional (like Miranda) etc. The student will then have firm foundations for being a good programmer.
And if they are badboys, they should teach them perl to drive them nuts!
The solution used for my department is the FormatIO, a Java package written by Dr. Ron Poet, which allows easy text and numerical input and output from a file or the console, or the creation of a graphical console via AWT.
Once I/O is fixed, Java is quite a good teaching language provided it is taught correctly (do not introduce Applets in the first lecture, teach the fundementals first - that is what simple console I/O is good for).
--
Steven Murdoch.
Steven Murdoch.
web: http://www.cl.cam.ac.uk/users/sjm217/
There is an important reason for this. Aside from dealing with I/O and memory management it forces you to choose your algorithms carefully and to actually put thought into what you're doing.
A first language should not be a language that tries to abstract detail and make things easy for the programmer. Languages that make things easier for the programmer are great but I'm a strong believer that you should learn to do things the hard way first.
We're getting too many under qualified people in the computing field these days because they were only taugh the latest buzz languages in University or College.
I'm also noticing an increasing amount of programmers who don't even want to learn C/C++ because they learned VB or some other toy language first, and they find it more rewarding because it's easy and they get results faster without giving much thought into what they're doing.
--
Garett
IMHO C++ is the best language for OOP concepts. Besides who would want to run java on the 386s on my college's lab? C++ being a continuation of C is easier to adapt to, than java and its "abstract" classes.
This is the only post in the whole thread that makes sense, although you didn't need ten bullet points to get to the meat. "no one language is good enough"... doesn't that pretty much say it all. Is there any even marginally competent programmer out there who hasn't programmed in at least two languages? Why not switch between languages during the introductory course to get at concepts that are more universal?
Shouldn't a basic concepts class have a decent survey of various languages as a significant piece of what makes it useful? Like, what is the difference between functional, object-oriented, procedural, etc? Like, what are X language's strengths and weaknesses? How does a compiler work? How does this differ from interpreted languages? And most importantly, can you write at least "Hello World" in assembler or ML, so that just once in your programming life you have to understand binary, hex, and the fundamental structure of a computer that much better.
I do not have a signature
- the needs of the industry (clearly Java/C++/something similar)
- languages that enforce good programming practices and keep simple tasks simple to implement (Python, Lisp, Pascal)
Yes, I listed Pascal as a good language for the latter category. Don't act so shocked.Unfortunately, good teaching languages are often not considered because languages like Java, C, and C++ are in higher industry demand and are therefore more attractive to beginning CS students. What we seem to end up with is students that "know Java" but suffer from poor programming style and techniques.
I have no sig.
"Computer Science is no more about computers than astronomy is about telescopes." - E.W. Dijkstra
Java is rather mediore example laguage since it
was made on compromises, did not take any ideal
to extreme like Smalltalk C, or Effiel did.
Java is opaque language that tries to take
advantages of many little things, and sacrifices
hitting absolute targets perfectly, so it can
cover solving most it problems more or less ok way.
As such it is poor language to teach anything,
but how to be practical in computer world. And so
many universeties forget that they teach computer
science, sacrificing computer science for fads and
corporate funding.
Like I did when I was a boy.
They stab it with their steely knives,
But they just can't kill the beast.
Personally, I don't believe that Java is the right way to go in that respect (although there are worse languages: my old comp sci dept started to teach Ada as a first language after I left...). Two main reasons:
My personal choice for a first language to teach would be Limbo, a beautiful language, designed by some of the original designers of C (who've come a long way since then!). Amongst other things, it:
- encourages simple, understandable code. Reuse is through encapsulation rather than inheritance.
- has a powerful set of primitive data-types with natural and useful semantics.
- runs on many platforms under the Inferno OS, e.g. Windows and Linux.
- is completely type-safe (unlike Java)
- has a simple but powerful set of libraries which can be understood, and are useful, in isolation from each other.
The language primitives make it quite feasible to teach different aspects of programming without moving to different languages:- Lisp-style lists are nice for teaching recursion ("car" and "cdr" become the more natural "hd" and "tl")
- Proper by-value strings (unlike Java's) make string handling sinple and natural.
- Interprocess communication is supported in Limbo by first-class channels, enabling threading and concurrency to be explored without constantly struggling against thread primitives and associated pitfalls which belong to the 1970s.
Overall, the syntax is extremely clean, but very expressive (although still recognisably derived from C). It has hardly any "gotchas", and is generally programmed in a simple, direct style, ideal for beginners (and advanced programmers who want to write maintainable code, for that matter). Moreover, it's very sparse on resources.I'd love to teach it as a first language. No more "ahh yes, that array just turned into a pointer because you looked at it funny"... oh happy memories...
Just remap your keyboard ;P
It's one of those languages you're either _really_ good at or _Really_ suck at.
I've taken C, C++, Java, Perl, Smalltalk, some Pascal, and a slew of other things, and am fairly competent in all of them. However, two weeks into my Beginning Lisp course, I was already dropping it from my schedule.
Nothing against the language, but its not a good place to start. It'll just frustrate alot of people.
I wish above all that someone would recode C or C++ to be cross-platform, because I swear (i'd put money on it) that the MINUTE they did, no one would even mention the word Java anymore. C++ can do OO fine, is much more powerful and low-level based (as compared to Java), and has a time-earned reputation of stability.
No "beginning" language should do most of the stuff for you. Java does garbage collection, handles pointers for you, has high level functions, etc
People don't learn to program by having all these things done for them. Hell, I'd like to see an "initial" Java programmer trying to learn C (memory leak, what's that?) C++ is a great place to start. It has all the power of C w/ OO and other goodies.
I'll state my biases right off the bat: I'm a C++ programmer, and like it because I can do Object Oriented programming, Generic programming, and procedural programming within the same language set. Java does not support templates or generic programming as the term has come to be known, and delving down from OO is pretty tricky.
The question arises though: what are we trying to teach here? If it's a course in computer hardware, teach BASIC (10 PRINT "HELLO WORLD" 20 GOTO 10), then assembly. If it's an algorithms course, teach it in Python, then Java, sure.
But if you're looking for a catch-all language to teach any and all kinds of programming tricks, you can't go wrong with C/C++. Java? Without pointers, it's pretty tricky to teach em as a concept or teach classical linked list programming. I don't think you can embed assembly in it either.
Throwing OTHER languages in as well isn't a bad idea, so that at the end of it you can come out with knowledge of Java, Python, etc. etc. etc. But for a firm grasp of the basics you'd have to go with a C or C++. Any good program worth its salt will teach procedures, object orientation, memory considerations, architectural considerations, generic programming, templatised programming, etc etc etc... I can't see other languages coming close, which could explain C++'s popularity.
--- Jump!! Fire!! Bullet time!! - Lego version of the Matrix
I have an unfortunate bias; I work at a video game middleware company, and we're strictly C++, as is most of the game industry.
My Java is very very very rusty, and I can't responsibly teach it.
My career has been entirely C, C++, and Objective-C. (I've used Python and Perl for a few scripts.) Maybe I'm just weird, but I haven't used JAVA professionally once, and my coworkers and friends haven't either. WEll, they may have, but it just hasn't come to my attention.
People are into Java servlets, but beyond that, I'd be at a loss to say where they are being used; perhaps you could help me out here? I know that our local metro uses Java to display bus schedules, but that's because it was a university project.
If my students got stuck away doing maintenance on 5 year old systems, I don't think they would mind to much; it beats a lot of their current jobs. They'd continue to come to the classes to further learn, and develop their skills, provided that they didn't have to move away. Once they get to a certain level, they feel comfortable teaching themselves and learning on their own, as a few of my students have done. They can keep developing, and get out of the maintenance positions.
One of my students wants to do embedded work; He learns C from me, and teaches himself Ada. I don't think Java will do him too much good. Then again, I don't know much about embedded stuff.
Sure, Python is like this too; I encourage you to check it out.
Here's hello world in Python:
print "Hello, world."
Here's a simple encounter on the python interpreter:
>>> x = 5
>>> x
5
>>> y = 10
>>> y
10
>>> x = y + x
>>> x
15
>>> l = ["hello", "my", "friend"]
>>> l[-1]
'friend'
My students can write whole functions and play with the language with incredible ease. Many walk along in their python interpreters as the lecture progresses in real time.
No compiling, no fiddling, just raw, unadulterated interactive programming.
When my students can just type, interactively:
>>> def foo( bar ):
... print bar*3
...
>>> foo( "Hello!" )
Hello!Hello!Hello!
>>>
...it's a very good thing. It makes everything so easy.
Actually, GoF does describe just why patterns are good, and furthermore gives a rather in depth (if terse) description of just how to couple your classes. Most people skip the entirely crucial beginning of the book ("I already know what OOP is, I don't need to read that") and head straight for the catalog.
How to judge if an OO book is good or not:
Most books go into the "It just feels right" diatribe. Or, they go into the "Reuse, reuse, reuse", as if we could inherit the world (hell, all our programs should just be 5 little lines of modification to some other program, right?). My favorite are the Zen books that talk about how it's a whole new [cosmic] way of thinking.
I put these books in my mental shredder.
Design Patterns is different. It explains rather rigorously (but not mathematically rigorously), supporting it's claims rationally.
If you've read the design patterns book, read it again. The real treasure is not the catalog, but the introductory sections, from which the catalog can be derived.
I've noticed a disturbing trend in the replies; That is, most of them focus on language features.
For example, they say, "Oh, they should use this, because it has good OO," or, "Oh, use [C/ASM], because it's low level, and good programmers know how low level stuff works", or, "Use [C++/Java], because that's what the industry uses", or "Use XYZ because it's got a good set of libraries," etc., etc.,.
These folks have obviously never taught people who haven't programmed before.
These are people who are going to struggle with variables. These are people who can't write a for loop to save their lives. They can't use a function, much less a method.
OOP, pointers, bits&bytes, libraries; None of that matters for at least 3-6 months.
This is why I highly recommend either LOGO or Python as a first language. These are interactive interpreters. You need to be able to say, "X=4", and then say, "what is X?", and then reassign X. You need these basic things.
Once the concepts of variables, loops, and functions are in place, then you can easily map to other languages. I know this because I've taught it. I also know this because I've consoled students crying over their Java homework (quite literally) at the end of the semester, incapable of using a for loop. These are good students.
As programmers, we take a lot for granted.
So forget all this "X features OOP, Y has a good lib, Z is low level," and think: Variables, Flow Control, Functions. The rest will follow naturally after these are ingrained and easily used.
I teach free programming classes in Seattle. Since I teach classes for free, I don't have the economic pressure to teach JAVA or C++. I could write whole articles about the damage that certification programs do to people. Another problem is that people look at the Jobs page, discover that most industry programmers are doing something called "JAVA" or "C++". They open up the university catalog and see, "Learn JAVA in 3 months!!!" ($1500), right next to the A+ certification houses. Since the ads are all over the place, they figure that it must be the way. They take a class, and drop out halfway through. The experienced programmers with CS degrees taking JAVA to learn a new language make the newcomers feel pathetic, and they decide programming isn't for them. If only I could copy the experiences in my mind for y'all... It's really bleak.
College is a different situation. I think the reason the profs teach JAVA is because they actually bought (and contributed to!) the hoop-lah about OOP, in a theoretical rather than economic way.
I teach my students in the following order:
It is with great sadness that I teach my students OOP, as it is over-hyped, and people believe in it religiously and without question. I teach it in order to prepare them for the world that will hire them.
The primary value in OOP, as far as I can tell, is thinking about the data first, and language features supporting polymorphism. Also, the book "Design Patterns" is the most (and quite possibly only) valuable piece of literature from the OOP community. I stress that it doesn't require a particular language or ideology to implement polymorphic behavior, or to think about the data first, or to implement a common pattern. (Device drivers and web servers are great examples of objects exhibiting polymorphism and encapsulation. In Non-OO speak, that's the product of paying attention to coupling and cohesion, which takes us right back to... The Unix Philosophy.)
I teach C so that they see low level stuff, and Python, for reasons to numerous to list. I teach C++ so that they can get hired.
One of the reasons for listing Python: They can start writing programs from day 1, second 1. No fussing with heavy class notations, like Java forces you to. (Just look at Java's hello world.) To believe that new students learn about OOP by using Java is hopelessly naive. Most students I've seen working with Java as a first language struggle with making for loops, while loops, and using variables. (Of course, several students will defend their teacher and difficult learning by give you the rhetoric that OOP is the way, and that Java is great because it's... OOP! You can feel the difference!)
I am currently a CS major entering my senior year. My school has used C in its intro courses up until now. Starting this year, freshmen will be required to take Java. C++ will still be taught, but in an upper-level OOP class. I dont agree with this choice. C/C++ is still very prominent in the software field, especially in Linux programming. While C++ includes everything C does, not having a course that uses ANSI C will result in many students missing out on the kinds of things you can do with a procedural, powerful language. Java hides quite a bit of low-level stuff from the programmer. While this is well and good, it still needs to be learned. Understanding pointers is a topic that is especially valuable and, if java is used, they wont even be mentined. This raises another question: is OOP suitable for all programming tasks? By teaching intro courses in Java and then C++ in upper level courses, students may be able to get out of college without ever programming in a procedural language (the only non-oop language may end up being assembly). Should schools be so eager to jump on the OOP bandwagon that they abandon all procedural programming?
You're not allowed to rent here anymore!
I'm now a junior as a comp sci major, and my school uses Java as an intro langauge for CS majors. Math and engineering/physics students still need C++ and don't care about Java, but the first 2 years of the CS program are almost solely Java. Having aced the course and tutored people on both Java and C++, I think Java is a little easier for them to understand as beginners. Later on, once students are used to programming concepts, they are introduced to perl, c++, sql, and others...
no comment
First, I've seen posts that suggest that we must begin with assembly a lot of it arguing that knowing low-level programming makes for better coders. I don't agree for a few reasons. Most programmers (stressing most, not all) will work on systems that do not require real-time response. So, these people don't need to know how to clip a few milliseconds off the exec time. For most people, what is really necessary is an education in how to f***ing write clean code (personal annoyance at some folks obvious, eh?). Most of the systems I've worked on are your standard n-tier, database backend, web frontend lets-sell-some-crap.com systems. While performance is sometimes an issue, spending literally weeks trudging through dead-code, undocumented code and general crapola is far more problematic.
Second, if we're going to go to a language that is not assembly, let's go to an OO language. Is that where the industry is going? I guess I'd like to think so. I may be wrong, but if I'm not, then let's teach an OO language. When I learned Java (the language I program in for my jobs) I knew some C. I had used C in my physics major to do simple modelling. As a result of my lack of C knowledge, I think Java was easier to learn. Why? Because like learning a foreign language as a child, I learned the language and not how to translate what I knew to the language. (E.g., I never thought of objects as structs because I rarely used structs. So, I never wrote translated C code when writing Java. I learned to write objects. You OO coders out there with experience have seen and know the difference and I'm sure know exactly what I mean.)
Finally, Java is a nice and simple language that is widely used. Except for version differences, the libs are the same no matter where one goes. It isn't a 'pure' OO language, but is more widely used than, say, smalltalk. It has automatic (if crappy) memory management. You'll know all the basics and that's what learning should do. You'll also learn in a language that uses the dominant style (OO) and you'll know a language already in use at many companies.
Overall, I don't think anyone can claim that one particular language is the hands-down winner. I do believe that Java offers many advantages.
Stepping aside from the personal issues which plague all questions of "which (insert technology here) should I use?", the best answer is to use what best fits the problem. First, to answer the person/people who said that assembly should be the first language taught, that's about the craziest thing I've ever heard. There's no doubt that understanding what a computer does at a low level can helps you program in a more informed manner, but the basic concepts of programming (variables, control structures, etc) are not best taught in an environment that makes them incredibly challenging. This is why pascal was such a popular language for so long - it taught the basics without overloading the beginning programmer with excessive details.It wasn't popular because it was a great language for creating business applications in (although you could inline assembly in Borland's Turbo Pascall), but it was wonderful for getting people to the stages where they could develop such applications in other languages. This is the same reason that Java is a good choice for teaching OOP design. No one that knows Java can argue it doesn't implement virtually all object-oriented design elements. The syntax is virtually identical to C++ (although I'm not sure why they took out the enumerated type), so you can't argue that it's a particularly bad style of language (unless you don't like c++..) The argument that it's slow goes back to the reason that pascal is/was a great teaching language. It doesn't matter how fast/slow an application runs in a teaching language (although it does say something about using it in mission critical applications.. something that I just don't understand why people would choose Java for). Also, as a plus for Java, there are free (notice the lower case.. free as in beer) SDK and IDE implementations for virtually all platforms. This means students can have easy and inexpensive access to development tools on their home boxes and school can spend the money they would have spent on MSVC++ licenses (or whatever other language they were using) on other things to make their department/school a better place. --XaXXon
Stepping aside from the personal issues which plague all questions of "which (insert technology here) should I use?", the best answer is to use what best fits the problem. First, to answer the person/people who said that assembly should be the first language taught, that's about the craziest thing I've ever heard. There's no doubt that understanding what a computer does at a low level can helps you program in a more informed manner, but the basic concepts of programming (variables, control structures, etc) are not best taught in an environment that makes them incredibly challenging. This is why pascal was such a popular language for so long - it taught the basics without overloading the beginning programmer with excessive details.It wasn't popular because it was a great language for creating business applications in (although you could inline assembly in Borland's Turbo Pascall), but it was wonderful for getting people to the stages where they could develop such applications in other languages. This is the same reason that Java is a good choice for teaching OOP design. No one that knows Java can argue it doesn't implement virtually all object-oriented design elements. The syntax is virtually identical to C++ (although I'm not sure why they took out the enumerated type), so you can't argue that it's a particularly bad style of language (unless you don't like c++..) The argument that it's slow goes back to the reason that pascal is/was a great teaching language. It doesn't matter how fast/slow an application runs in a teaching language (although it does say something about using it in mission critical applications.. something that I just don't understand why people would choose Java for). Also, as a plus for Java, there are free (notice the lower case.. free as in beer) SDK and IDE implementations for virtually all platforms. This means students can have easy and inexpensive access to development tools on their home boxes and school can spend the money they would have spent on MSVC++ licenses (or whatever other language they were using) on other things to make their department/school a better place. --XaXXon
Now this works well in some circumstances. Mostly those departments which are heavily over subscribed. They can afford to say "we will choose a language for didactic purposes" because students will still come.
In many other cases departments are very constrained, by what the students want. The students come along saying "no one uses SML, so why teach it", or "everybodies advertising for C programmers, so we want to learn C". Now of course there is a place for market driven education, but you can get too much of it. Learning C as a first langauge is really not a good thing to do, what ever the students think. They will probably be better C programmers after 3 years if they start on something else! However as is often the case in many fields we can not just pick the best tool for the job. We have to bow to the pressures of fashion, common practice and so on.
And this is where Java comes in. Its a bit of a God send to be honest. From a teaching point of view its a hell of a lot better than C/C++. And its quite widely used in industry, and currently rather sexy. Of course there are still better languages for teaching, but Java is a really good compromise.
Which is why its becoming so common place in education.
Phil
I would prefer strong typed langauges, Pascal, or better, Modula2 as introductionary course.
My experience is people that did such language significantly produce better C/C++.
Then Delphi and C++, and maybe some small Java course (which won't be a problem then)
The idea to start with Java was fashionable for a while, but now reason has returned. Fundaments first.
Whoops, missed somewhat there.
,java, VB
Suitability for introductionary courses:
Modula2, Pascal, C, C++
Delphi is before C, are after it, depending on how much you resent the initial language to be OOP
OTOH, C++ and Delphi also allow programming in the motherlanguage
This is an attitude that causes a lot of problems, and exactly what forced Java to be an introductionary cause always.
True CS majors should be nearly language dependant, since they grasp the fundamental principles behind them.
Learning a lot of languages is important to see the bigger picture. A picture that you don't get if you start with C++ and end with C++, with a one semester Java course.
Agree completely. Also a lot of small slow details can make one big slow applications. And 250ms reactiontime is already slow for a GUI user.
But more important, lowlevel knowledge is also important to select parts of a problem that
- are better implemented in a faster (read solidly compiled) language
- required more algorithmic study, or are worthwhile investing extra time in.
What attitude you ask?
Forcing the tools of the market to introduction to programming. Thinking that what is good for the market, must be good for teaching.
C++ doesn't belong there, like Java.
Pascal,M2 ARE strongly typed, stronger than C in most respects. (Borland dialects are a bit more lenient btw)
Learning general programming skills is about learning fundamental concepts, and most important GET A CLUE WHAT YOU ARE DOING.
Strong typing forces that.
Same about autocleaning. If you can't deal with it, the study is a level too high and abstract for you. Might I suggest the Law department?
It is not that working with an autocleaning language is bad, as long as it has benefits for the loss of control (like faster development cycles). But AFTER you graduate,
Generating CS majors that are unaware what their own code does is plain and simple bad.
During a lot of studies (I'm still working on my Chemistry Masters, but I did a CS bachelors at the side) the theory in classes is much heavier, and often never used when you start working. (Quantum Physics?). But they teach you a professional way of thinking, increase your level, and make you more flexible and all-round.
Still, I think you should be more concerned about their basic programming skills, then their ability to write (more advanced) C++ code.
IOW if a proper introductionary programming costs a semester C++ programming, I think that is a good tradeoff.
First courses should be about teaching fundamentals, and creating good habits.
Hardly typed, autocleaning languages are therefore not suitable. Modula2, Pascal, C, C++
And I also think a procedural language is better as introductional course than an object oriented one, pretty much for the same reasons.
Schools often seem to take fashionable languages as primary one to increase contacttime with those languages, but since most time in introductionary courses is lost in wrestling with fundamental concepts, I think that is severely overrated, and hinders actually acquiring the actual, supposed to be learned in an introductionary course, basic skills.
In our CS course theres about 110 people. The vast majority are there, not because of a love of computers, but because of the promise of a high wage at the end of it.
These people have major problems, even after a year, with Java - a very simple introductary language in my view (its still powerful though).
Our course isn't all java though (although 1/4 is). We also look at MIPS assembly (with spim), LISP, Prolog, SQL, HTML and are encouraged to do stuff seperatly on our own (PHP etc.) with uni societys. We study everything from what 32bit MIPS assembly instructions look like in binary, to how files are stored on disks, hole lists and memory paging, etc. etc.
Full info at www.dcs.ex.ac.uk, dunno if you can access it off-site though.
Thats all in the first year. Next year we do stuff in depth.
WE havent touched any GUI stuff in java yet, although we've already made route finders for trains (London Underground).
On the one hand, if you start the students in the more complex stick shift (C or C++), switching to an automatic (Java and similar languages) will be easy later on.
On the other hand, you might want to start on an automatic (Java) because the complexity of the manual (C) is overwhelming to the beginner and can result in more mistakes, more frustration, and a slower learning curve. Starting with a system that takes care of some of the details for you allows you to learn the fundamentals of steering, braking, parking, and traffic laws before you add the more difficult element of shifting gears.
Both sides of the issue are valid. I tend to lean towards the second, but I am not a computer scientist, and I never intended to be one.
I wish that my inferiority complex were as good as yours.
-RenderHead
This was in fact done in the first and most recent cs class I took, Harvard's CS51 (www.fas.harvard.edu/~lib51). It's the second semester intro course. We learned CLISP, Java, and C++, in that order. Our final project was to write a LISP interpreter in C++. The Java assignments exploited it's enormous library of functions and the power of Swing: first we just filled in the guts of functions that resulted, thanks to a ShapeShowCase class writtn for us, simple shapes we could rotate scale etc. As our third assignment we wrote a GUI calculator, similar in appearence to the windows calculator.
It may sound like an outlandish reason, but to an extent students in CS, especially and primarily intro CS, want to come out having made cool stuff, and as cool as something that spits out the details of an application of Dijkstra's algorithm to a randomly constructed graph is, the never having to use the windows calculator again is something that leaves me at least feeling a little more accomplished
sell your certainty and buy bewilderment
If you want to let them understand how the computer works let them implement something in assembly, for a real or virtual processor (MMIX for instance). I think Knuth's arguements for learning algorithms through low level implementation is a valid one, but it doesnt fly for C IMO.
Go high or low, but dont just pretend to go low... it just breeds programmers who think C is giving them efficiency while at the same time they have never looked at the assembly which actually comes out to check, and even if they did they couldnt interpret it.
Whats wrong with assembly? The arguement that if you go that low you might as well go to VLSI/Semiconductor physics doesnt fly, because with knowledge about assembly instruction&IO latencies&throughput etc the machine is fully defined from a user point of view. The exact workings of the transistors and electrical fields dont change that, thats the beauty of clocked logic... you dont need to know whats happening underneath to know what its going to do.
A good assembly course can learn you the exact behaviour of a machine (and hopefully they teach you how to apply that to other architectures)... C just gives people the illusion of knowing how things work. That just breeds programmers who see "tough jobs that java, perl, lisp, python, etc., etc. are just too high level (and/or too sluggish) for" everywhere, without justification a lot of the time... and one's who cannot use assembly knowledge in C or even assembly directly when C is just too high level and sluggish for the job at hand.
This allows the stundents to learn about the differences in the two languages. Still the first few programing courses should be about programming techniques, algorithms and such, not programming languages.
I realy cant see how the performance and excessive resource use of Java has anything to do with the programing done in the first few courses in programing since those are usually very simple programs.
I used C++ in my first programming course but have never used it since (I do most my development with Java). But what I learned in the course, determinging the speed of algorithms, different styles of programing OO vs. functional and such have been very usefull still.
Sindri Traustason
"It takes two to lie, one to lie and one to listen"
Sindri Traustason.
Also, in Java, there's no way to pass variables by reference. So, in order to have a method change a value that you pass to it, you have to encapsulate it in a class. Either a custom one, or something like Vector - which is not cleaner. Also, teaching someone to rely on Garbage Collection is insane, it teaches someone to write sloppy code. Java is not a cleaner environment, and it doesn't teach people to write cleaner code.
Obviously you don't understand the language, because your "pass variables by reference" comment is completely inaccurate as shown by this response.
I've seen Java coders who STILL can't figure out how to dispose of memory, basically don't understand the difference between stack and heap, and don't understand pointers well enough to dispose of an element of a linked list.
Secondly, this is exactly the point of high(er) level languages: To eliminate details that are better solved by the machine, or previously by someone else. I've seen C/C++ coders who still can't produce binary output by hand from their source files. They're so stupid they have to use a compiler.
No, it doesn't. By virtue of using Garbage Collection, it is taking memory management out of the hands of the developer, teaching people to be lazy when it comes to object instantiation and use
Garbage Collection is completely unrelated to the concepts of Object Oriented Analysis and Design. Automatic Garbage Collection allows one to focus on solving a problem. Forcing manual garbage collection is a step backwards in any modern language. It's a detail that the machine is better able to deal with, as it should be. Automatic Garbage Collection is a concept that can be applied to many differing programming languages and it is a detriment in none of them.
So, in order to have a method change a value that you pass to it, you have to encapsulate it in a class
Or behavior more commonly known as a side-effect. And also best to be avoided when dealing with Object Oriented Programming. A common mistake of many C/C++ programmers is to get caught in the procedural traps introduced and taught by C and adapt those same concepts, wrongly, into their OO work when using C++. This is probably the reason why you think encapsulating your value in a custom class is a poor decision. Maybe you should study the term encapsulation.
And as for your comments about ease of learning. It may be easier to learn C/C++ (which is the biggest source of problems: C is a procedural language, C++ is not, but the grouping of these two together produces disastrous results), but that ease is because people learn the wrong way to write OO code. Java teaches, or forces, the correct way. After learning the proper way in Java, you'll find that you actually write better OO C++.
Java allows you to solve problems, C++ allows you to solve details. As an employer, I know which one I'd want you to deal with.
I dont see what all the fuss is about.
To answer some of the questions in the article:
> If you were going to structure a curriculum to
> teach Object Oriented concepts, would you teach
> it using Java, C/C++, or something else?
Java. I'd totally forget about C++, mabey throwing it in as a pointer intensive crash course. Learning C++ would be there as a non-compulsory course available Not For Credit ONLY. Any serious programmer MUST know C++, but it is not required for computer scientists. You use the best tool for the job.
> 1) Java is a fine development language,
> and it will help me as a programmer to learn it.
True. You'll think like a programmer, learn OOP. Mabey a few design patterns. All in all, you could be learning Object Pascal and you'd pick up the same programming mindset. Java is more crash resistant so you'll tend to get the coding done faster.
> 2) I'm right. Java is a fad, not worth much
> more than the Windows OS in terms of quality,
> and my CS faculty is doing me a disservice by
> cramming it down my throat.
False. Scientists are not uber computer programmers. They do not care about programming. They want to describe their thoughts in the quickest way possible. Like wise, they have a limited amount of time in which to tutor you in concepts of AI, Image Processing, etc.
> There's a little truth in both the above
> statements.
False.
> The language taught, which has progressed from
> Pascal to (currently) C++ is changing once
> more. Next year will be the last for C++. The
> new language will become Java. My question is,
> realistically:
> Which is the best language for an AP Comp class to learn?
Answer: IT DOESNT MATTER. Who Cares? You have to adapt in the computer world, or you'll be unemployed @ 35-40, or in stuck in some horrid legacy development company that cant find anyone else to do their development.
If you think you're going to leave highschool as a "Master Guru Programmer" and get employed for some ludicrous amount, you're wrong and have a long way to go. (The uber geek is the exception).
You miss the _entire_ point of University & High School. The university system does not care if you come out with no technical skills. Universities do not train students technical skills. (If they do, its probably a cheesy University) Universities are supposed to train your mind to THINK in a manner that will allow you to adapt to change and create change.
Learning java at university does not have the goal to teach you how to program in Java but rather, to get you to "THINK" in a logical method to plan programs and put your thoughts into computational programs. The university doesnt care that you come out with Pascal / C++ / Java. As long as you can program successfully. Ie: You're mind is structured in such a way that programming is natural. (Like driving a car).
Their primary goal is to get you to a point that you can do your Image Processing & Artificial Intelligence assignments. All those advanced 4th year modules are what computer Science is. The first few years in undergrad is getting those less geeky students to THINK and Program.
Once you know how to program in one language, you'll quickly be able to pick up another language. The more languages you learn, the easier it is to learn new languages. This is because PROGRAMMING in different languages use different models in which they describe their language, BUT, there are only a few such models. Most languages are extremely similar, only changing in syntax.
When it comes down to the one person who cares what you know - Your Employer - You'll realise that you'll use the best programming language for the job. That may mean that you'll have to learn something new while employed. If you do not adapt in the computer world, you'll be unemployed at the age of 35 (unless you're either a manager, or a leacturer).
If you're thinking you're wasting your time, you're _so_ wrong. While learning how to program, downtime caused by crashes and pointer problems make learning difficult. Java is definately the perfect educational language. If anything, knowing java will make you a better C++ programmer by enforcing OOP methedologies.
Bonus points if you can program in java and your employer develops in Java. But dont think you can only get away with learning one language. If so, go to www.darwin.org for usefull tips on how others get by this problem.
> C is a language that has been designed to be
> very close to the hardware, and its
> ideosyncracies and power reflect that. Through
> this relationship, C reflects the realities of
> the hardware your programs run on. Memory
> management, low level process and I/O control
> are all things that a computer
> scientist should understand at a very low
> level, to better aid in future programming and
> debugging no matter which language is chosen or
> inflicted upon said scientist.
> In contrast, Java has been designed to take
> such concerns away from the programmer. Memory
> management? Low level IO?
This is the information age. To push research further, you stand on the head of previous technology. You do not start back at the wheel developing everything up until your research area. You take the best tools for the job, you specialise your research and focus on what you're trying to achieve.
What Scientist are you refering to? Mathematical Computer Scientist, Info Computer Scientist or Electronics Computer Scientist and Systems Scientist? Only the last two apply. If you want to build operating systems, you've gotta know alot of the bones. If you want to do AI, you're working in Prolog, or something so far from the hardware : Because you dont care. Sure, everyone HAS to know the principles of programming. You learn this in C, C++ and Java. It is not exclusive to C. Ideally, our thoughts would be mapped directly onto the computer. Scientists want to describe their thoughts, not silly programming languages.
Oh, So you want to be a programmer.
If you want to master a programming language / programming in general. Go to a technical college, or some skills training. There is no place for C in general computer science unless its some operating systems course / low level electronics integration.
> In short, since I believe that AP CS courses
> should focus on the low level architecture of
> computing, Java is an inappropriate language
> for that course.
Are you a scientist or a programmer?
There are different objectives. Every student should ask themselves this question. Some students blindly think that they are thinking.
> When is Java appropriate? In your college ?
> sophomore comparative languages course, or,
> alternatively, in an OO course or two?
Its appropriate when they can teach you to program in it, quickly, ensuring that you can do Image Processing / AI / Algorithm Analysis / Whatever else they decide to teach as a Science. Computer science is not a technical training school.
---
All uber geeks dont actually learn how to program in university. If you're not an uber geek, stick to the syllabus until you can think, mabey take some extra courses.
-Tim
- One semester is enough time to really get a good grasp on procedural programming (manipulating variables, flow control, recursion, basic performance analysis, etc.) but not enough time to do that and really learn OO.
- Learning assembler first is overkill. Learning assembler second is a good idea, because you get a better sense of what it's being used for.
- A good first language is one that doesn't give you a lot of rope with which to hang yourself. Pascal and Java are both better than C in this regard.
- One should learn OO right around when one starts working with data structures
- Computer science and programming are not the same thing. Most computer science courses can and should be largely language-independent.
Overall, I think that there are some good reasons to use Java in an intro class: it keeps the student out of trouble, it's got a C-like syntax, and you can easily use it to demonstrate the basic stuff. The biggest drawback to using Java is that you don't get students thinking carefully about memory allocation, but most of them need a little time to master for loops before they can really handle memory manipulation anyway.One of the problems here is that we're talking about two different audiences. However, Java is not good for either of these audiences.
For AP computer science, where most of the focus seems to be more on programming than algorithms, C/C++ is more appropriate. This allows students to understand pointers/etc, while still allowing some higher level concepts such as OOP. Pascal was not a bad choice either, it's just a little outdated these days.
For a first year CS course, the rules are a little different. Teaching in a language like C/C++ would be good if the focus is more on programming than algorithms. If it's more on algorithms, I would suggest something more like SML.
Java is seldom a good choice. I can remember CMU having a problem that everyone who took sophomore CS in Java (it was offered in Java or SML) was significantly less prepared for later classes than those who took SML. Part of this was that some later classes were in SML, but another part was that using a functional language with a fairly simple type system allowed professors to explain these concepts in detail, which improved people's understanding of what the language was doing under the covers, and how to use that to their advantage.
I've never taken CS, so I'm not too sure what kind of introductory classes a person needs to take before taking this course, but I'd think the best order would be--
BASIC (be it QuickBasic, GW Basic, Visual Basic, whatever) -> Pascal -> C / C++ -> x86 Assembler.
The reason I suggest this route is because the idea of assembly language REALLY comes into focus when you've had your hand in a number of other languages, and this also easily melds into compiler design and development (which really, when you're working with assembly language, is a natural topic).
Assembly language also has different uses in different high-level languages. In Pascal, some compilers (notably Borland Pascal and Delphi) have 'asm' keywords for using assembly inline, while *some* C and C++ compilers have __asm or other such keywords, or the less friendly __emit() calls. In BASIC, AFAIK, there still isn't a way to include inline assembler, only after compilation but before linking (not even sure about that either).
Plus, teaching students inside of an already learned language (again, Pascal or C/C++) lets them see the benefits with very little effort. A prime example is writing a complex looping statement in C or C++, then re-writing that same code in inline assembler-- the students IMMEDIATLY see the fruits of their labor, and will instantly recognize that, USED PROPERLY, assembly language can boost the speed of their programs substantially.
The other reason for the BASIC -> Pascal -> C / C++ -> Assembly route is simply that ASM is complicated and involves a lot of effort to get things done. (An example is a 'Hello, World' app, which in C or C++ would be a handful of lines, but in assembly (not using BIOS calls or library functions) would be a WHEEE bit longer.)
Again though, I don't know the state of mind an entry-level CS student will be in, or what knowledge they may already have. I do agree 100% though that assembly language should be required learning, because as you said, understanding HOW the system works gives insight into how to write code well, and knowing x86 Asm has served me invaluably.
All I know about Bush is I had a good job when Clinton was president.
We also need better CS/CE majors, not these people I see who believe it is impossible to program without a proper IDE environment.
Excessive forking causes un-wanted children.
In a required class to get my CS degree we had to design a 4 bit CPU. Granted this was done in one of those EDA tools, like a digital version Spice. But it required the whole show, registers, memory, microcode, etc. Because of it I have a much better understanding of what my code is doing today. So you may be joking, trolling, but yeah at some point you should at least be exposed to flipping bits to get something to run.
Excessive forking causes un-wanted children.
OO is high level, teach them assembler first and how the machine works. I've seen way too many people writing really crappy code because they have no idea what's going on inside the machine.
Excessive forking causes un-wanted children.
I'm graduating this weekend from an institution that thinks VB is the greatest thing since sliced bread (thankfully I learned C/C++/Java on my own and at other institutions). Anyhow, looking at industry requirements right now (not future trends), the most sought after knowledge is: (1) C/C++, (2) Java, (3)UNIX, (4) web dev, (5)VB.
If a computer science department ignores C/C++, they are doing a huge disservice to the students there - basically reducing the number of jobs they can apply for by a huge number.
Also, C is a simple language to learn structure and flow control from. Start with that, simple concepts (arrays, type conversion, pointers), and then move on to the meat-and-potatoes of OOP - objects, inheritance, frienships, operator overloading.... If you start out with a fully OOP language, like Java, there's a lot of "Just do it this way - trust me" that you have to tell the students ("Why does main have to be an object? What is an object"? type questions).
As an aside, I don't think full OOP is a good idea - computers don't work that way, and neither does the real world. Let's say you are in a room with a closed door, and you want to exit the room. First you walk to the door (no objects used here - simple proceedural logic: "walk to door"). Then, you use a piece of the door object: "turn door knob, pull." This is why I like C++ - it's a mix of proceedural and OOP. Use proceedural logic until you need an object. I always have a difficult time wrapping my brain around Java: Main() is where it all begins, but first you need an Application object that contains Main. But how do you instantiate the Application object? Well, you call it in Main. But Main is in the Application object.......wash, rinse, repeat.
Just my 2 yen.
"Jesus saves, but everyone else in a 10 foot radius takes full damage from the fireball."
"I don't agree. Starting off with assembler is like starting off a driver's education course with a class on auto repair."
Everybody's gotta drive; no one is obliged to code.
there's more than one way to do it, but your way is wrong
Why do we need an educational language? C is not easy to learn. Nor is C++. printf("Hello *real* world\n");.
Engineering and Computer Science cirriculae are crammed as it is without the repeated teaching and reteaching.
On another note, anyone remember why Pascal got dropped like the bad habit it was? The Borland version bore an almost 1:1 correspondence to C. But that was the downfall: it was full of Borland-specific enhancements, and no one likes a corporation-owned language. Are we destined to repeat history with Java?
there's more than one way to do it, but your way is wrong
Actually, it was just tried as an introductory level language here at the University of Missouri St. Louis, which is the top CS school in Missouri. The feedback has been good overall...
How Jaded Are You?
Not long after they let me out, my university did essentially the same thing: they switched the introductory CS classes to Java. (Way back when I took the intro classes, they were in Pascal under DOS. I understand they have passed through C++ since, mostly while I was busy with the upper division material.)
So far, it looks as though most of the upper division courses are still using C[++], with of course a few unusual ones thrown into the mix that use SQL, Scheme, ...
I have seen a bit of the material from the Java-based intro classes recently (mainly because of my brother-in-law who is a beginning CS student at the same school), and I must say, I'm not impressed. Java may be perceived as having more "practical, real-world application" than Pascal (although as a Delphi/Kylix programmer I would disagree with that perception). Be that as it may, however, it doesn't go nearly as far to teach (OK, enforce) good programming practice. Some of the crap I have seen beginning Java programmers do is appalling.
I will admit, of course, that starting with VB would be much worse :)
Where is the wisdom we have lost in knowledge?
Where is the wisdom we have lost in knowledge?
Where is the knowledge we have lost in information?
You can use Kawa to compile Scheme to JVM bytecodes. It's easy to make use of Java objects as well.
Keep your goal and your audience in mind. MIT is out to produce computer scientists, not programmers. SICP might not be the best textbook for everybody. However, Scheme's advantages apply to other introductory courses as well, e.g. How To Design Programs.
I agree with you in that Java is fine for an education language but it definitely shouldn't be limited to that. For example, one of the new recruits in my company has just graduated from a university where they were only taught Java. Consequently, he doesn't know what a pointer is, he doesn't know what linking object files means and he doesn't know anything about memory allocation.
As I see it, University (College) is about education not about industrial training. You shouldn't be taught specific tools at university rather you should be taught theory. That way, when you leave university you will be able to apply your theory to different languages or applications. For example, one of the Universities here in the UK teaches all the programming in Visual Basic. I mean what is that all about? How can you possibly claim you know how to program when all you know is Visual Basic! A good programmer should pick a language to use like a carpenter picks a tool for a job. Different languages are good for different jobs and university should give you the theory so that you can easily understand new languages.
A university should really teach you a mixture, pure object-oriented (like Smalltalk), imperative (like modula-2 or C), functional (like Miranda) etc. The student will then have firm foundations for being a good programmer.
perl -e 'print $i=pack(c5, (41*2), sqrt(7056), (unpack(c,H)-2), oct(115), 10);'
Let me shed a little light on how you can pick up concepts that you hilighted were missing and that can be learned from Java:
- Pointers - Java actually has support for pointers and you need to understand them to be able to use Java. The catch is that Java doesn't call them pointers. Java calls them references. eg:
- Memory Allocation - Java uses memory and as such memory allocation is important to understand. Again, it's simpler than in C, but it does exist. Where you declare a variable affects how it's memory is allocated and you have to be careful that all references to Objects are "released" when they're no longer required to avoid memory leaks. Avoiding recursive references to Objects requires some advanced memory management techniques at times.
- Linking object files - Seriously, how hard is that to understand? Java uses the same idea again though, classes link to each other. The difference is when the links are made, C does it at compile time, Java does it at runtime.
Basically, Java doesn't make you think about these concepts like C does, but that doesn't mean they aren't there. Anyone at university should be working to understand things, not just pass the course. If your university only teaches you one language, go out and learn some others in your spare time! If you're not excited about learning IT concepts and want to do it, you need to find a new career because you'll be left behind.Object obj = new Object();
will return a reference, or pointer to an object. If you pass it as a parameter to a function any changes made to the object will affect the calling method. It's the same deal in C, but Java doesn't use the difficult syntax.
The IT world moves rapidly, if you need someone to teach you everything you'll go nowhere fast. If you think for yourself and seek understanding not knowledge, you'll go a long way in this business.
Adrian Sutton
adrian_sutton@users.sourceforge.net
And if you were skeptical about my turning down jobs, here's my currently accepted ones:
IT with Advanced Studies Student
Griffith University
Software Engineer
Software Quality Institute
Systems Analyst and Software Engineer
Griffith University
Contracted Software Engineer
ElementalPower
My first instinct is to say Python or Smalltalk, especially to teach OO concepts. The only reason one would want to teach in another language (IMHO) is to give the student a marketable skill.
:)
I can write killer python code all day, but it's to no use to my team leader because he refuses to even look at it. I have to port everything to C++ before he'll even run it (unless I put it behind HTTP
Some have said that Java is not very mainstream, but if it's not, it's surely poised to be. I know at the national lab where I work, there is probably more Java development than C++. Java seems to be the language of choice around here.
Given that it's replacing C++ as the ubiquitous standard programming language, I think it's quite appropriate they're changing out the curriculum. I wouldn't like it either.
Personally, I'm very happy with the attitude that was taken in my early CS curriculum: it doesn't matter which language we choose, so here's one out of a hat; if you want to learn another language, then do so. I gained three valuable experiences from that.
- You can learn any language in about a week if your skills are right.
- Your skills can be honed on any language.
- A programmer with a diverse language set is much more versatile and powerful than without.
I say get them a good teacher and let the teacher decide the language. The language shouldn't even be a part of the course description.
But why assume that everyone in the intro class is there to become a "skilled programmer?" How about science or math majors there so they'll be able to write some small apps when they need to? Or history or sociology majors who need to satisfy a science requirement or just like computers and think learning to code a little would be fun?
Unsettling MOTD at my ISP.
Also, we don't want to be like a tech school, the University is not supposed to teach you everything there is to know, it's supposed to send you off with the ability to learn whatever you need to learn. And teaching students several new languages each semester moves the emphasis to new syntaxes and away from new perspectives.
dynamo
I agree. I was a statistics major in college, and at the time the programming language we had to take was Pascal. C would have been much more useful in hindsight, as I have had to spend some time later picking it up. The program changed a couple of years later too, to C++.
Curb CO2 emissions: Kill yourself today!
After teaching labs at RIT in these languages, I can tell you that Java is definately a nicer language to use for teaching. As one post mentioned, Java hides the bare bones of computer operation from a student. This is a good thing for a beginning CS major. AP Computer Science in a school should be introducing a student to programming so they may persue it in college. If AP CS taught only C, then you would only get Computer Science and Computer Engineering majors. Using Java, you'll get more people in the IT and Software Engineering fields (my major) as well as CS and CE. If you're a high school student and you're into computers enough to learn C, you don't need that extra push to go into that field. For someone who's life revolves around AOL and Napster, Java is a good start. Now, once you are in college, why start with Java? Look at syntax. Java syntax is orthogonal and simplistic. If you've ever used polymorphism or inheritance in Java, you know that it takes only a couple of keywords to do it. C++ gets much more complicated. In C++ you have to worry about friend functions, virtual, etc. etc. Java lets you do all that stuff easily. Ever try using threads in C/C++? Compare that to Java and you'll appreciated the addition of the synchronized keyword. Finally, UI. You can make a window in Java and display it in a few lines of code. Sure, you can do the same thing using GTK or QT, but how do you explain moc to a beginner for QT and object oriented C for GTK? Java is much easier to grow accustomed to, particularly when speed is not an issue. Object oriented programming is here to stay, its not a fad, but Java is. Its becoming a server side tool, not an application tool. However, the prior RIT curriculum taught using Eiffel so wide use isn't necessarily a factor. Simply put, use Java to introduce and weed out those that aren't interested. C/C++ may eliminate people that find it too hard before they understand the basics.
- gtaluvit (prnc. GOT-tuh-LUV-it)
Seriously, the managers who invented the "C/C++" phrase need a horse whippin'
Point me to a standard that talks about "C/C++", anything other than some lame "job requirements" document written by Dilber's boss. You can't. "C/C++" doesn't exist. The two languages are diverging, more obviously with the C9x standard.
In high school I used C++ in AP Computer Science. In college we used Java. You could take the exam and know little to nothing about OOP. Most of the circulumn was centered on learning the syntax of the language, most of it not OO. In college many people had not programmed before and spent all their time struggling with syntax. When the class came to an end they finally licked the syntax, but most had no idea what an object or a reference to an object was.
I believe the major problem here has been with the teachers. Teachers are giving out too many cut and paste exercises in syntax. They need to spend more time explain things like references, pointers, and memory usage. Assignments need to require use of things. Of course Java hides almost all the details from the user so it's not very good for teaching this sort of thing.
Now that's important, but I believe the subject was teaching OOP. I think that switching APCS to Java will be a good thing provided that colleges are still teaching Java. Students will spend less time learning syntax and more time programming. One thing though, it's vitally important that students be require to actually design their own OO programs. I don't believe that simply implementing a given class allows students to exercise the OOP methodolgy that was probably gone over in one or two classes.
I think you really have to look at it from the perspective of why are they teaching computer science. The answer is: To collect your tuition money. If you don't want to learn java, show them with your wallet and enroll at another school that sees computer science from your perspective. Another point of view might be that we should be studying Spanish instead of English because Spanish is more common in the world than English. It really doesn't matter what language you learn, as long as you learn to communicate (natural language) or solve problems (computer language) or is solving problems the point in both? Jobs are hot for java programmers right now, so that's what the colleges are teaching. Maybe it would be better to start with COBOL, that way you could understand programming from a historical perspective? And yet I ramble...
I think you're factually challenged ;-)
I don't think it is true that the majority of programming jobs are c or c++; Java is a VERY large share if not an actual majority, and the percentage is growing. And, regretably, VB/ASP work is pretty plentiful too.
-------------------------
-------------------------
A person of moderate zeal
We have a lot of students & recent grads where I work, and all of them have Java listed as a language. I checked around with some friends about the curriculum(sp?) of the local colleges where most of our hires came from and found that every one of them use Java as an intro programming language.
/*drunk.. fix later*/
Um. writing some algorithms and data structures in functional languages can be very difficult. functional languages offer a very useful paradigm, and one that eveyrone should learn IMO, but writing say Karatsuba multiplication in functional languages can be a pain. For some such tasks, like quicksort, however, it can be very elegant
"It's because they're stupid. That's why everybody does everything."- Homer Jay Simpson
Functional languages often provide very slick ways of doing algorithms like a prime number sieve for example. However, the code you linked to is pretty ugly functional code IMO. I myself wrote Karatsuba and also ran into the same problem as that author: you need to write lot's of helper functions to do every little step of the algorithm.
when I can do something like:
fun quicksort (x::s : int list) : int list = (filter (fn y=> (y (y>x)) s)
I love functional languages, but sometimes the hacks to do things are atleast as ugly functionally.
"It's because they're stupid. That's why everybody does everything."- Homer Jay Simpson
"It's because they're stupid. That's why everybody does everything."- Homer Jay Simpson
"It's because they're stupid. That's why everybody does everything."- Homer Jay Simpson
I just recently complete a 3 year Comp Sci technical program at Dawson College here in Quebec.
:)
Now my school was a bit behind the times this was the curriculum I had.
1st Year - Quick Basic, Visual Basic, MS Access, COBOL
2nd Year - 2 More COBOL courses, two C++ Courses and an introductory HTML course
3rd Year - DB2, Oracle, Java/Perl (as a combined course). With DB2 we did more COBOl
So I've learnt a pretty good range of languages. From BASIC, to Java to COBOL. I've taught myself PHP, ASP since then (ASP wasn't by choice...)
I would've loved to have learny assembler and I think that'll be my next project.
Anyway I found learning Java at the point I did (after learning C++) couldn't have been better. It gave me a taste of a decent programming language for creating GUIs (VB doesn't count and we didn't do any of that in C++)... When I first started working with it I absolutely despised it. It was my least favorite language after BASIC.
However after working with it for a while, I learnt to love it. I found it to be a very elegant language. Besides database access everything was quite intuitive.
I've been looking for a chance to sink my teeth into it again but where I'm working now most of my programming is more along the lines of PHP and Perl...
Anyway... I've gone off on quite the tangent.
Dawson is changing the curriculum next year. It's basically going to be a 3 year Web programming course.
No C++, No COBOL...
But there'll be more Networking, PHP, Perl, 3 or 4 Java Courses...
If I had been given Java as my first programming language I would've hated it and it probably would've completely turned me away from programming. If you don't know any programming concepts before going in Java will seem like way more of a hassle then it's actually worth.
Oh forget it... my point has been lost...
Java is NOT a good beginner language.
Now I jsut have to learn Python and Assembler and I'll be happy
Caveat: I am a C teaching assistant (T/A) so, my opinion is somewhat biased.
I T/A at a University, which has recently (last year) switched from C to Java as a beginning programming language. The trend that I have seen is that the students who learned C are, in the long run, better programmers; the fact that they were forced to learn typing and pointers as well as "garbage collection" (meaning not to over extend arrays, how to "un" malloc (free), etc.) seems to have given them a *MUCH* better grasp of programming fundamentals. From the student side, they seem to prefer Java - easier learning curve, and they learn to make pretty GUIs early. Unfortunately, this seems to be the big brunt of what they are learning since when they make it to C++ (required for Juniors) or the Unix Systems classes there skills pretty much vanish. We are also finding some difficulties getting Java students to really "get" some of the data structures such as lists, and b-trees, since they do not really have a solid grasp of pointers etc. It has really changed the way our second semester (data structures) class is taught and what the students gain from it.
I would lean away from any OO language as a first language - too difficult to explain polymorphism, etc correctly to a first year, and the enforced discipline of C or Assembly seems to make better programmers in the long run; let them learn java as an elective if they wish, but let's face it, systems are programmed in C and Assembly - EVERYBODY needs to know them.
"Would you like a jelly baby? No?"
Would you care for a jelly baby?
One of the interesting things I've noticed about CS is where various programs began. At Carnegie Mellon University, where I went to school, CS developed as an offshoot of the Math program. At other schools, CS developed as an offshoot of the EE program. (Both of these are gross oversimplifications and may be inaccurate, but please bear with me.) As a result, programs grow with a different foci; these differences have affected the curriculum.
At schools where the CS program developed as part of an Engineering curriculum, the CS focus has been on the architectural and EE aspects of CS, rather than on the algorithms. At these sorts of schools, you can expect to see classes taught in lower-level languages like C and assembly. At schools where the CS program developed as part of the Math curriculum, the CS focus is more on algorithms and theory. At these schools, you see more classes in higher-level languages like Scheme, Lisp, and SML.
Which method is "right?" I think it depends on the class. For example, it would not make a ton of sense to teach an operating systems class in a language other than C. The best language for a graphics class is probably C++. SML is probably a suitable language for a class in computer languages, and Scheme or Lisp is probably a good language for a data structures class. Personally, I find Pascal and Java good languages for Intro CS classes. For someone just getting started with computers not in a classroom situation, an interpreted language like Basic is nice because of its shallow learning curve.
Ultimately, I consider the choice of language in CS to be a moot issue. I feel that CS and programming are two different things. Programming is a craft and important in it's own right, but with respect to computer science, programming languages are tools, not goals.
--Sam
I am going to initially assum that this topic os not flaimbait against a C++/Java religious war. One of the most interesting trends college study of CS is the tendency of graduates to run out after their B.S. and go into the industry to become software developers. While there is nothing wrong with this, it does leave us to wonder who is really doing the important research in the field of CS. I am not trying to insult or harm anyone here so don't jump me. :)
If the purpose of the school is to turn out a majority of developers and generate additional income for the university then I can see Java becoming the prime system for CS Programs to work. While it is important to understand all the low level business of caching data and how the computer really works, what becomes even more important is results. Since Java is a modern language and comes complete with a large number of development tool that complete it's platform definition, the teachers also gain a strong level of consistency in teaching methods. While I had it the hard way in CS, I know that things must change as technology grows.
What I really want to know is what's next?
I am going to initially assum that this topic os not flaimbait against a C++/Java religious war. One of the most interesting trends college study of CS is the tendency of graduates to run out after their B.S. and go into the industry to become software developers. While there is nothing wrong with this, it does leave us to wonder who is really doing the important research in the field of CS. I am not trying to insult or harm anyone here so don't jump me. :)
If the purpose of the school is to turn out a majority of developers and generate additional income for the university then I can see Java becoming the prime system for CS Programs to work. While it is important to understand all the low level business of caching data and how the computer really works, what becomes even more important is results. Since Java is a modern language and comes complete with a large number of development tool that complete it's platform definition, the teachers also gain a strong level of consistency in teaching methods. While I had it the hard way in CS, I know that things must change as technology grows.
What I really want to know is what's next?
You are absolutely right. Java shouldn't be the only educational language. No language is so complete, so useable, so widely used, so feture rich that it demonstrates everything an comp sci degree needs to know.
As x approaches total apathy I couldn't care less.
I think Java is a fine education language for the following reasons.
It is cleaner than C++.
It is widely and freely avalaible. (though so are many other languages.
It is being used widely in the industry, and I think educational institutions have a responsibility to realease students with marketable skills.
As for performance, it is slower than some languages closer to the heart of a computer, but speed is not the point of an educational language, constructs and methodology are. And Java offers all the needed constructs and is good to teach the OOAD methodology.
As x approaches total apathy I couldn't care less.
Its a cleaner language than C/C++, missing the pointer and 'by reference' operators.
Its a good Object Oriented learning language, but only if you remember to actually teach OOP and not just "classes" and "inheritance." This means talking about program architecture and MVC. Some people claim that if Java were "truely OOP" it would support adding Integer Objects with a + or something. This is misleading. An OOL should avoid special cases like that, and a good Interger would have an add(Integer add) function.
Its cross platform compatible. Your students shouldn't need to worry about whether the code will compile on the grader's computer/OS. C++ that works on Mac may not like BeOS or *NIX.
What I'd really like to talk about though is what NOT to do with the language:
Group Projects: Don't go overboard with proving the usefulness of interfaces. A friend of mine at another school had to do a group project, and some idiot (another student or the TA, I can't remember) wrote out some horrible system using a hash table that wouldnt work given the concept of a hash table. The only thing that people will learn from that kind of thing is that the people around them are idiots. Save that one for Grad School.
Don't teach student about Linked Lists and Hash Tables by talking about the Sun package that implements that feature. Students are there to learn about data structures and algorithms, not Java Packages. If that means they're less likely to pass the Java Certification Level I, maybe Sun needs to rethink the Cert.
Don't go into great detail about hardware limitations and stuff like that. Its important to know, but Computer Science is mainly about mathematics, not Computer Engineering.
Don't test students over BufferedReader keyboard = new BufferedReader(new StreamReader(System.in)); its not worth the trouble it causes, espcecially if the class is going to get into GUI related stuff. The static methods in JOptionPane will suffice, and they give you an oppertunity to discuss why static methods are useful.
Having said that, I am only a second year student with a junior status, I have yet to experience the entire ciriculum, and I do not know how educators feel about the rigor and content of their classes. All I know is that after CIS 200 about 2/3's to 3/4's of the people in the class changed majors. A lot went into MIS (poor, poor students). A couple found a new home in CE, of course they still need plenty more CS classes as well. And this was without discussing the headaches like passing by reference and passing by value that C++ would introduce.
I Browse at +4 Flamebait
Open Source Sysadmin
The best introductory language is Python. Python provides a beautiful object oriented programming environment. To begin, a "hello world" program consists of one line: print "Hello World" as opposed to Java:
public class HelloWorld{
public static void main(String args[]){
System.out.println("Hello World");
}
}
Python does not use semicolons or brackets to group bodies. Instead, it relies on indentation. Such good programming practices can be carried over when prorgramming in other languages. Python's extensive module libraby helps introduduce students early in the learning phase about file input and output, string manipulation, regular expressions, and networking. Let's not forget about Python's graphical interface through Tkinter.
Python, it must be noted, is not a compiled language like Java or C. It is interpreted. As a result, the student can run code straight through the Python command interpretor. (Python is also a great scripting language) True, this postpones the details of compilers and memory management until other languages are taught but in the end it is introductory programming that you want to teach. Python provides the student with a strong foundation in the essential structure of a programming language.
SIGSIG -- signature too long (core dumped)
I took the grade 11 computer course last year, basically they started us in C/C++ until Christmas and then switched to Java. Needless to say most of the people in this class would not have gone onto do computer nor did they have any experience but I noticed a distinct lack of interest when we swithed to Java. I think it had something to do with re-learning everything but it also had something to do with them finding C/C++ more intuitive. The point remains, whatever you go with, especially at the highschool level, stick with it all year or you will loose half the class right then and there.
More imporantly if you want to keep as many people interested in computers, especially their first introduction to programming, keep the language simple, worry about whether or not a high level or low level expericne is better later.
the current language of instruction for intro computer science courses at dalhousie university in canada (www.dalhousie.ca) is java.
Teach them COBOL first. Then threaten them with a lifetime of doing that, if they don't learn Java/C++ well enough.
:)
Can't give any more motivation than that
Looks like you may be confusing ease of learning with ease of create a large-scale app with a given language. Learning assembly well enough to get a better idea of how a computer really works is significantly easier than learning and using assembly well enough to create the next Quake from scratch with it.
LEXX
"Gold still represents the ultimate form of payment in the world." - Alan Greenspan, 1999
In my not so humble opinion, a first programming class should be structured. I think the student ends up having a deeper understanding of what is going on behind the scenes when Java lets you import a hash table and populate it at will if you have written one in C, for example. I have also seen in my co-workers, who have done nothing but OO, not being able to solve simple problems with checking on return values from functions because they are used to error objects and the like. OO is great, and makes a lot of things very nice, but I for one advocate the use of a structured language as a first programming experience.
I don't see why everyone seems to think that people should start learning with OO languages/concepts. OO design is great if it happens to fit what your doing, but the truth is, in many situations, it just doesn't. When people begin learning to program by having classes and objects shoved down their throats, they begin to think that this is the only way to do things. Learning it later on, after already understanding some other design concepts could teach people to actually think before making something into a class.
I think that Java is not a good fit for learning low level internals of how computers work, operating systems, or computer architecture in general. Assembler, C, Fortran and other early generation languages are a better fit. To learn modern principles of software engineering, C++, Java, Object Pascal or Smalltalk are better suited for the task. Trying to teach OO principles with C or Pascal is very difficult, these languages are inheritely procedural and not tailor to the oo paradigm. Yet, there are areas where I believe Java excels as a teaching tool; one of these areas in Threads. Java's Threading constructs make it easy for beginners to grasp the basic concepts of concurrent programming while other languages like C and C++ make the topic extremely complicated. In conclusion, different languages are better suited for some areas of Computer Science. Also, exposure to multiple languages is an invaluable experience. Remember learning how to think recursively using Lisp or Scheme?. Java place is in Software Engineering, as an OO learning tool. Try to do highly distributed or peer-2-peer programming with C. Good luck. My 2 cents.
C is very different than C++ (not necessarily bad! I use C most of the time) and is NOT an OO language. Most introductory courses do not teach C anyway. I think a structural language (like C) or a procedural language (like COBOL) is the way to go for your first language (unless you want to become a web monkey, in which case VB will do for you)
I'm a signature virus. Please copy me to your signature so I can replicate.
yes, I refuse to use recursive functions unless I know ahead of time how many times it will recurse. otherwise you are limiting how much data the program can process. On a side note, a non-recursive solutions is NEVER much more work than a recursive one. and for those who try to use the towers of hanoi problem, I solved it in less lines of code with non-recursive than the example for recursive.
I'm a signature virus. Please copy me to your signature so I can replicate.
my first language WAS assembly, even worse x86 assembly.
I'm a signature virus. Please copy me to your signature so I can replicate.
The Rochester Institute of Technology is the university I attend. CS majors and many other majors have to take CS classes. CS 1 2 and 3 all teach java. CS 4 switches to C++.
The university claims that someone who has never written code before can be a CS major. Of course the first 3 computer classes they will take are CS 1 2 and 3. What I've found is that those who have programmed in any language previously have a very easy time with these classes. They teach object oriented concepts and the java language very well. The people with experience have a very easy time learning or even relearning java.
However, most people who have never programmed before have a very difficult time in these classes. Some of them work hard, or are able to understand the concepts easily. The rest fail. There were still people taking CS1 when I was taking CS3. Those were the people who didn't switch to being IT majors.
The reason for this I think is because java is an object oriented language. It is my belief that object oriented languages are indeed a fad. However not a fad like beanie babies or pokemon, they are a fad that doesn't go away. It will always be trendy to program in an object oriented language, however the real programming will be done in stuff like C.
Now object oriented languages are easier to code in, why would coding in C first make any sense? The reason is this. The first thing they teach you in CS1 (after they teach you to use UNIX) is how to use the static methods of the MATH class. They never teach the very basics of programming. People who weren't capable of writing a hello world were using objects. You have to teach the fundamental tools of programming before teaching object oriented concepts.
The structure of a file of code. How to print text on the screen. If, while, for, switch, int, char, double, float, String. People have to understand how to write a regular method before writing a class method. They have to learn how to declare a variable before writing a class with instance variables. The most important thing that is missing however, is pointers. Java has no pointers. When people have to switch to C after only learning Java, pointers fudge them up real bad.
So in conclusion Java is not a good language to learn as your first language. C++ is because you can be tought how to write code before you are taught objects and you don't have to change languages. Java forces objects, and therefore you can't teach fundamentals of coding without teaching object oriented concepts.
The GeekNights podcast is going strong. Listen!
I've some experience teaching programming languages at the introductory level, so I'd like to address some of the concerns mentioned above: Tulare.1: Java IS a fine development language, however, there are no instructional advantages over other computing languages. It will certainly help you as a programmer, since there is an increasingly large body of software written in Java, and Java development skills are vital to your CV these days. Tulare.2: It might be a fad, but it's probably worth adding to your bag of tricks. Tulare.3: yes Banjonardo: I feel sad that the CompAP at your school is swithing over to Java. There are real advantages to learning a language like C/C++ or even PASCAL or FORTRAN before learning a higher level language like Java. All of these languages posess similar syntax, and share most of the same basic control structures (which is really the most important part of learning to program). I feel that the most appropriate language to learn in an introductory course is C. It's perhaps the most successful and common computer language out there (BASIC aside). It's low level enough for the student to realize what is going on in the interface between the hardware and software. And finally, you can learn about the nuts and bolts of OOP and data structures from C. Of course, you can learn most of what you need to know about programming by learning PERL. Though PERL is a scripting language, it's a high-level language that will seem low-level for the beginner.
Those who can, do. Those who can't, simulate.
I listen to Java zealots defend their chosen language day in and day out as the best possible lanuguage for any possible application. They tout its speed, portability, and power.
What they fail to recognize is that Java application environments are horrible. For example: I hate trying to set up any of the Freenet software, just because of the pain in the ass involved in making sure I have the fastest/best/non-proprietary Java VM installed. There are many more examples of people developing software that relies of Java.
If you have any sense at all, DO NOT TEACH Java as an application language, just because that means the rest of us will have to use crappy JVM-dependant apps once your students find their way into the real world. Use C, C++ if you prefer to get your students wet in OOP before structured programing, or Perl, which offers both kinds of environments.
Installing or running an application should never be more difficult than writing one.
The next Slashdot story will be ready soon, but subscribers can beat the rush and slashdot the links early!
I don't think that teaching Java as a first language is a good idea, for the simple reason that it allows way too many crutches for the user. For instance, some people have brought up the fact that beginning programmers don't need to worry about memory leaks this way because of Java's garbage collection. Poing taken (and I know my first 2 years w/ C++ would have been a lot less stressful :)
However, there are some C/C++ topics that are just impossible to get around. Pointers, for instance. Instead of actually showing these beginners what pointers are and what they are good for, you simply tell them to use a reference, because references are magically delicious. That is the impression I got when I took my first Java class, and I remember feeling sick because of my experience with C beforehand.
Another good point to bring up is type safety. How can anything be type-safe in a language where everything is an Object??? I never really thought of Java this way until the past year or so, when I started dealing with legacy code that went something along the lines of: ooh, it's not the right type, I'll just cast it to an Object & then cast it back. Void pointers anyone?
This is not to slam Java. It wouldn't be where it is today without bring some pretty heavy firepower to the table, and in certain situations, it is probably the best choice for development.
I don't know what the best beginner language is out there, but I'll just say that when I started in school with C++, I was totally lost for about 6 months, and then one day it just clicked. Everything made sense. Ever since then, new languages, such as Perl and Java, have been almost trivial to learn.
You rush a Miracle Man, you get rotten miracles - Miracle Max, TPB
Well, isn't that special? I think you're absolutely right about the nullPointerException, but there is a significant difference between knowing an abstract fact - "Every object variable coded is a pointer," and actually having to deal with pointers and the consequences of screwing them up. An example occurred recently when I was trying to do a compareTo method on a Graphics object, which required an impossible explicit cast. I asked someone for advice, and that person said, "Well, just use a pointer." Great idea - in C. While I was eventually able to solve the problem, I really think it would have been much more informative for me if I were simply able to use the pointer, and see what happened.
And, quite frankly, I really resent the implication you made at the end of your statement. I'm as totally opposed to the Microsoft business practices as you are - my question was with an academic issue regarding Java programming as a teaching language - and since when did Bill Gates benefit from a CS department switching from Java to C++ anyway?
political_news.c: warning: comparison is always true due to limited range of data type
At my university we were taught how to program in Eifel (can't remember how it's spelt) first off. But at that exact time we were also taught to program in assembly. So I think we got the bet of both worlds. We got to learn about the High level OO design priniciples and how they are used to model the real world and we got to learn what was actually being done on the machine (via programming assembly.
As for your statement on VLSI.... they taught us that too. I don't know what engineering degree your talking about, but if they're gonna teach computer systems engineering then I reckon assemnbly, VLSI, signal processing, even basic digital Logic (AND and OR gates etc) are a MUST and I can't understand how you can call a degree that doesn't teach these an engineering degree, Maybe computer science but definitely not computer engineering.
The main question is the final goal. Are you trying for academic or trade success. That is are you trying to teach How to program or to Get a Job.
There is a huge difference. You can get a job programming in language X (For most X anyways) without knowing how to program. However if you know how to program, you can learn language X (For all X) in short order.
It would seem that if you want to get a job, C/C++ woulud be the better lang for you to learn. It is firmly rooted in a low-level environment and more forgiving of lack or order or structure (generally).
If you want to learn how to program though java would seem to be a better starting point. You can more easily reach higher level concepts, OO, Program Architecture/Design, Data Structures, and Algorithms without have to worry about the lowlevel items. Once you have a firm grasp of these concepts it is easier to learn the lower level hardware concepts. Plus once you do, you should already have a sharp view for design elements that can easily be forgotten in C/C++.
To learn to program you should probably go the route of: Boolean Logic - basic understadning of binary and logical concepts. Java - intro to language leading into OO design and program architecture. After that take Algorithms (focus on basic algorithms and algorithmic analysis) Then concurently take advanced algorithms (Graph Algorithms), and Data structures ( De-Queues, queues, stacks, tree/graphs, heaps etc). Then learn C/C++ concurently with Basic Hardware (Flip-Flops, adders, 2's complents and such). Finally do OS Design/Compilers along side of advanced hardware (RISC pipelines, cache etc). Then you will *know* how to program. Also throw in comparitive languages in there eg lisp, ml, asm, language design etc.
If you really want a job learn to program VB. You'll be brain dead, but so what. It pays.
Agreed. While C\C++ is a good language and lies at the root of Perl and Java it and the imperative paradigm is not the center of the programming Universe. Without exploring languages from other paradimgs such as prolog, Haskell, etc one cannot get a good feel for the different ways to approache a problem. This tends to lead people into such dogamtic fun as the belif that recursion in all forms is "just plain wrong" as my C\C++ teacher put it.
In terms of which language to start with Java has the advantage over c in that it's syntax is cleaner and has less of the fun archaic elements such as the need for heavy pointer arithmetic. This makes the into learning curve too damn steep. Unfortunately it too is limiting to the iterative world. I'd recommend something like Pascal which was written to be a teaching language (if you must stick with imperative).
IMHO the best language to start with would be Lisp. It is more mature than python. It is quite tolerant allowing the students to play with less pain. It includes higher level elements such as lists that allows people to get into real programming in shorter order. Rather than forcing them to put off any real programming until after they have mastered the arcane nature of c's memory allocation. Lastly and most importantly as a teaching language it can be used for purely functional, purely iterative, and for object-oriented programming. Thus you can introduce your students to three of the major paradigms (you can do some Psudo-logic programming in it but it just isn't the same as prolog) under one roof. As a result the excess learning time is lessened.
Irvu
I recently graduated from a high school where i took 3 years of computer science. my 1st and 3rd year were C++ (3rd year was AP). The second year was a semester of Java, and one quarter each of c++ and VisualBasic (VisualBaSUCK). I think that java was a much easier language to learn on. It combines the rapid development and graphica advantage of VB and the power of C++. The java language seems much simpler to follow and understand than C++ or VB. Many of the skills and concepts that i learned that seemed specific to java or C++ actually carried over well between the two. Classes, functions, and formats were almost the same between the two. Java is also a household name beacuse of the internet, the average student will be more likely to take an interest in java because they have heard of it while looking for porn. hehe.
What it comes down to is that Java will be the langauge de force in about 5 to 10 years. Switching entirely to java now would be a bad step for students wanting a carrer in computer science because C++ will remain prevalent for years. On the other hand students who are now in junior high or elementray school should be taught java because by the time they hit the job market java will be more common.
I hope this helped, I know the original question was for the college level but college students have to make it thru high school first.
You should not teach assembly first. Just because you have more experience now and you "know" where newbies are going when they learn to program doesn't mean you feed it to them all at once.
This is the same kind of problem you see in mathematics. Math professors know so much math that when it comes time to teach people who are slower or less knowledgable, they assume that teaching them the "real way things are" is the best way. This isn't the best way. Whatever you're doing may have some deep background theory that explains the "proper" way of doing things, but it isn't a good idea to make the students learn that first. It will just turn most of them off. If a body of knowledge has useful mechanics, you should teach people that and skip (most of) the deep background theory until they have the mechanics and some of the less deep theory down.
Did you take calculus? Did you enjoy the sections on Lebesgue measure and integration? What? You mean you took a class in calculus where they taught you how to "differentiate" and "integrate" and they didn't tell you what's _really_ going on? Oh well, it's too late now. You've picked up bad habits and these habits can't be remedied by having more advanced courses teach you the real way things work later on. :P Oh Puhleeeaase.
If your goal is to make an elite society of 31334 C0d3rz where only the truly gifted and dedicated are ever taught to use a machine, then fine do that, but don't be surprised when most people drift away. If your goal is to try to teach a larger body of workers, then you train them in such a way that you give them a foundation of useful mechanics, and then delve into the deep background theory later. Then that deep background theory (assembly) will have meaning, and they will see how it's used so they don't get scared away.
Best. Comment. Ever. Enjoy!
Knowing assembly
like a modern day wizard,
yet girls don't like me
The only thing that we learn from history is that nobody learns anything from history.
Java is fine to learn with, hell, its even a good language for 'real' stuff.
Where Im at, we started with Java and then went on to C++ where some of the assignments included: "design a garbage collector", "write a filesystem-API" and "code a compression tool".
Java is great for learning how to program, because it has less obscure errors (it will TELL you where things went wrong instead of just core dumping) and has a very good API (I really love that about java)
And besides, one of the basic things you should learn is: If you have a tool which can solve your problem in time and within the budget, go for it! Hell, I'll use VB,Fortran OR Prolog if those tools allow me to complete my project! It's not all about "l33t f4st c0d3 which makes me feel smart". You should use any tool at your disposal to meet the requirements of your project.
Students should learn to program in general, and they should touch as many programming languages as possible, so they know 'its out there', but they should also know there is no 1 all-solving-language... choose the best language to meet your needs.
But I wouldn't recommend it as an intro to programming. The first language you learn should be very strict and require good programming practices.
I think the best way to get into programming is by starting with C (to learn basic programming stuff), then moving on to C++ (for your object-oriented stuff and pointers) and then Java (to learn about the AWT and threads and such). Granted, what I suggest learning Java for can be learned in C++ too, but I think it's better to branch out to a slightly different language at that point to learn how different languages are similar yet different.
The reason I think C is a great starting point is that you can't get away with a lot of tricks in it. You have to define your variables at the start (unlike VB, which teaches students to program poorly). Students don't dwell on making listboxes and buttons, they work on sorting arrays and file i/o and sentinel loops (while (i!=0) {scanf(i); j++; k[j]=i;}) and they get a feel for how the computer "thinks." C++ then gives you abstraction, like linked lists and classes and private members and overloaded constructor functions, but you're still using the familiar C syntax. Java, then, turns everything into an object and students have to learn that main() isn't a function, it's an instance of class Main inherits Applet or whatever, I don't remember any more.
I really hate signatures, but go to my website.
The refused to budge. I took FORTRAN. I have never used FORTRAN. It was so much like BASIC on my old C64 I wanted to cry. I learned NOTHING (or, at least that's how it felt).
The next year, the cirriculum was changed to C/C++. I was rather pissed.
I am by no means a good programmer. I'm not even a crappy programmer. I do almost no coding. But, every time I look around, I feel that had I learned C I'd have been better off.
I've played with Perl, I've played with Python. I've not played much with Java. But even with just playing, it has felt more useful than what I had gotten out of FORTRAN.
Hi! This is the Sig, blatantly attached to the end of this comment.
I believe that those who advocate initiating new programming students using a low level language such as C are mistaken. The important points to get across to fledgling programmers are:
- Programming is both an intellectual pursuit and a practical one. A programmer can ascend to lofty heights of mental exercise, write a program that's actually useful, or, **at a sufficient level of understanding, do both simultaneously**.
If the curriculum concentrates exclusively on theory, the new student is likely to lose sight of the vast utility of programming; if application is overemphasized, students may never realize the potential intellectual rewards of the activity, and risk becoming bored. Neither the blinkered utilitarian nor the soaring theorist will ever achieve a balanced view of programming if he loses interest after the first class.
- The essence of software development is design, not coding. In most situations one should plan the strategy, and only after having done so apply oneself to actually writing compiler-comprehensible code. It is crucial that novice programmers learn disciplined thought processes that are independent of a particular language. Languages are the sum of syntax and libraries; problem solving the quotient of creativity and discipline.
Genius algorithms do not comprise a solution unless they're integrated in a disciplined manner. On the other hand, well integrated but clumsy algorithms ("the naive solution") will often accomplish the task correctly but not efficiently. If resource utilization is prohibitively high or the programmer wants to produce the tightest possible code as a matter of pride, optimization can be addressed at that point, but it should have little or no effect on the overall design of the system.
Dumping the mechanical details exposed by C on new programmers (especially at any pre-tertiary level of education) before they possess a high level understanding of the process of programming is tantamount to introducing first graders to the joy of reading with Shakespeare. Yes, the Bard is a supreme sculptor of the English language, which springs from the tip of his pen to peerless heights of vigor and nuance. Youngsters will benefit not at all from this spectacular show of finesse if they're unaware of why literacy is valuable, why some of us *love* to read, and they lack the basic skills required to digest written material.
Beginners should learn to read street signs, basic instructions, and simple stories with which they can personally identify. Depending on the student, this may or may not stimulate an appetite for more complex literature, but in any case basic literacy will prove useful. Advanced students of English--especially those who aspire to become professional writers--should tackle the likes of Shakespeare.
By the same token, novice programmers should be informed of several different reasons (e.g., utility, mental exercise) why people find programming rewarding. They should be assigned simple but stimulating exercises and be guided by the teacher through the basic processes of software design. Ultimately, if they aspire to become professional programmers, they should learn the nitty-gritty of the mechanical level and the subtle intricacies of the algorithmic pantheon built thereupon.
Forcing mechanical details such as pointers and strings that must be addressed directly as arrays of characters down a newbie's throat is like springing Elizabethan English and subtle symbolism on a barely literate child who can't even comprehend the instructions on a medicine bottle.
Erlang.org: wow
The junior people usually have more education than myself, but they don't know how to build something.
I think that the first thing that schools should do is a class in suspension bridge building. Make the potential CS student design and build a bridge across something with about a mile drop, and when they are done, make them walk across it.
This would ensure that the kids that get a chance to sit down and start hacking have some concept of the process of design->implementation before they start cranking out crap code.
Whatcha doooo with those rollin' papers?
Make doooooobieees?
When I were studying CS, they usually didn't offer something like "Programming in XXX", "Fundamental of XXX". They usually went straight into "let's do this assignment in language XXX". The best they could do was to provide reference materials of this languages.
:D
I still remember I've to program in ADA, which I never heard of before, in Software Technology course, for a section about OO(OO was very new then). No one taught you how to program in ADA, and I must admit it was fun.
It's very different nowaday. When you design a course which requires students to program, you must offer a seperate programming course as a prerequisite, or spend enough time to teach them programming in that course.
I were involved in the design of a course Computer Architecture for a local university. There is 2 assignments for programming in 68000. The course coordinator said since we don't have a seperate course for 68000, we must spend enough time, say 3 weeks, to teach the students how to use 68000. That would greatly affect the content of the course, but I failed in the argument. "May be that's today's trend, may be in the future we must spend enough time to teach students how to do mouse click" - you guess, the CC was VERY unhappy about it.
I think you shouldn't whine when you school don't offer the language course you like. If you want to learn a language, learn by yourself.
I had a lot of computer background before I got to college, tho, so C didn't intimidate me. I'm probably biased.
Is not used the Cliff used it. Misuse of this expression is one of my hugest pet peeves...
I must burn in hell, suffer and pay for my sins
But Gods the one who's losing, Satan always wins!
Free as in Free beer... http://www.mindview.net/Books/TIJ/
This is a real book, not a 15 page tutorial.
Nobox: Only simple products.
>8) Allows direct memory manipulation
>9) Disallows bad things like pointer manipulation
Direct memory manipulation without pointers? Want do you mean? Manual garbage collecting?
>10) Is assembly language
Duhh ? Why ? I know how a computer works, down to the CPU level, but I can see at all how such low level knowledge it could help me how to program in today's world (Ok IO from RAM is faster than IO from disk)
Seems to me like Java fulfills all your needs (well ok it isn't technically compiled), even if others could too (I'm thinking Python here).
Nobox: Only simple products.
Remember that most software development is bespoke (i.e. it will never get out of the company that wrote, for whatever reason).
.NET...), thanks to Enterprise Java Beans and XML.
And I can tell you that whenever number crunching is not required, Java takes over. Java on the server is really gone rule the business world for the next 10 years (unless
As a learning language, I would say that Java being easier to learn, it's easier to teach OO concepts with Java because you don't have to make sense of this huge thing call C++ first.
Nobox: Only simple products.
I agree with Chris. With a solid understanding of the low level aspects of the machine, OS, and language, learning a language like Java or Smalltalk is not a large hurdle. Someone who has been working with Java or even VB only typically is lost when asked to learn C/C++. Because of a lack of understanding of the machine, OS, and language, many more errors are created and frequently the approaches are flawed. This is a pattern that I have seen repeat itself over the years I have been in the industry.
I hope the "training for industry" professors won the battle. Too many CS graduates graduate without actually knowing how to program anything. Programming is programming its not a glorified "science". Real science is Physics, Medicine, Sociology......etc, NOT Computer Science. What use is a CS graduate to a future employer if they can't program in ANY language IMMEDIATELY after graduation?
Mac OS X and Windows XP working side by side to fight back the night.
Its the FEW remarkable CS teachers like you who even if they don't like it actually give their students the SKILLS they need to get hired. All the other professors want "learning for learning's sake" but thats not practical in the least. How is someone supposed to be a programmer if all they've been taught is theory and no practical application? Also how is becoming proficient in one or two languages early on suddenly make you unable to learn others? Most CS graduates are nothing but "potential" programmers who never actually deliver. Its also probably why so many current and successful programmers have majored in completely irrelevant fields such as History, Economics, Drama....etc. They know how to program cause they taught themselves! I so wish the University world would wake up to this fact.
Mac OS X and Windows XP working side by side to fight back the night.
Or rather took java in my intro cs classes. Alot of my friends who programmed before complained alot about it. How only applets and games were made with them, (bigoted opinions).
I liked the language, taught me alot about the OO concept. The garbage collector is a convience for those beginner programmers that would have to constantly worry about making a garbage collector, although, it would work against them in the future, being forced to learn it when they learn another language.
Java is an easy language to learn, compared to C++ and C.
One more thing, UMLs, if you want to teach how to make programs, my school puts in the idea of good design = good coding, so we have to sometimes make code from UML. UMLs were a help in learning the OO concept.
Slashdot Hypocrisy at work?
Here's the order I learned: High School AP Comp Sci: Pascal High School AP Data Structures: Pascal College CS I and CS II: Java College CS III (programming in the large): C++ I can't honestly say learning any of these languages was easier than any other. The topics and algorithms being taught were of varying difficulty...here's what I mean: Does teaching someone a dynamic data structure like a linked-list or an algorithm like a quicksort happen better in an object oriented language? I don't think so; infact it may confuse the topic. Python is damn cool, but I was never taught that in school, I had to learn that on my own. The language was a secondary consideration to the algorithm. -ted
Pascal or a structured BASIC are proper introductory languages. They easily demonstrate the fundamentals of programming. Once learned a person can get out the manual in any other language and find how it is done in the other language.
C should be taught after the introduction for no other reason than the availability of compilers for so many platforms. And that is not to teach a trade as would be Java but as a working language for the rest of the degree program. (I don't use C, so no bias.)
In the degree work exposure to one or more other langauages such as Lisp, Java, Forth, Perl, C++ and others not for their inherent value to to impress upon the student there is more than one way to skin a CPU. And certainly some place along the way a seminar on choosing the best language for a project.
Java is highly unlikely to be more than a passing fad. And even if long lived four years of college is a significant fraction the life of even a long-lived one.
C shows no signs of disappearing, not even waning the the face of the newer languages. It expanded to C++. Pascal has been through two reincarnations whether or not you like it.
It would be foolish, as far as preparing students for the workplace goes, for the Universities to cut out C++. A recent report from a consortium of HR and recruiting firms showed that Unix was the most in demand skill, followed closely by C++ in the runner up spot. Java was down at about 5 or 6 on the list of about 25. Anybody got a link to this report? It was about 2 months ago.
Crowded elevator smell different to midget. -Chinese Proverb
CS is not about writing programs. It is about problem solving and computation. Java is no more appropriate than HTML in this sense.
However, since writing programs is the method of dealing with the above issues, it begs the question of what language would be the best to teach.
Ideally, a good language should have at least the following features:
1) Enforces good design
2) Supports procedural programming
3) Supports OO programming
4) Is compiled
5) Is interpreted
6) Is useful outside academia
7) Is limited, to provide students an easy foundation
8) Allows direct memory manipulation
9) Disallows bad things like pointer manipulation
10) Is assembly language
In short, no one language is good enough to take a student through all four years of schooling.
Dancin Santa
Java is going to replace C/C++ at the University of Washington starting next year. I don't think that's too good of a thing to do, when the majority of programming jobs use C or C++.
I took FORTRAN on punch cards for my introductory programing class. I still use it. Almost every business school academic I know programs in FORTRAN. I got my PhD at a top school in 1996 and all my professors and all my classmates used FORTRAN. The big information providors (e.g. S&P) still send FORTRAN shells for accessing data. Of course most of us can't program very well but FORTRAN is very simple and, for many tasks, it gets the job done.
I have never in my life had a problem with running C++ code written using the Borland C++ tools on my GNU/Linux or NetBSD machine. I /have/ had troubles when people have been using extensions to the language, or as you call it "Borland C++ programs". The point is: Those programs are not C++. They are "Borland C++ programs". Those two things are not the same.
I think you pointed out some great reasons that Java should be used in the class room rather than C++. Rather than trying to explain to the students what parts of C++ are standard and which ones are not, the students can spend the entire semester learning object oriented concepts. Although I think it is very important for students to know how pointers work (which they would learn in thier C class), I don't think they are going to learn pointers and understand the power of MVC in the same class.
ps: About your sig: there _are_ no old Java programmers. Sure there are... I work with one guy who's 38!
If you want to get anal about the wording, OOP would better be described as a design pattern. Yes, you could teach it in Fortran. I not only agree, but I think that type of exercise would be good for students. I think we are looking at this from different perspectives. You seem to want to train C++ programmers. I just want programmers who know object oriented concepts. I think teaching students OOP early is the best time. They can learn easier before they have the preconceived notions that come with experience with procedural programming. I think of it as teaching a foreign language to a child. The best time to teach them is while they are young... before they rely on the crutches of their native language.
There's no shortage of Java work. However, it's not all in the most interesting areas. My company works with both Java and C++, depending on the particular area we're working on at the moment, and we're constantly turning away people with only Java experience. Some companies only work with Java, so they're ideal for those kinds of programmers. But larger companies with more diverse projects tend to look for people with multiple skills.
Again, if it were easy to go from Java to C++, this wouldn't be a problem. But for a programmer who has no experience with C++ or even C (ie, they aren't experienced with memory manipulation and the wonders of header files), making such a transfer is difficult, and most companies don't want a programmer learning these concepts in the middle of a project (can you say memory leak?) It's much more reasonable to expect a smooth transfer from Java/C++ to Perl or Python than from Java to C++.
Second, the point of a CS education should not be to learn the most popular language, but to learn the concepts of programming so that you can easily pick up new languages as required.
Absolutely. People have lots of time to pick up new languages after they've taken an intro class. I would withdraw all of the arguments I just made if I felt that Java were also the best introductory language. But I don't, and the reason again comes down to the fact that Java lacks certain basic concepts that you become accustomed to when you learn C or C++, concepts that you should understand long before you mess with OO. I also find that the Java intro classes I've seen have a hard time staying away from OO early on, and this confuses people when they're still trying to master subroutines.
The best course, as far as I'm concerned, is to begin with C because both Java and C++ more or less rip off C syntax. Learn the basic concepts, including pointers and work your way up to abstract data structures (which is more or less what OO really is.) Then go on to Java or C++ as you see fit.
Java's like candy-- it takes care of so much of the annoying stuff that C++ programmers get used to dealing with. While C++ sucks in this way, if you're looking for a high-performance language you can't rely on a system with garbage collection and run-time linking. Not to mention that truly understanding what's going on with memory and pointers, while posing a steeper learning curve, really helps you understand how the machine deals with your programs.
The son of a master thief asked his father to teach him the secrets of the trade. The old thief agreed and that night took his son to burglarize a large house. While the family was asleep, he silently led his young apprentice into a room that contained a clothes closet. The father told his son to go into the closet to pick out some clothes. When he did, his father quickly shut the door and locked him in. Then he went back outside, knocked loudly on the front door, thereby waking the family, and quickly slipped away before anyone saw him. Hours later, his son returned home, bedraggled and exhausted. "Father," he cried angrily, "Why did you lock me in that closet? If I hadn't been made desperate by my fear of getting caught, I never would have escaped. It took all my ingenuity to get out!" The old thief smiled. "Son, you have had your first lesson in the art of burglary."
You never truly understand memory management until you've debugged a leak, uninitialized pointer, or segfault. A hobbyist programmer may have no need to understand this, but it should be one of the first things a CS major learns.
First off, a little history. I began attending Western Kentucky University (a pretty good CS school at the time) as a CS major, and proceeded to ace my CS I and II courses without breaking a sweat. My second year, I lost interest in school, and managed to cut my cumulative GPA in half (Yes that means I took an entire year's worth of classes, and got a 0.0 my second year.) I am currently attending a local university (Grand Valley State University), slowly finishing my CS degree at nights. I'm a professional programmer doing mainly VB client-server and ASP work (yeah, I know, Microsoft == the devil.)
When I was at WKU, the beginning CS curriculum was taught in Pascal, and now at GVSU, the language du jour is Java. While the languages are different, the curriculum is essentially the same. First year CS is not about learning the ins and outs of a specific language that you're going to use for the rest of your career. It's about learning how to approach common problems (like sorting and searching), and learning how to break large problems into smaller, more easily managed problems. These skills are used across languages, and will never die. The exact syntax you used is subject to change.
In my experience, the first year of CS courses really serve two purposes: Teach students how to program, regardless of language, and weed out the undesirables. Perhaps that's somewhat high-and-mighty of me, but I've been through two CS I courses (GVSU didn't want to transfer my WKU CS courses, so I learned the difference between integer and floating-point variables twice), and watched the students who were in the class for the wrong reasons drop like flies. Twice.
It's not because Pascal and Java are hard. Programming is hard. Problem-solving is hard, and the first year of CS courses should make sure that bad problem-solvers change their major. Anyone can sit down with a book, and memorize the syntax of a programming language, but it takes a special breed to be able to apply that syntax to do something useful. After a year of CS, any remaining student should be able to do that.
C.
I can do anything in C, including implement 00 recompilers if I want to simplify some code files.
The bug is that this is an intro class.
Does that mean it's a gut course, taken by people who will never take another formal class but need basic real-world skill? Or does that mean it's a foundation in the vocabulary and skills needed to make the journey through the meaty classes to follow, but not necessarily to enable any real-world proficiency?
Those are different goals.
In the former case, I'd go with a language that sits at the highest level and has the most intuitive interface. Believe it or not, this is National Semiconductor's LabView. Drag-and-drop coding, almost done right. G2 might be okay, too, but last time I saw it in action, it was several thousand dollars per developer seat, several hundred dollars per runtime license, and two major revs away from being high-level clean.
If the latter goal is needed, I'd want a spectrum of knowledge. Assembly to teach what the native objects and operations are in a computer. C to bridge the gap between a machine schedule and a language. And Smalltalk rather than C++ to show off the power of OO. Save it for the second-level course offerings.
The problem with Java is it's weak. The problem with C++ is it's been sold primarily as as OO but it's bloated with stuff that has nothing to do with OO. It's a buff and a polish away from MainSail, the language built by hacking in every Stanford AI Lab student project since 1969.
--Blair
"Please leave your hymnals on your pews."
- Hardware/OS/Device Level Students
- Application Level Students
I also acknowledge that many students will fit into both of these categories, and such students should be learning both types of languages. A good programming education for a computer engineering student should probably encompass both Java and C/C++ IMHO.This group encompasses electrical engineers, computer engineers and all such people to whom how the computer is actually going to go about performing an action is important. These people need to be taught in a language that is implementable in hardware, such as C. This was the lesson in my Uni, when after a few years of only Java in 1st and 2nd year courses, people were freaking out when it came to operating systems and wacky concepts like pointers, memory management and the like....
This group encompasses the type of people who want to talk about information processing, and to who OO deisgn and such things are important. This group of people don't care much about how the computer manages classes, except that they can write them and that it does what it's told. For this group Java is a fantastic language for it gives all the OO design etc... without the memory management etc.. hangovers from C that are in C++ .
Say what you like about Java, it beats COBOL. It also beats Visual Basic, which I know many high schools are teaching. Count your blessings.
My opinion is that universities should stay away as much as possible from commercial bastardisations as humanely possible. There is a plethora of open languages that can be used in introductory courses. Python isn't a bad example. There is also something to be said for understanding pointer arithmetic in C. Most programmers bred on java have little understanding of underlying hardware architectures and it often bites them in the ass when it comes to real world problems. Java is also not as elegant as Sun Inc. Containers that just store Object(s) are a nightmare on larger projects for instance. Java's reliance on reflection is also a sign of bad OO design. C++ at least offers a partial solution to the problem in the form of templates and the language itself is not controlled by a single organization. Also its multiparadigm structure allows students to get grasp of concepts other than OO. It's not an easy language to learn and may not be the optimal choice for courses in a community college but all self respecting universities should think twice about picking Java as their teaching language. They should be training scientists not code monkeys.
Your pizza just the way you ought to have it.
I go to a relitivly small college in upstate NY. A Semester before I became a CS major there was a major shift to using Java as the first language encountered. I didn't like this at first, Java is relitivly ugly and the syntax is only slightly less obfuciated then PERL, but after a number of Semesters dealing with Java on a daily basis I understand why the shift was done: Java forces you to code in a fairly specific way, that being OO. Trying to learn adapt to non OOP can be a daunting task, as I have now experianced.
Enforcing good programming habbits early is very important, and without a backbone in Java I'm not certain that I would have recieved this. Since learning the real ins and outs (or should that be System.in and System.out ?) of the language I have come to appreciate it.
There are many positions on this issue to be sure, but the important thing is that people need to learn somewhere. I think that it's better to learn the hardest way of doing something before learning that there is a better way. For example, I work with PERL now on a daily basis, and readablity is one of the things that I spend the most time looking at. The old adage: "Thouugh a program be but one line long, someday it will have to be maintained" is one that I take very seriously (especially since I'm now working as a QE intern).
I am a high school student, and completed an AP computer science course a year ago. The thing that you forget, when you suggest that multiple languages be emphasized, it that the students have approximately 4-5 hours of class time, and 4-5 hours of homework for a given subject in a week (at least in my school). I knew a bit of Java, a bit of C, and a lot of Basic before embarking on a mission to learn C++. By the end of the year, I wrote some games in which the computer had rudimentery intelligence, and could learn to beat me at Yachtzee. If I were forced to learn, as you suggest, the libraries for several different languages, and the quirks of themk as well, would it have been possible for me to write a progrm in any language with such a degree of sophistication? Not likely. When setting the AP curriculum, educators re trying to determine which language can best introduce the most sophisticated concepts in the least time. I like the idea of using Smalltalk, because from what I know of it, it would encourage this, however, my guess is that somebody on the AP board liked the idea of using a language that's used in real life. They saw it on the bottom edge of their web browser.
My Karma is so good, I'm the Dalai Lama...or something.
I think you mean "interactive" rather than "interpretive".
Actually, I was primarily addressing the question regarding college CS, not the part about AP programming. I don't expect that one should necessarily pursue several languages in one course. But in the course of working through a (let us say) eight semester college CS degree, one surely has enough time to learn a goodly number of languages. As I suggested, Smalltalk would be good for a course emphasizing OO programming and concepts. A nice functional language like ML might be good for algorithms and data structures. When looking at lower level issues one could work in the context of C and assembler. And so on. And one gains because one is actually using tools appropriate for the problem at hand. I don't think it's an unreasonable thing to ask that a college student majoring in CS learn a language or two a semester, especially when it is relevant to the topic actually being studied (where we realize that the languages are indeed most often secondary to the other concepts being expressed).
As I qualified before, I did not go through a CS program, but this is more or less what I would want to see (and be willing to do) if I did. (And who knows, perhaps someday I'll get the chance. :-)
Well, I agree with you about Lisp. The language I use most is Common Lisp, and I feel it works very well on a wide range of problems (yes, including real-world ones, for the skeptics out there). If someone had merely asked me what I'd recommend as a first language, it would be my pick. There seem to be a lot of lingering prejudices against it though (which seem to be mostly based on the state of Lisp 20-30 years ago); if there's any one result that I am grateful for coming out of my lack of formal CS training, it's that I never picked up this bias and thereby missed out on Lisp. :-)
Well, at the risk of just making up numbers, let us say that one gets significant exposure to six or seven different languages and has to take 12-16 classes that involve programming of some sort. Then isn't it pretty likely that at least one of them is used for three semesters? (Especially considering the likelihood that in the later semesters there is some sort of specialization in the direction of study.)
I think this is a red herring. Learning a syntax ought to be relatively easy for a CS student. And presenting a concept in a suitable language would seem to me to emphasize that concept. Let us say that (just as an example), the introductory course is in C. Won't the concepts of OOP come through better in Smalltalk? Functional programming and its related issues in ML? AI in Prolog or Lisp? To understand what is going on in the hardware with assembler? I agree that the language is not the main point - I don't advocate learning a lot of languages just for the sake of knowing a lot of languages; the point (IMHO) is that using an appropriate language makes it easier not to be distracted by the language itself and to see the important points and concepts of what one is actually studying.
It's interesting that you should pick this particular example. It's one of the early examples in Ullman's Elements of ML Programming , for example, and I don't think it's all that difficult.
The reason I mentioned ML in particular in this context is that ML datatypes can correspond pretty naturally to abstract notions of data structures. Then algorithms on them are often easily expressed using pattern matching. Once again, it is (IMHO, of course), a matter of picking the language so that language issues avoid clouding the real concepts, which here are (IMHO again) understanding how the structures and algorithms are useful and how to analyze their properties. (You are of course right that there are some potential difficulties (or perhaps it would be more accurate to say differences) if one commits oneself to remaining exclusively in the functional realm; however, I don't know if I really believe that this is that much of an issue for a first course in data structures and algorithms.)
(As an aside, let me plug Okasaki's Purely Functional Data Structures as a reference for data structures in functional languages.)
For the express purpose of teaching OOP, why not use Smalltalk, which makes it difficult to fall into other methodologies and easy to use OO techniques?
But as a greater question, why restrict the field to one or a few languages? I'd think that in a CS curriculum (I insert the disclaimer that I came from mathematics and not from such a curriculum) one would want students to explore as many languages and paradigms as possible, ranging all the way from assembler to Prolog. This would presumably encourage a student both to develop many different ways of thinking about any given problem and to be able and willing to select an appropriate tool for any problem encountered. Far too often we see (as evidenced by responses on Slashdot to articles like this one) that many people are rather narrow-minded about language selection and unwilling to deviate from using their one pet language. Why not start to discourage that immediately in the course of formal CS training?
I first learned how to program in PASCAL, which is a largely worthless language for the world of work today but a very good teaching one. It has protection built in but not garbage collecting. For the most part, I didn't have to even worry about such things until much later (like at work). After you've learned a functional lanuage, picking up OOP is pretty simple but people do have to change their mentalities or you end up writting crappy OO code. I've always thought teaching a functional language was better for a first time programming course.
A far BETTER thing is to get away from windows and go back to fscking UNIX for teaching. For one, it's MUCH closer to the OS and much more helpful when learning programming. I learned PASCAL on a UNIX system. 30 students or so were all telneted into 1 server and developing their projects. 2nd year programming moved to C. Since dividing my 0 can take down the entire development system (at this time anyway), it wasn't taught until you had a good idea of the basic concepts of programming. My college switched from UNIX to NT as a programming environment for the introductory programming course and, as a TA of the course, the students didn't appear to learn nearly as much. At times, I wonder whether the development environment is as important as the lanuage taught. Regardless, I've always felt you get a better understanding of programming when taught a functional programming language. If taught correctly, you can teach OOP concepts in a functional lanuage to make moving to C++/Java even easier.
Khyron
Honestly, I think Java is a good compromise. It is OOP, although more or less OOP is debatable given that it doesn't implement multiple inheritance.
Remember that we're talking about a beginners class here. C++ would put them into shock. The other alternatives are few, and not practical. For those who don't think there is money in Java, take a look at the sales of BEA Weblogic and IBM Websphere, and the corresponding numbers of developers programming on those platforms. Java is here to stay, the momentum has reached critical mass.
So, start 'em off with Java, and then toughen 'em up with C++. But for God's sake don't start with Visual Basic! (as I have heard some schools do)
"What are we going to do tonight, Bill?"
www.lucernesys.comHorizon: Calendar-based personal finance
Our computing science department switched to Java for first year programming courses a couple of years ago, much to the dismay of most of the professors.
The idea that teaching it because it is "easy" is the wrong way to think about it. People learn and retain more when they are challenged. If it all comes easily from reading the API docs, retention isn't going to be as high.
Furthermore, OO seems to be the golden child of programming these days. In our curriculum, however, OO design philosophies are not taught until at least the 3rd year, and then only the surface is touched (there is an in-depth 4th year course in OO design). A lot of good that does to people taking Java in their first year - that's 2 years to develop poor habits!
I remember talking to a couple of profs (both who are well-respected and rather famous in computing science, as are many of our faculty) about it. They both referred to Java as "C++--" and seemed to be totally against it. They urged me to go to the meeting about it saying that a student saying they didn't want it would be worth 1000 professors saying they didn't want it. Alas, I never went to the meeting - I wonder if it would have made a difference...
Why was I opposed to it? Even at that point in my academic career, I was of the opinion that the first language to learn should be an assembly language. Then maybe C in the second year, Java and C++ in the third. Only then would you have a real appreciation for what each languages' strengths and weaknesses are. When something "just doesn't work" in C or C++, you'd have insight as to WHY it didn't work. You'd really understand different addressing modes and how data is stored in memory.
One of the things that pro-Java people put forward is that you don't have to worry about garbage collection. Is this really a Good Thing though? Maybe, once you understand WHY you need garbage collection.
I dunno... What do you wanna do?
My old high school actually taught HyperCard in a "computer technology" class, concurrent with Pascal in the "computer science" class. (This was 92-96.) I thought it was valuable, getting the two different perspectives, plus it trained us to think in terms of hypermedia.
I agree that you need to know how a computer works at the low level. But this does extremely little to help you design software with typical real-world requirements - you need to also have experience thinking at a high-level, where the design of software systems takes place. I know many programmers (usually with electronic engineering background, where software development isn't emphasized) who know assembly etc very well, but don't know even the most basic things about object oriented programming, and it really shows through in the software they produce (e.g. having the base class know about ALL types of derived classes and using a "type" variable combined with lots of switch statements in functions to call derived-class-specific code - exactly what virtual functions are there for!). Likewise, I've seen people who have only learned about programming at a high-level, and their coding shows problems, because they don't understand whats going on when their code gets compiled (e.g. not understanding the difference between heap allocation and stack allocation - try "char array[10000000];" inside a function!)
You absolutely need both, no question. My 1st year CS course at university included introductory assembly as well as object-oriented programming. Personally I think Java is quite a good introductory language, C++ is too complex for beginners, you want to teach the design principles without all the pointer problems etc getting in the way.
I don't see how you can claim that "teaching java to beginning programmers only encourages sloppy programming". If anything, only teaching assembly would encourage some seriously sloppy programming. You cannot learn good high-level design from only doing low-level programming, thats like saying that you can learn good social skills by studying how neurons in the brain function.
In my mind, no OO language should be the first language taught. There are too many fundamentals which ought to be learned first. If students don't understand what's going on at the machine level, we may as well teach them in HyperCard!
i think a lot of people here have got the wrong end of the stick. there is a hell of a lot involved in learing computer science, of which programming is a small subset. further to that, object oriented programming is only a part of that, and the java language is just one instance of many. java is not a language you should use to teach someone how computers work, and assembler certainly isnt a wise choice for your OO course. at uni i didn't touch OO till year 2. in year one however i did learn about (among other things) functional languages, assembler languages and hardware, logical languages and imperative languages. when we finally came to object oriented programming we learned small talk. the point is that small talk is a fantastic OO teaching language, and when you know it, you can apply what you know to c++ or java or anything else. there is absolutely no point in wasting time teaching someone a language just because its trendy or there is a chance they may use that language when they leave school. likewise, learn assembler as part of your hardware couse. unsderstand how ram is built, what a bus is for, how to write a loop, but dont expect to be knocking out some large scale project. when you know both, go write a compiler, and maybe after that you should know what your on about. discreet* [insert comedy tagline here...]
I wouldnt call using jave being 10 years behind, rather i would call it aheard: Many companies still use cobal or fortran or some other really old language because they just work
There isn't much like the scent of a fresh harddisk
Thats just the way it is. Right now OOP is the only way to go and if you want to teach OOP then it is easyer to just use a language where you are forced to use that. And Java does just that. Here its not wich one is better, its wich one does just that. I agree that Java is not near perfectly build and in only few ways is it simple, but it is compleately OO and you have to give it credit for that. C++ and others are OO too i know, but the structure doesn't shine OO in the same way as Java in my oppinion
There isn't much like the scent of a fresh harddisk
First four months:
Next four months:
next four months
I don't see what the problem with java is. I like them because their documentation is easy and intuitive to navigate, understand and get stuff to work with. The tutorial is pretty nice, too.
As a high school instructor, I strongly disagree.
First time programming students should not care about what platform or how a particular machine handles memory. Look, in the last 20 years, various machines have come and gone, but a binary search, a hash table, a quicksort, a binary search tree have remained the same.
Once students understand algorithms and problem solving, then let em needle into assembly for the Commodore 64, the Pentium IV instruction set, or whatever machine specific stuff in college.
Just a little history of AP CompSci:
The College Board actually considered C#. I've done a little programming in C# and feel it would be a much better language than even Java for teaching first time programmers.
I look forward to teaching in languages that enforce great problem solving and algortihm development, yet hide the needless machine details. I was unhappy when Pascal was dumped for C++, but I think the College Board is on the right track now.
I went to college with a heavy C++ background and flew threw the first 2 cs c++ classes, however i ground to a screeching halt when after i tooka class in OOP we had to take a class in Java on Adv Data structures and Algorithms. I couldnt deal with it the languages are very similiar in some degrees and it lead me to hours of debugging to find out there are slight grammer differences in the languages. This issue was never addressed by the prof and has had me shy away from java. I dont think mixing two such similiar languages together is such a good idea. C and and pascal and basic were structurly very similiar in programming and structure flow but gramatically very different.
"All I can tell the "lesser of two evils" folks is that if they keep voting for evil, they'll keep getting evil."-Lp.org
Before BASIC, I had a brief exposure to direct hex programming in a testboard with two little hex displays and a cute numeric keyboard. I remember the big "feed" key, that loaded de memory. I had during years the hope, that that previous exposure would somewhat override or compensate my crippling BASIC experience. But not. BASIC has crippled the paths of my brain, torturing it into shapes that lead only to madness. What was left was REDEFINEd by the COBOL structure, into something utterly unusable.
But I know there is still hope for me! The Big Bill have told us "All you my followers, old BASIC programmers, step into Visual Basic with me, and I will lead you to C#, which will fulfill all your needs". I follow you, Bill, I follow...Hahahahahahahaha... (maniac laughter).
Rome taught me patience and assiduous application to detail. Virtues which temper the boldness of great, general views.
I started with left-taught BASIC, then I moved to self-taught C, then Assembler, Lisp. I really cannot think anything would be so different if I had learnt C in the first place. Or Assember, or... well, perhaps Lisp would have made a difference, although I'm not sure in which direction :)
I have afterwards taught languajes, and there are mainly two types of people, those who have problems with programming, and those who not. No language will help the first group, who has problems to understand the most basic concepts, and no language is going to seriously hinder the second group.
--
Rome taught me patience and assiduous application to detail. Virtues which temper the boldness of great, general views.
My CS class (thru Scheme) taught me not just how object oriented programming is structured, but the converse (data directed) works. We spent the
first week learning the language and the rest of the course actually learning computer science. Most languages require all this extra time learning their syntax and weird libraries and stuff that has no place in a class room.
This class would've been extremely clunky and nasty in C or Java. Those languages are good if you're interested in writing applications, but if you want to learn how to *program*, then use a language that lets you learn computer science.
Computer Science? Its not really about computers and its definately not a science.
- Fast development time, which makes it more fun and productive.
- Free (libre)
- No compile step, although it is possible to 'compile' code on Macs and Windows so they can be run without a Python installation.
- Fully object oriented.
- Simple yet powerful syntax.
- Cross platform
- VERY powerful and flexible. I've done everything from CGI-based coporate helpdesk software to 3d rendering in Python. NB: By rendering I mean wireframe and non-shaded polys.
- Many standard modules
- Etc...
In short, use the snakeTODO: Something witty here...
I have been programming for years. I learned on Pascal and C. What is most important about learning to program is just that, learning to program. No matter what language you use, as long as you are learning the skills required to program you will be fine. Pascal certainly isn't a widely used programming language like C is, but learning it first taught me how to think and solve problems with a computer, and that is all that mattered.
The idea behind knowing how to program is not seeing how many languages you can learn, but making sure that if you have to code in a new language you have the neccesary skills to pick it up and run with it.
I much prefer seeing SmallTalk or any of several Lisp variants used as intro programming languages.
Aside from the interpretive nature of this languages (yeah, I know there are both C/C++ and Java interpreters) I think they tend to develop better _thinkers_, which is what is necessary.
Dave
Python is completely object orientated (like Java) but unlike java it doesn't force you to use objects. Hello world in Python looks like this:
print "Hello world!"
Although in python everything is an object (even class definitions are stored internally as "class objects") you don't need to know that, or even know OOP, in order to write a python script - you can just write procedural code instead.
Python is completely cross platform compatible, open source, fast, has a growing number of real world applications (Zope is just the beginning) and can even be used to write Java via jpython (www.jpython.org). It's got an interactive interpreter which is great for complete beginners to programming to try stuff out, and although it's easy to get started it has some fantastic advanced features as well(like the way you can use dir() and similar functions to get complete access to python's inner workings - what names it has defined, what objects have been created, what it had for dinner...)
Finally, it was named after Monty Python's Flying Circus and has a healthy sense of humour to boot - what better way to get students interested in programming?
I'm an Undergraduate Computer Science Major at the State University of New York at Oswego, and Java is the core language that the majority of our instruction is based around. Yes, dabbling here in there in C and Perl, but as a Senior, I'm getting worried; I want a background in VB, C++, and a few other languages that are more saleable... hell, even if I learned COBOL, I could make a living debugging old bank software...
I'd start with c. Its not as hard as assembler, but it is close enough to the hardware to teach about:
varibles
pointers
memory allocation
stacks vs heaps
loops
branches
recursion
simple i/o
simple program design
c, as it is a small language and doesn't take too long to learn the basic syntax is a good language to learn about data structures and simple algorithms.
heaps
queues
hashes, with buckets
stacks
trees
Searching and sorting algoriths
binary search
quick sort
merge sort
heap sort
But you don't want to spend too much time with c or you'll get too many bad habits that have to be undone when you move onto an OO language. I still program in c++ as if objects are just fancy structs :)
Next you want to learn some OOP. Now java or c++ is taught. All that OOP stuff that you have to get your head around is now the focus. Forget about registers, memory allocation, etc... just think about objects, inheritance, etc...
Then other languages should be offered to highlight various fields:
Assembler, hardware people, device drivers
More C, see assembler
APL, just to drive the student crazy.
LISP
PERL, great for little dirty text processing
VB - lots of jobs out there for this one
Java - lots of jobs, again
Anyone wanting to be a good programmer should get a taste of a number of languages. Once you're employed you'll become expert in the inhouse language. What's really important to learn is the underlying concepts used to create good software. Knowledge of useful algorithms, data structures, and programming techniques that can be applied in whatever language you end up using.
Anarchists never rule
I program in *lots* of languages, and every new language I learn teaches me a bit more about programming itself. I encourage everyone I know to learn as many languages as is possible.
The key here is to learn *programming*, not a language. Java has a lot going for it, primarily its large and actually portable codebase and detailed standards. It makes it excellent for actually deploying code, but I don't think it's the best learning language out there. Contrary to what this article would have you believe, it's *not* a pure OO language. They got close to making a very good language, but they left out a few important details. Some of the problems I've noticed include java having native types (very confusing for new java programmers), not having multiple inheritence (causes a lot of code to have to be cut and pasted that would otherwise not be), and a few other inconsistencies I run into periodically that look someone just got too tired to complete the design. Before anyone suggests it's more efficient to have primitive types in the language, consider Eiffel. Not only does every native Eiffel program run faster than the equivelant Java program, in my experience (and that of otheres), a translation of a C program to Eiffel will run as fast or faster than the hand-written C (much like a C program will often run faster than a hand-written assembler program). It makes things much easier on the programmer, as he doesn't have to keep up with all of the exceptions to the rules, for example, you can have an array of ints, but not a Vector of ints. You can grow a Vector, but not an array. It's silly.
If you want to teach OO, pick a good OO language that's easy to learn. Eiffel is a very good learning language. If you want to teach algorithms, use a language that makes it easy to express your algorithms. I used to mock up programs in perl to test algorithms, then use my target language for deployment. I would strongly discourage any new programmers from learning perl too early, though. It's the BASIC of our generation...to be succesful, we need to understand what we're doing, perl tends to figure out what people were trying to do and working with it. The worst programmers I've dealt with were the ones who only knew perl.
C is very unforgiving, but when you're programming in C, you're telling the computer exactly what to do. I think C with a really good environment to tell you what you did wrong would be good. Forget OO and all that stuff. Basic programming and computer skills first, application design and development later. The big problem with C, though, is that nobody understands it.
I guess I don't have the answer to the question, but I believe that learning to program is the important part. The language is just a tool. Really, it sounds a bit like they're arguing whether to teach someone vi or emacs to write their code. No matter what you go with, you're going to learn *something* about programming...and the more you go, the more you're going to learn.
-- The world is watching America, and America is watching TV.
An internal education-industry study in the late eighties said " of all students graduating with a degree in Computer Science are 'unemployable' on the date of graduation."
Having spent more than my fare share of time "recyling" computers between courses (removing and reinstalling the language and applicaiton software after it had been "customized" by the leaving students.) I am in no way surprised.
"Good" computer science pretty-much hit the bricks and disapeared once IDEs hit the scene in Universities.
Actual Conversation: (two near-graduates in CS)
S1: This isn't working.
S2: Bring up the debugger.
S1: Shouldn't "X" be "700"?
S2: Yea... look here, "Y" is "700".
S1: So I only need a "Y=X;" here?
S2: Works for me...
Then, not too long ago a young friend of mine went off to MIT and a couple of years later he told me that they were switching all their lower division students (he was a TA by then) to Java.
I told him about the "P-system" (how java wasn't all that cutting edge) and went over all the things that the students wouldn't learn. He still was enamored of how cool it would be because every student could get it on the web etc. And I despare...
Some of the things I envision a Java-trained person tripping over: (just the first dozen or so that come to mind)
Actually the list goes on so long and comes to mind so qucikly my mind actually boggles...
At least we don't have to worry about any of *these* guys knowing how to read a hex-dump and using that knowledge to the detrament of man.
I will definately want to move into the mountains and give up my commute before these people are out there trying to make a fly-by-wire car...
--
Innocent people shouldn't be forced to pay for inferior software development.
--"Code Complete" Microsoft Press
The HTTP mosnter ate my quote "{something like 85%} of all studends graduating with a degree in Computer Science are 'unemployable' on the date of graduation"
--
Innocent people shouldn't be forced to pay for inferior software development.
--"Code Complete" Microsoft Press
Sure, there are implementations of the same algorithms in C and many other languages, but they haven't been put through the ringer the way the old FORTRAN implementations have. It's very easy, in the kind of work they were doing, to end up with subtle bugs that are extremely difficult to track down but nevertheless ruin your results. Given the difficulty of making sure their algorithmic code was absolutely correct, it's no wonder they used well-tested code whenever possible.
IF I HAD KNOWN IT WAS HARMLESS, I WOULD HAVE KILLED IT MYSELF.
Some idiot in 'information week' or some crap I get for free did an article on this today. Java is a load of junk. I believe they should just teach plain C, then go lower, dependent on the courses they are taking. Assembly and such if they are doing more engineering related items, Java/VB if they are taking a more generalized approach. A friend of mine took a C++ at the local university (not a big ten school or anything, hell it might be a 'communinity college'). He complained about how easy the class was and how nobody but him and one other student wasn't having the toughest time in it. Real reall simple stuff, I laughed at his book. This is the same kid who can't get a single thing to work, even though he's got every book in the world (or atleast that I own). I literally have to go over there and cross the i's dot the t's. Thats why all the guys I've seen, locally, that have come out with CS degree are complete morons, esp on the programming side.
The real problem is: how far do you peel back the onion? Why stop with assembler?
Thirty years ago, I learned machine code to program the PDP-8. Why not teach that today? Or why not go further down and teach VLSI processor design, or semiconductor physics?
Semiconductor physics has nothing to do with computer science. VLSI processor design is not fundamental anything, but an engineering discipline based on a particular fabrication technology (more-or-less 2D semiconductor electronics).
Learning the machine code is part of learning assembler. A small part. There's no need to memorize it, just to be able to assemble by hand to understand what's going on (with references, of course). A few hours doing such exercises should suffice.
Once this is learned, assembler is a simple convenience giving full control over the machine code with fewer headaches.
A CS student certainly should learn about logic gates and how they build up into addition, multiplication, RAM, etc. This is also fundamental CS. How to build these gates from transistors (or vacuum tubes, or tinker toys) is not, and should be left to the engineers.
If you don't understand how a functioning computer is built out of logic components, you have no theoretical basis for why one operation should be slower than another, or why there is limited memory. Without this base, all programs that work are equally good, and if one works slower than another in practice, or can't run because it needs too much memory, it is merely a quirk of the hardware design. A machine could be built which always sorts any billion entries in the same amount of time as it takes for it to add two 32-bit numbers, machines are built which take the same amount of time to multiply as to add, but addition is fundamentally simpler and faster than multiplication, and adding two 32-bit numbers is certainly fundamentally faster than sorting a billion entries. The supersorter is a quirky machine, but without knowing about the gates from which all digital computers are built, you have no valid mathematical basis for saying so.
Similarly, if you don't know anything about machine language, you have no reason for saying why one HLL program should run faster than another, or which will consume more memory.
The heart of CS is the interaction between the gate logic and the data fed into the gates. Anyone who doesn't understand the fundamentals of this interaction is not remotely a computer scientist. Learning a machine language is making one case study.
--
As opposed to C/C++, which was what I was taught in college, Java is a higher level language, and of course demands a stronger machine in order to compile and interpret the code in a reasonable amount of time. However, to the universities and other schools that have the budget to supply the equipment necessary to equip their students with computers capable of reasonably compiling and executing java, java can be an excellent learning tool to a student learning object oriented programming.
My largest complaint here is this: most students just starting to learn the principles of computer programming do not initially begin with obect oriented coding. Every school that I know of first teaches top-down coding first. Eventually, modularization becomes the current topic, and then object oriented programming is addressed. OOP doesn't become the topic of class discussion at most schools until the second semester of a CS student. Which leaves me to conclude that java is worthwhile for students to learn when they reach that level. However, students do not reach the level where they will understand the advantages (disadvantages) of java versus C/C++ until later in their college careers. I believe java to be a strong language to address object oriented ideas in code, but not a strong place to teach students the basic principles of programming.
I currently program with a firm using Java as a primary language for development. I like it. It does the job and then some for the tasks we are doing. Having said that, I also think that Java makes the lives of CS students far too easy. No memory management worries, very strict typing, lots of gui items to distract you...the list goes on. The idea is that Java allows you to take for granted many issues central to computer science. If you don't learn to worry about memory allocation or deallocation, or to be careful when casting things to void and back, or even how to create an event based program in C, what happens when you go into the real world (or another class)where C (or another less forgiving language) is quite possibly a viable option? I'll tell you what: you program in a care-free, sloppy fashion, exactly how you were taught. We should be teaching our CS grads the FUNDAMENTAL SKILLS OF COMPUTER PROGRAMMING. Tight, efficient, well-commented code. Algorithm efficiency. Memory management. Reading other people's criptic code. Debugging (Java programmers never even get to try to find a seg fault, for crying out loud!). At least a taste of assembly language. These are the skills that I would look for in hiring a CS grad. And I would not find those skills in a graduate who had primarily used Java in his/her education. Teach the fundamentals. Let employers teach the specifics they will need on the job. They are going to do it anyway. Have a great day. Matthew
As my CS II prof said at the end of the semester, "You now know the complete syntax and and workings of C++... One day in the future you'll graduate, and you'll need to get a job. If, at an interview, they ask you whether you know Java, say yes, then go read a Java book over lunch." And, this is about what I did. I had a little java experience when I interviewed for my current student job. Now I know java really well. And why? Because I understand OOP pretty well. It's just about learning the concepts, not a specific language. If you feel like you know C++ but don't think you can learn Java, then I don't know how you got a BS in CS. Java is a LOT like C++, just easier to use! Go pick up a java book and start making a few extra grand per year...
--chadwick!
I went through the computer classes that my high school offered (Pascal) as well as going through a CS program at Montana State University (started with C and Ada, OO concepts in C++, as well as assembly, and alot of theory, as well as some Java, Lisp, Perl...). After all that, here are my thoughts...
An introductory language should really give a good overview of control structures and data structures, as well as some (albeit high-level) overview of memory management and resource usage/allocation. Jumping into a full OO langage at this level is, in my opinion, a very bad idea. Java is a great language, and I use it every day at my job, but it's not a good first step. One of the things I was taught in college was to know how something (in this case yacc and lex) works, not just be able to use it. A foundation in procedural programming gives you a good starting point to learn assembly or OO, but I don't feel that OO is a good starting point to learn procedural or assembly. There's also a difference between using memory management and knowing how it works. If you don't understand how the memory is allocated, and how it is paged in and out, and the language's ordering of, say, multi-dimension arrays, you could write a program that loops through that array in an inefficient manner.
OO is a great tool in your toolbelt, but it isn't always the right tool for the job. In this case, I would say that an introductory course should give a good overview of the core of programming, which is control structures and data structures, with a high-level understanding of what's going on behind the scenes (pay no attention to the man behind the curtain). As far as higher education is concerned, the whole purpose of a degree in CS is to give you the knowledge foundation to go out and make intelligent decisions as to what you're going to write, how you're going to write it, what language you're going to use, what algorithms you're going to use, and WHY. The biggest piece is the WHY, because I have alot of friends that don't know WHY they do something, it's just the way they were taught.
Sorry if I rambled...
when i first started university (yes im from australia), the first language we were taught was c++. This was a small uni and when i moved to a larger uni (one of the biggest in australia) i found to my dismay that java was being taught as the learning language. As everyone would know on /., java is only a subset of c++ with some fancy add-ons. I felt that i knew far more than the students at my new uni and that they should have learnt c/c++. Essentially if they learnt c++, then java can be and is very easy to pick up afterwards.
on a side note, at my old uni we did learn java after c++ and it only took one course to pick up all the fundamental issues.
When I was in high school, the computer science classes taught C/C++. In fact, the curriculum had been switched to C/C++ from Pascal just a year before I took CS-I.
In CS-I, we learned how programming basics. In CS-II AP, we got into pointers and, near the end of the year, barely scraped object oriented programming. I feel that, when it comes to computer science fundamentals and theory, basics and pointers are far more important than OOP: the simplest reason for this being the fact that all languages support direct memory access in some way, whereas there is only a minority now that supports OOP.
Education in programming should be presented ground-up. This means that students should learn about things like memory addresses and offsets long before they learn about the Java API or MFC or anything like that.
In college, I took a course on Java. I found the coursework rather interesting, but the professor presented it in a manner which did not stress computer fundamentals. The course was, essentially, a series of lectures on a modified C++ with very heavy emphasis on OOP. This is perfectly fine for those who already know what goes on inside a computer, but I noticed that there were no prerequisites for the course. Something a little more basic (even an Assembly course) should have been presented to the students before having the option of taking that Java course.
In effect, programming should be taught beginning with the very bottom of the CS hierarchy. Interrupts and offsets should be discussed first, and OOP and APIs should be taught near the end.
For those students who want to be able to work at the hardware driver/interrupt level a course in assembly language is highly desirable. Sometimes you can use C for interrupt handlers, sometimes you can't.
eiffel has got to be one of the greatest and best implementations of OO i've ever seen or used. for learning it is by far the best... as for actual production application development, stick to C
MARIJUANA, SHROOMS, X: ONLINE?! - E
Once you know C and have learned what it can do, C++ should be taught before Java. It gives you a lot of useful tools while keeping a fairly strict environment. In particular, it helps you think about memory management as you work with constructors and destructors.
Java insulates you from memory management, and pointer arithmetic, and the way it does so requires that you deal with its object-oriented libraries. As a language for teaching OO techniques, it could be effective once the student has learned the disciplines of C and C++.
(As an aside, the discipline taught by C and C++ is important when moving to more flexible C-based languages like JavaScript and Perl. Some people regard Perl as an abomination because it is extremely easy to write thoroughly obfuscated code in the language. I recommend that people writing Perl stick to C/C++ like syntax as much as is practical as a way of avoiding obfuscation. Once you take steps to avoid obfuscation-- which requires some discipline-- Perl is a very effective scripting tool.)
"Before enlightenment: sharpen claws, catch mice. After enlightenment: sharpen claws, catch mice."
One word... Pascal.
-------------------------
-------------------------
It is the monkied monkey that monkies with another monkey's monkey. Monkey.
I further disagree. The purpose is for teaching. To do so, you really don't need to learn much of the standard libraries to get a feel for OOP or simple things like 'Hello World.'
When you want to get advanced, Java becomes much easier, especially for graphical programs.
Personally, I taught myself Java and now use it 99% of my time. If you know C++, Java is a snap...so my recommendation would be start them with C or C++ so they can get into some really ugly, cryptic, self-documenting code!
bleh
I'm an Information Technology major at the Rochester Institute of Technology. When I enrolled (two years ago), we were taught Visual Basic as an introductory language. This didn't effect me as much as other students (I had already had a year of C++ as well as other assorted languages), but definitely impacted the way a lot of the other kids in my major program. In fact, the IT department at my school is now switching to a full year of Java as the introductory language, and I for one think it's a great idea. I know the CS department has done the same thing for a while and has had good results with it. Having taken courses in Java, C++ and Visual Basic I think that Java makes an excellent learning language due its flexibility and wide variety of uses. And it's certainly a hell of a lot more useful than VB.
My particular answer to this question is that you should learn
data structures and algorithms before worrying too much about a
particular language.
The long answer is that this is how I would spend the first couple
of years, moving from simple coding to a fairly broad understanding
of SoftDev.
First, it's important to have people you can ask questions and
get advice from. They can encourage good habits and explain the
reasons behind something that makes little sense at first.
Learn enough about the language to get by (I like C/C++, but Java
works too), then learn about Big-O notation and lists and trees
and sorting and all that fun stuff. You should also know what call
by reference, value, and that other one (Call by value return, I think)
mean and how they work.
Expand your knowledge of the language you've chosen in line with the
concepts
you use. When you have a decent grasp on the basics, poke around in the
obscure areas. You should know what the language can do, but don't feel
obligated to use every feature. Simple coding style is easier to read,
easier to port, and easier to debug.
In addition to syntax and data structures, there is the additional issue
of overall program organization. This is where structured programming
comes in; it involves dividing a program into modules and specifying
their interactions. This can be used to isolate bugs and simplify system
behavior. Object oriented programming is a refinement of this technique,
with the ability to compose a program of Objects that have specific
behaviors
and may also have explicit relationships. OO has more overhead associated
with
it, but it can be used to build larger systems successfully.
It is very important that you learn how to use these and other techniques
effectively to manage programs, as this will determine the success or
failure
of a project more than the quality of your code (assuming a base level of
ability).
By the time you are familiar with the first language, you should play with
several other languages - get familiar with the style they promote and
the tasks they are suited to. Some good starters are Perl, bourne shell
(as shell scripts go, the bourne shell (not bash) is the only one you can
really depend on to be portable), tcl, C, C++, java, some flavors of
assembly
(if only to see how it works).
You should also be expanding the theoretical side of the coin; all of the
previously mentioned languages are Imperative - they tell the computer to do
something specific. There are other types of languages - Declarative
languages
tell the computer what you want without saying how to get it (SQL).
Functional
languages dispense with side effects (Lisp). Some languages treat functions
as
first class objects (which can be passed as objects).
Reboot macht Frei.
1) Platform neutral
2) Nice GUI libraries (Dr. Scheme, Tkinker, Swing) ... not needed in into course, but can make programming more fun. One might consider using GIMP and teaching script-fu. Just to make the programming examples more concrete.
3) Relatively clean semantics.
Scheme would be my first choice, only because it is so easy to express many different programming concepts, so it would be easy to extend the intro class with an advanced class.
One also has to consider the support material available. I know there are a couple of good intro books for Scheme and Python. There must be for Java too.
I have also seen Haskell mentioned a couple of times. I love Haskell. I don't use it much. The problem is that the developers are always making it better, and I can't keep up ! (* grin *). It is a truly elegant language... maybe it could work as a first language? What about Caml?
I tend to lean toward the philosophy of using at least two languages: C for system stuff, for using libraries, for reading source of most everything out there, and for time critical stuff. And then some higher level language to glue it all together. (Python and Mathematica for the most part).
-> Ron Legere I can never think of anything clever to put here.
I've decided to lump them together as they deal with Java's use as a learning language, as opposed it's traditional use as an application language, and in many cases, which looks to be replacing C/C++ in this role
You're not the only one.
The AP Computer Science Course for high schoolers announced this year that in 2003, they will be replacing C/C++ with Java.
It all depends on the intention of the course.
1. To teach flow control, use Rube Goldberg machines, then Basic to model them.
2. To teach Object Oriented Design, use a train set w/ cranes and logs and good stuff like that. Then use Java to model them.
3. To teach how computers work, use an Apple II (or any 8-bit machine) and teach them assembly.
4. To teach memory maintenance and performance programming, use C.
Computer Science, in almost every facet, is the phrasing of some model in a mathematical form. People learn best when they have a concrete analogy to associate with their logical model. Once they get beyond the conceptual, get mechanical.
No language is right for teaching CS. Teaching CS is a process.
Any connection between your reality and mine is purely coincidental.
I just completed my Freshman year at a rather large University in Philadelphia as a Computer Science Major. Here, all CS and Math majors are required to take and Intro to CS Course in their first term. This class was centered on HTML and JavaScript. Using this class to break students into making a michine do their bidding (at least those of us without prior experience), the curriculum then takes you into two terms of programming in C++ using MSVC++. I already had been programming in C/C++, HTML, and JavaScript for a couple years, but after (grudgingly) taking the course, I could see how this could be helpful to all the newbies. At the very least, it got out all the annoying questions when they were least painful, like this one: "How do I make the computer write my english paper for me?"
Am I Over-Moderating??
I started reading this story with the idea that Java is completely useless when compared with C++. Basically out of ignorance, and laziness. I started the one required Java course for my Knowledge Engineering degree. I dropped out of the course, because it seemed totally worthless to me after taking 6(!) courses in C/C++. I lost a couple points in my average, but this was my final year, and I wasn't concerned with going from 89 to 86-87. In the end, I suppose, I should probably give Java a little more of a chance. Thanks to you folks for shaking me into spend some hours learning something new, and probably making more money.
I think Java is not a good first time language as an introductory language. Java is a good language to goto _after_ you have learned the top down procedural style of programming, including such things as pointers and passing parameters by reference or by value. After a student learns the top down style of programming, with a language such as C or Pascal, then, moving on to teach Object Oriented Programming concepts with Java would be a good choice.
I went to Michigan for college and when we first started we start learning assembly language and moves on to C. Java was offered as a non technical elective course since you will be learning C++ as you go. I personally think you need to have C (maybe even assembly) background before you get into OOP and I think Java is a cleaner language than C++. C++ gives developer more freedom but if not use carefully the program can crash left and right while Java is more stable and will throw exceptions to you when something goes wrong (even at times you don't know why it crashed)
if I ever saw one. I guess tomorrow we can do emacs/vi, and round up the week with PC/Mac. Wonder if the original poster is intending to read all the answers, or if he just wanted to see if he could set a new ./ record?
-- Another senseless waste of fine bytes.
"C and C++ need to be taught, but they should be in a Junior level course."
I learned C++ in high school. On a Mac, too, using Codewarrior. This was my second language, after VB, which I taught myself. I found it pretty straightforward.
Personally, I would NOT teach Java as an intro to OOP, instead I would teach C++. Why?
1) Look at what each language is (for the most part) being used for. Java - little web games. C++ - 90% or so of all commercial applications.
2) Java applications don't even run stand-alone. They need a clunky, slow-loading interpreter.
When I started my CS course the OOP teaching language was C++. By the time we started the OOP section of the course it had changed to Java. The dedicated programmers on the course self taught themselves C++ during the holdays anyway and we were fine. Java is clean OOP language and is great for teaching OOP principles and good OOP coding habits.
:)
My OOP skills in C++ benefited as a result. I enjoyed the Java course and even those students that are not programming minded thought it was a cool language.
The lecturers enjoy teaching it too as far as I know. Overall it has done no harm to the graduating CS students at my University (RGU in the UK SCMS@RGU ).
And the number of Java jobs out there is a bonus
Ryszard
- 'sup, G?
As an experienced C/C++ programmer, I suppose I have a fairly large slant on the issue. I think the phrases bring up the question of which language is most useful in the programmer world. I recently started dealing with Java because my work required me to write an application extention for their web database software. This only supports Java as a plugin language because it is a cross platform database platform. From my experiences with Java, it has a few problems. Java for has too many functions that are prebuilt. It becomes difficult to choose, just for things as simple as console io and file io. Also, the appropriateness of OO being used all the time is questionable. There are times when it's appropriate and can save lots of time and work (applets are a good example of this), but in many cases thing should be traditional code. Java also has some nice things about it. When C++ is the introductory language, GUI cannot be taught. If GUI is taught, the course is not proper because an introductory course should only deal with built-in language constructs such as file io, memory and algorithms. It would be nice nice for people to learn GUI programming in an introductory course because it is often hard for beginning programmers to grasp the importance of what they are doing when it looks like something from the early '80s, but is that what's important? However, I think C++ should remain the introductory language because of one main reason: professional programming. When a programmer is out in the work force, full blown Java apps don't exist for the most part. "Killer" Java apps are simply too slow. For an example try out JBuilder foundation (Forte for Java is not as guilty, but it's still not great). Java seems to offer no distinct advantages over C++ except for the GUI ability which is unimportant in an introductory course.
Whatever happened to BASIC for introductory programming?
1) Universities are training kids java.
2) The startups base their technologies on java to get the bulk of cheap coders.
3) Most of the new "innovative" products that get out in a couple of years look like your favorite java app today (i.e., fails slowly).
4) C++ ja C will be the Cobol of tomorrow. Nobody knows them (old farts do not count here) and it is not worth to learn because java is theoretically better in every respect - as though in the university. Also, the difference between java and C++ is so small that there is not much reward in relearning all the libraries etc.
5) The java culture (compilers, patterns, coding knowledge) evolves and finally we are able to produce robust (but still slow running) software with java. We have finally reversed Moore's law in computing.
This is what can happen and it is really a nightmare. The only responsible thing to do is to stop all java training, immediately. A better training language could be python. Python and C/C++ make up a good combination even for serious engineering, so learning python is good use of time even for serious engineer students - unlike in the case of java. Java and C/C++ is not as good an interlanguage solution combination because of too much overlap in paradigm. I hope that C/C++ will be replaced, but by something that really is better in their native field, too.
In my opinion java is one of the terrible mistakes that have been implemented in modern computer science. It has been such a small step forward that it should not have been taken. Too much trouble for gaining so little.
-- Imperial units must die --
Ok. Let's just get this out of the way:
1: Java is easier for a beginner to understand than C++.
2: C++ is more powerful than Java.
Now, with that said, Java as an educational language is a great idea -- in the beginning. In the beginning, you want a language that is easy to teach and, most of all, readable. Really, in my mind, teaching people about memory allocation and garbage management to people who still might be having trouble with references and indirection and double indirection is a waste of time. Java hides the complexity of the details, so that people can actually learn to design and think logically before they have to worry about more pragmatic concerns. After all, programming isn't about languages: it's about theory. Once you understand the theory behind a concept (be it classes, references, pointers, garbage collection, whatever), everything else is just keywords and syntax.
So I got to say: I would go ahead and teach the AP students Java. It's more likely to be useful to more of them than C++. And even if it isn't, the practice of good design skills will still carry over to whatever language(s) you learn in college/work. Sure, you can make the argument that Java hides a lot of stuff from the user, but the purpose of a CS course, in my mind, isn't to teach students about 'this' language or 'that' platform: it's to teach them about programming and computers in general. You want to show them everything under the hood? Don't teach them C, teach them assembler.
For the CS students, though, I think the question is kind of redundant: you don't learn one or the other, you learn both (and assembler, to boot). But I think a CS degree is a lot different from a CS AP class.
I think most people forget that the purpose of education isn't to teach material in a curriculum, but to teach students to learn.
I still don't have a degree yet, but I learned Pascal in high school, then went on to teach myself various other languages (including C and PHP). I worked at an ISP as a self-taught programmer for 6 months and earned a decent pay ($4k+/month) before I decided to go back to school to get a degree.
Being able to teach your self, IMHO, is especially important for programmers because of the nature of the industry. No matter what you "learned" in college, five-ten years into your career, your "knowledge" will be outdated. If you learned to learn, however, you will never be outdated.
So to get back to the main thread, what language you learned is, IMHO, inconsequential. It's just a language. Any good programmer should be able to learn a new language in at most a few weeks. There are other fields in CS that can not be mastered as easily, and any good college program should concentrate on such topics.
---
Open Source Shirts
I've always believed that any O-O language is flawed at being an introduction to computer programming. Lets face it, computers internally do not represent programs as real world objects. What I mean is why do we want the students to think in terms of real world when they no crap-all about the runnings of the computer.
My brother studies at the University of Queensland, Australia. His first semester subject was Java. What has he learned so far about computers? Nothing. He was not taught how computers run programs, does not know how what compilation is (even though he presses the compile button). All he knows is Java. This is a very bad way of teaching students.
In another situation, QUT (Queensland Uni of Tech) also teaches Java as a first year language. And guess what? students know jack-all about computers.
So I ask what is the usefulness of teach such an abstract language is for? Students then become bewildered when they enter the realm of understanding computer internals.
Please save their souls. They really need to understand computer fundamentals before going through abstract languages like OO.
At the University of Sydney, Australia, Blue (http://www.pscit.monash.edu.au/~mik/blue/) was developed as a programming language specifically for first year students. I believe it was adopted in about 1997 and was replaced with Java at the beginning of 2001. As a development language, Blue was pretty-much useless, but it is great for teaching programming concepts -- knowledge which is vital for learning any other language. Its pure OO design and its clear limits and restrictions were actually useful for first-time programmers.
I was a member of the last group to be taught Blue. While learning, all we did was complain about Blue not being a real-world language, and we were bitter about being the last class to do such a 'useless' language. We would have chosen Java if given the option -- at least that was actually used outside the University.
Now, in hindsight, I can tell you that Blue was actually a good idea. The main reason why the University dropped it was that they had to maintain all of it themselves. This meant books and assorted documentation, the IDE and the language itself -- quite a monumental task for a cash-strapped CS department. To make things worse, the guy who initially developed it left to another university. I'm sure this would have created problems.
I have a friend that is now doing the same introductory programming subject I did at the beginning of last year, but with Java. He seems to have far more problems than I ever did. Moreover, these problems are over really mundane aspects of programming, like a misplaced semicolon or something. Sure, Blue has these problems, but they were nowhere near as bothersome, allowing us to actually get our work done and learn things along the way.
Another benefit of Blue was its relatively low system load. Last year for Blue, all we had were dumb terminals running X exported from chunky SunOS 5.6 servers. While this setup did pose many problems (they were crash-prone, etc.), they mostly worked well -- and they were cheap. With the introduction of Java, it quickly became clear that these lobotomised computers were not adequate for the job. The University was forced to replace them with GNU/Linux computers, but X was still exported from the servers. In other words, processing power was switched from a centralised to a distributed model. I don't know how much this all cost -- and it appears as if the CS department has tried their best to kerb expenditure with this infrastructure -- but the bill still must have been large.
So what are the alternatives to this scenario? The University could have continued to use Blue, and tried to persuade the developer to relinquish control of the language to a larger body (e.g. the University or maybe even the open source community). They could have been more active with popularising the language, and getting other universities/schools to adopt it. I remember hearing about a few universities in Asia that were interested in Blue. I'd like to know what happened there.
As it stands, though, I think Blue is dead. The last time the Blue web site (http://www.pscit.monash.edu.au/~mik/blue/) was updated was February 1998. The University of Sydney was the only (AFAIK) bastion of hope for this language, and they let it die.
OLPC Australia
You know, I just returned from JavaOne and I was surprised. For a language that has only been around for about 5 or so years, Java has seen tremendous growth and acceptance. JavaOne, the annual developer's conference for Java, already sees 20,000+ participants making it the second largest computer conference after Comdex. Sun reports that there are over 3 million Java developers. Whatever you may think about Java, you must admit that this embracing of the language by developers is impressive.
But why are people flocking to the language? My belief is they are motivated by the fact that it is the Grand Unification Language. Java, through design or accident, has acquired features that make it easy to use many different aspects of programming. Let's walk through some of these:
Take your favorite language and see how many of the features it has built in. Obviously, all of the features listed above are available by third party vendors for languages like C. However, having them part of the core language lowers the barrier to entry for newbies to try things out.
So back to your question about whether Java should be the underpinning of a CS education. If your goal is for the students to learn about how software interacts with the hardware and how to use resources effectively, then Assembly is the way to go - this was the underpinning of my own education. If instead, you want to give them a solid base from which they can branch out and experiment in a myriad set of directions, then unquestionably Java is the answer.
Just my $0.02, keep the change.
The secret to life is sex, cars or computers
The main advantage of Java over C and C++ (and the reason why C and derivations are discontinued as teaching tools in my university) is it's relative platform-independence. When you want to test the programs that people have written at home, it's a real pain in the ass to get their Borland C++ programs running under Linux, you know. This disappears with Java.
On the other hand, Java is not the most highly structured language, especially in recent versions. That greatly lessens its didactic qualities; I have had several students here who started to experiment with all sorts of arcane features like inner classes and operator overloading without learning how to write good programs first. It's a bit like comparing Niklaus Wirth's original Pascal to Borland Delphi. Deplhi is more powerful, but you need a thorough knowledge of the class hierarchy and in order to deliver good OO programs, you have to be a good OO programmer beforehand.
Therefore, I now prefer either more systematic languages like Eiffel, or script-like languages like Python - the first for their higher level of abstraction and cleaner design, the latter for their greater ease of use and wider field of applications. Both are, in my opinion, better suited as didactic tools for learning OO programming.
And BTW, over here in Germany the high dependence on symbols such as {} or [] or /**/ is a didactic problem in itself because these aren't so easily reached on a German keyboard. This may sound harmless, but we get endless complaints from people who hate to perform strange Alt+Key acrobatics to get a simple thing like a curly brace.
There is absolutely no reason to panic.
The real question is here is what the purpose of the Cs program is. Are they trying to teach a broad understanding of the way computers work, or just give a student the tools to land a programming job when they graduate? If you are trying to teach the realities of computer functionality then C is probably the best, but if the goal is simply to teach a course in OOP Java is the right choice.
I think that the best programming language for a new programming student to learn first is not C or C++ or Java. It's Pascal. I know it isn't all that powerful, but it has two very nice things going for it:
1. The Borland compiler gives extremely helpful, precise error messages, and is free.
2. Pascal is not at all forgiving in terms of syntax. You WILL code one way, the only way, the tidy way, or your program will not run. Nothing conditions a programmer to be neat and organized better than Pascal.
The disadvantage, of course, is that pascal does not allow low-level access to a computer unless you integrate ASM. However, I really think that the first thing a programming student should learn is not how computers work at a system level, but the logic they use. An understanding of recursion will get you programming effectively a lot faster than if the same time were spend on memory allocation.
I'm the stranger...posting to
"Python maybe? Or does someone have other suggestions."
If he's willing and able to code neatly, I'd recommend pascal. It's free from borland (go to community.borland.com and click the museum link), it allows for some interesting graphical functions, and it forces the programmer to be tidy. It also is very easy to get programming in quickly - your grandson can have "Hello world!" running in five minutes at most, unless there's a compiler problem. In another five minutes "Hello world" will be blinking and beeping at you. This will be a good time to teach programming etiquette ("Not all end-users like flashing text or beeps").
Alternatively, you could buy the kid a Lego Mindstorms set and turn him loose. You can program those robots in their own visual RCX code, asm, a basic-like language, C, C++, python, ada - pretty much any language you want. This would allow for your grandson to first learn an easier language, then progress to more complex and powerful ones. Also, if you buy the Mindstorms kit I can assure you you will be his favorite grandparent ever.
I hope this was some help. Feel free to email me if you have any questions.
I'm the stranger...posting to
So I started CS, and in the first class - principles of programming - they were trying to teach in really basic BASIC. It shows absolutley nothing of the real programming world and is completely ridiculous.
When I look back and when I started and what I think now, I think that a language like C++ would be the most beneficial. It would teach OOP, and make it extremely easy for students to learn other langs themselves (I think thats the best way to learn, anyway).
It's "computer science", not "computer language science". In your CS and professional career, a programming language is both an end and a means to an end -- if you're smart. You get work done with a programming language and receive either marks or cash.
But if that's all you do with it, if you can't see the potential to learn about other languages -- about CS principles in general -- by abstracting beyond one language to many... well, then be gone with thee!So, what are we teaching in CS? Just programming languages? Just one? Might not students be best served by a survey of languages, even in the tender stages?
Today's students would do well to "peel the onion", starting with Python and it's clean simple OO model, high-level built-in data structures and emphasis on consistent style; then on to Java for a deeper look into data structures; C++ for a nasty dose of design elegance shot to hell by implementation realities. Well, the list goes on.
If you are teaching an OOP class then your goal is to teach OOP. Java is a perfect choice because it has strict typing, memory management and is system independent. This is perfect for an introductory class in OOP.
The professor's should stress in any CS class that the students should choose the best tool for the task at hand. I have seen many instances where someone had programmed something in a language because that was the language they knew/adored/cherished/whatever. They should have looked for a tool to suit the task, not attempting to adapt a tool to the task.
You can hang a picture on the wall by using the end of a screwdriver to pound the nail in, but you should probably use a hammer instead.
Java may not be the best tool for low level programming, but for learning OOP it is a good choice. Actually it is a good choice for any complex OOP tasks because it takes care of a lot for you.
Ummm, you are obviously NOT well versed on Java. It is used for a lot more than just Applets. In fact a lot of web programming is changing to Java Servlets/JSP. And Enterprise Java Beans are excellent should the need arise for component based development involving multiple systems while enforcing security, transactions, database connections, etc.
.... get the point?
You also can write solid client/server systems in Java, and network programming with sockets or RMI, or using it on the command line to process text files into a database, or interfaces on cell phones/printers/copiers/Palm devices or
Java has strict typing, and is an excellent learning language because you can learn the introductory fundamentals of programming very easily. Not to mention the fact that it can introduce many different aspects of programming to a student (GUI/event programming, network programming, OOP, database interaction, etc.) without having to learn another language/environment or some 3rd party libraries.
Would you people please stop talking as if C/C++ were a language?
C and C++ are different languages. They obviously belong to the same family, and share a lot of syntax, but each has features the other does not. More importantly, they require different skills to use effectively. Much good C code would be bad style in C++, and vice versa.
Since the whole point of CS is to teach the underlying skills and not any one tool, this is kinda important. C and C++ are no more the same language than C++ and Java, or Java and C#. OK, forget the latter. ;-)
So, for goodness' sake, at least get the most basic information about these languages by reading some of the FAQs, before trying to comment. Pay particular attention to the last one, please; it was written by Bjarne Stroustrup, so it carries even more authority than the others.
You can safely assume that anyone posting about the "C/C++ language" here is neither an authority on C or C++, nor qualified to discuss the languages taught on a CS course.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
Sorry, but while your first paragraph is true, your facts are way off-base.
First comment: CS is not about the business world anyway. It's about underlying principles. Any decent CS student will pick up the language of their choice relatively easily for a real world job after graduation. Sure, a reasonable knowledge of a good programming language or three does no harm, but those languages should be chosen for educational value, not current business buzzword status.
Next up, how can you possibly say that Java is really going to rule the business world for the next 10 years, unless .NET makes it instead? Two years ago, no-one even knew what .NET was. Java has gone from an interesting toy to a serious mainstream language in only three or four years. It doesn't rule the business world, even now; there are vast areas of development that Java doesn't even address, where other more suitable languages dominate. Hey, do you even know what C++0x is? It's due rather sooner than 10 years from now -- 2003 or 2004, hopefully -- and it has the potential to make a huge impact depending on how it turns out.
Contrary to certain people's perceptions, the whole world hasn't suddenly moved its app onto the web. The web adds no value to many embedded, instrument control or scientific applications, for example. In these areas, more "traditional" languages such as C, C++ or FORTRAN still dominate. Much business code is still written in COBOL, and no-one's going to change that any time soon for fear of breaking a key application.
Oh, and Java is fine for teaching the OO concepts it supports, which would be... public inheritance of a single base class, and a bit of interface/implementation separation. It doesn't have anything like the expressive power of C++, never mind more OO-specialised languages. Sure, it's easier to teach than "this huge thing call C++", but that's probably because it can't do nearly as much. Since the idea is to teach people how to do things, surely that's a problem with using Java as a teaching language, not an advantage?
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
Java works on only a very few platforms. Try finding a JVM for an 8051 or a typical low end cell phone. /. seems to have too much of an IT & web view of programming. There is a whole world of programming tasks that don't have a CRT or keyboard attached (or OS for that matter). Sure Sun is pushing an embedded solution, but that will only fit in less than 1% of the real world devices. C++ has been ported to some very slim CPUs and in many of those places you must have hard memory access to talk to the hardware. And forget about putting an JVM in an 8 bit CPU or even a 16 bit Palm for that matter.
As far as I'm concerned, Mr. DiBona is just trying to keep CS "1337" by scaring off people like the boys (and girls) that were in my AP CS class this year. They would have never stuck with it if they had to deal with crap like low-level memory management and buffers, which one really shouldn't have to learn today anyway, what with the easy availability of high level languages such as Python and Java and the abundence of computing resources (Moore's Law).
"I don't know that atheists should be considered citizens, nor should they be considered patriots." - George Bush
I've been programming mainly in C++ for a while (with a smattering of Perl) but for a couple projects I have had the misfortune of using Java. I think that Java, while maybe a bit more of a "True" Object-Oriented language, creates a lot of bad habits. The way it's used is one heck of a lot different from C++ and things derived thereof. Currently, it's popularity stems from it's use in applets on the web. It's far too young to be basing our students on it just because they want to learn web programming.
Just my opinion, feel free to disagree here or in my email.
-Gyrfalcon_255 I'm not a poet, and I'm not a bard. Just a guy with an opinion.
After all, assembler is just an abstraction of binary. So. Like. In fact, binary is the most fundamental language. 8P
more cross platform ability + memory requirements not to mention you need to be running a jvm and you dn't get to use pointers or a main().
personaly I think C++ will always be more widely accepted[?]/used since it runs on any platform wihtout a special vm and more people use it[/like it] (me to!).
It's good for some things like it's browser integration and cross platform useablility but for it to catch on it'll have to be faster and take up a lot less resources.. (RAM.. Baaaa... Euro.. Yumm.. o sorry.. )
If i was you, you'd be me and we wouldn't be having this conversation
I'm a CIS student in the CSAB accredited program at Kansas State University. The year I started they switched to Java as the learning language.
Personally, as an Object-Oriented language I think it's pretty good and as a learning language it's easy to teach and learn. However, there are some key problems with using Java that are more pragmatic than theoretical.
All of these insulate students from many of the realities of programming. In any case, everyone ought to be made to take a C++ or C course early on so they can be made to understand some of the deeper programming issues. I know far too many programmers in my classes that don't understand the basics of memory management or how to handle abstract complexities involved in pointer manipulation or even the basic idea of a non-virtual method (all non-static Java methods are equavalent to being C++ virtual).
We have courses like Programming Languages and Operating Systems that seek to dispel these problems, but I still see programmers graduate without understanding how to really do anything outside of Java because of the insulation it gives them.
I say teach them rough edges and hacks and work-arounds before given them a nice clean language like Java or Python to mess around with. Don't we teach derivitives and anti-derivitives by first teaching them the hard way and then giving them the easy formulas? I say use the same method in computer science and make them learn the difficult theories from the ground up with an imperfect implementation.
First off, I think it's important to recognize that an introductory CS class really isn't introductory to very many students in it, unless you're talking about the University of Bumblefuck. At almost any University, a large fraction of the kids who decide to major in CS will already have some programming experience, be that in C/C++, Pascal, Perl, Java, or whatever. If you truly think that to develop good programming habits/abilities you _need_ to start with assembler, or Java, or C, or any other specific language (as a lot of people have suggested) then you might as well give up on the whole intro class deal.
That being said, here's how it's done at my school . The intro cs class is taught in Scheme, which is a variant of Lisp. The textbook that we use is The Structure and Interpretation of Computer Programs by Gerry Sussman and Hal Abelson, and is available for free online (not a really important point, but a nice one).
Now, this is not _the_ way to teach people CS, but I think it's damned good. Here are some of the reasons why.
So, I think there are a lot of really good points to using scheme as an introductory programming language, if you do it right. It lets you address a lot of important concepts, up front, and does it well. Now, it's certainly not the most practical language for most things, but it's not a language that people misapply very often, so I don't think there's a big danger there. If your intoduction to CS is done right, you can start using any new language in about half an hour, although you'll want to keep a lot of reference materials on hand for the first week or two.
Overall, I think our intro CS class is done really well, although it's not the One True Path. I think we'd see better Computer Scientists and Computer Programmers if more schools used well thought out systems like this.
NoBeardPete
Arrr, it be the infamous pirate, No Beard Pete!
Teach the fundamentals. Don't teach how to write a Java program (or C++, or Smalltalk or whatever). Instead teach how to construct an Algorithm or how to build a data structure or how to create a good interface. Once you are firmly grounded in the fundamentals, learning commercially popular languages is just a manual-reading excercise.
As a class of '98 CS grad, here's my take: You should stick with C/C++. I think you need to understand things like pointers, and memory management, if not just for the purpose that you know whats going on, so you know what the GC is doing, (or trying to do ;)
Going from C++ to Java for me was pretty easy. As was going from C++ to C#. Heck, going from C++ to any language for me is easy.... But I think if you learn Java or C# first, and get comfortable with it, you are missing out on a lot of things, and may not even some concepts well.
I think its akin to giving a student a calculator in elementary school, and letting them use it for their mach classes... Sure, they can do things easier, but in the end, who is better off? You don't want to have to rely on the calculator (Java) for everything. If you know the underlying stuff, and the underlying principles and such, your life would be easier. As an example, (probably a bad one):
If some asks me to calculate the root of some arbitrary number, I'll need to dig out my calculator. If you ask my dad, just give him a pencil, and he'll calculate it for you. Its a shame they don't teach that in schools anymore... But my point. In college, one of my upper div math classes was number theory... It was pretty confusing. When I asked my dad for some help, he was able to explain a lot of things to me, and he understood it really well. Little things like these, can give you a different outlook on the way things work, if you know what I mean.... Why limit your repetoir(sp?) The more conecepts you understand, the more flexible you'll be...
Maybe this is a better way to explain. In the windows world, I'm very proficient in utilizing straight win32 sockets. Because of this, I feel that I could pretty much code whatever I want that dealt with sockets. Whether it be RTSP or whatever. One of my friends who claims to be a guru, despite the fact he only knows VB. Well, he only knows how to use the active x controls. Thats all fine and dandy, but I ended up helping him code a lot of the communications modules, because he didn't quite understand sockets. In the java world, I think if you get all used to Java.net , and not the berkely sockets implementation, you are only hurting yourself.
Thats funny. For most of my stuff, if I wasn't using X-Win, I was just coding it on my windows box. When I took 3D Graphics, I had no problems coding to C++/Open GL, on my windows box, and giving a demo to the prof on an NT box, and the TA on a solaris box. In fact before our dorms had ethernet, I coded on my own box, with no problems. In fact, the only time I remember having problems, is in my java class! My app ran fine in the lab, but went to crap when I tried running it in the dorm.
I don't think that comparison is accurate.... I think a better comparison would be: C++ --> Learning to swim by jumping into the shallow end of a pool, and learning to swim Java --> Learning to swim by jumping into the pool, with all sorts of inflatable devices around your neck, arms, legs, etc etc... I'm sure you could learn to swim both ways. It is even easier to learn to swim the latter way... But who do you think is going to be a better swimmer?
There were two main reasons for delibratly choosing non-mainstream languages:
To make people focus on the problems, not the details of how to implement the solution, and
To level the playing field between the "baud d00dz" who already knew mainstream languages and the people who were new to programming.
Like Waterloo, you were basically expected to learn new languages on your own as you needed them, because that's what you're going to be doing throughout the ~40 years of your career.
It's more important to train a future computer scientist to know how to reason about problems and analize the benefits and costs of solutions than how to express themselves in the language of the compiler; The problems don't really change based on the language.
In fact, in the OO course, we didn't even program at all; we were just graded on our data models and analysis.
To put it another way, it's no easier to solve the Halting problem in C++ than Java :)
It's more important to be able to recognize it
so you can _stop_ trying to solve it.
As an aside, the year after I graduated, there was a battle in the faculty between the more "science" oriented professors and the more "training for industry" professors. I don't know who won.
It seems to me that this is a topic that will remain generally debated for a good while longer. On the whole, I think we'll see many more universities move their introductory programming courses to Java. However, I don't see this so much as a problem, rather, it may well be to the students' benefit.
When one looks at how universities teach programming/computer science, we've got to remember that there are at least two primary aspects one must learn with regards to this. As science consists primarily of theory/hypothesis and actuality (that is, actuality being the refinement and testing of theory through experiment).
Considering computer science, one must accept that OOD/OOP is the theory currently in the most favor. I, at least, tend to think that Java provides a reasonable means to teach OOD/OOP theory. Java is heavily object oriented and strongly typed, causing students to adhere more stringently to OOD theory. Moreover, Java provides a sandbox in which young programmer can begin to better understand advanced topics (e.g. pthreads or Java's Thread API, which sounds easier?). Further, Java, as I see it, stands as a gateway language. That is, it provides a reasonable bridge between the languages of today and the languages of the future.
However, theory alone cannot create useful and skilled developers. Students will have to learn C and assembler. They will have to understand how opcodes are developed, how kernels handles socket calls, etc. The actuality of computer science, having not yet caught up to the theory, requires students to understand both and the differences between the two.
That said, I see no harm in universities naming Java their introductory language of choice. In addition to the benefits above, its syntax is close enough to C that the transition to the "actuality" of programming should be relatively easy. So, I suppose, in the end, we must let the kids have their sandbox, where else are they going to learn to play nicely?
I think Programmers should start out with UnrealScript. I know that may sound really corny, but I had taken classes in c++ and java and I didn't reall grasp what could be done with oo programming until I started doing some modifications for Unreal. If I were to teach an advanced programming class in high school I would buy a bunch of copies of Unreal...take out the offensive material and use it as a teaching tool. I think this would have some advantages: 1. It is fun. 2. It can be as simple or as complicated as you want. 3. You can see real results from your code other than lines of text. Just a thought... -Skile
I think the initial question is being ignored: Should Java be used to teach object oriented programming? To this I would have to heartily say yes. I felt that learning Java didn't really complicate the already awkward task of learning OO. Java makes an excellant "concept" language by excluding a lot of the overhead introduced by C/C++ such as pointers and the multiple files needed to do OO. However I also think that any practical computer science program will also make it a point to include experience in the "real world" languages. At my school they began with Java then segued into C++ OO and then threw in C and assembly for the more hardware-intensive classes.
I am currently a student at Kettering University in the CS field. Here, they teach JAVA as the introductory language. The reason is that its so much easier to pick up. Speed and resources don't matter, especially when you don't have any GUI to worry about. As for C, all advanced classes are taught in C, because of its speed and over usage. Both are fine, its just easier for some to learn JAVA first to get the basic jist of things.
I am currently in school as a CS major. The first programming language I ever used was C++ and almost all of my classes since have also been in C++. I had never programmed before collage, yet didn't find the language that difficult to pick up. While I would love it if my school offered Java classes as an option, I don't think that Java should be the core of CS. C/C++ gives students not only a good understanding of the way a computer works, it also gives a good base for learning other languages. No, it's not the easiest thing out there, but do we really want just anyone getting in (and staying in) the CS major?
Personally, I don't consider anyone a CS major until they have passed both assembly and data structures. They are two of the most difficult classes to pass (at my school anyway) and they really teach you how to program.
I sympathies with people outside the major that are required to take a beginning programming class, but don't think we should make our major easier just for them. Maybe if Java was offered as an elective in CS they could take that instead. Also, there is the issue of OOP. Java is probably a better example of that then is C++, and maybe Java would be a better language to use in OOP classes, but don't change all of the curriculum.
Personally I would like to see more languages taught in CS, but I still believe that C/C++ should be the core of the major.
I just graduated with a B.S.C.S. and a B.S. Mathematics, and have spent a good deal of time considering this issue. I also have Sun certifications in Java and use it daily in my job.
In the CS program, Java was used as the primary language from freshman year on. This approach was a good thing (tm) in my mind. Having a single consistent language across all classes allows students to focus on learning the material that is taught in the class and exploring those concepts in their programs, as opposed to fiddling with obscure problems from languages they are not familiar with. Also, it allows the students to develop and the teachers to test on whatever system they are most comfortable with because of the platform independent nature of the language.
These advantages make the actual act of programming much more transparent to the student, so that they focus on the science part of computer science. While some programs have different views, the one I attended, and my personal opinion as well, dictate that the objective of a Computer Science education is to teach you the theory behind the construction of a program to solve problems efficiently, as well as expose you to prior work by individuals in these areas. In this respect, a computer science degree is much more like a math degree than an electrical engineering degree. Those who are interested in writing device drivers and other low level programming or in understanding the internal workings of a computer from cache coherency and pipelining to defining machine instructions should seek a computer engineering degree. At most universities, these are separate programs, and should remain so.
No, Java does not allow you access to these low level mechanisms, but if you learn how to program well in an abstract language like Java, then you are learning techniques that are applicable in all languages. They just might take a little more time to implement in assembly. One of the pros for the buisness world, and one of the cons for teachers is that Java has such a large API associated with it. This API allows for rapid development, as the programmer does not have to "reinvent the wheel" often. On the flipside students end up using data structures and methods they do not understand. However, if a program is well-designed, then the students will be forced to understand these abstract data types and implement them themselves before they ever have reason to use them. After that they will then have the API's particular implementation to use as a standard for the rest of their career.
I don't believe that educational institutions have any obligation to provide job skills to their students. Their goal should be to give them the a broad base of knowledge and the ability to adapt those skills to any situation. Choosing a consistent, platform independent, powerful, and adaptable language such as Java provides a good mechanism for presenting this information and for learning these skills.
IMHO it really doesn't matter that much what the first programming language is in a CS study, I think that one of the main goals of a good CS education is to learn how to use several languages based on different paradigms. Next to OO languages, functional (lisp, etc), logical (prolog and others) and parallel (modula 3) programming languages are as important. Let's face it, a programming language is just a means to tackle a given problem. Daniel.
"To be is to be the value of a variable" -- W.V.O. Quine
- For every winner, there are dozens of losers. Odds are you're one of them -
An introduction to what? If I was introducing PC architecture and how to write device drivers and interact with hardware I would use C/Assembly For teaching OOP concepts I would use Java. To say Java be used an introductory CS language withotu specifying what it is we are trying to teach students with the language is very ambiguous.
I go to a semi-small university in Texas (I won't name which one), and am a CS major. In the beginning of my college career, I wasn't sure I was going to even do CS in the first place, as I had no prior programming knowledge from high school except for some HTML (back when 3.0 was brand new :-) I took an introductory C programming class and really got a lot out of it, then took ASM followed by data structures, where I really figured out how to program.
Unfortunately, at our school, there is a programming languages class, much the same like at other universities, where the idea was to broaden our horizons to the other various languages (such as C++ and Java, and some theoretical stuff on other languages, like Ada, Fortran, Smalltalk, etc). Amazingly, we spent ONE day on Java, and about a week on C++; we had no programming assignments for Java either. What happened was that the class had been handed off to another professor who did not stick with the way it had been taught in the past.
I know of one Java programming class being offered besides the programming languages class; and there's one C++ using the STL. However, these classes are inaccessible to first and second (possibly even third) year students, as the classes are primarily for seniors and grad students. And these classes are electives only--not core classes.
Be glad you get Java early. Some of us don't get to see it and have to learn it on our own :-)
I go to a school that teaches nothing but Java, and I also have several consulting jobs on the side. In only one project in one of those jobs have I used Java. I am constantly asked if I know C/C++, Perl, PHP, VBScript, but almost never Java. I have oft voiced my opinion to the CS faculty here, but it is much less work for them, so they are very happy with it. While it is a good stepping stone for people with absolutely no experience, I still maintain that C should be taught, since that's mostly what employers want and can be used [well] on any platform, not just Win32, Solaris and Linux.
Miami University is also changing from C++ to Java for it's OOP courses.
The way things are going seems to be heading downhill in terms of the quality of programmers. Most of the people who have been in my classes thus far cannot understand basic concepts of coding, much less the complexity under the hood. Universities are creating programmers who cannot program, and switching to Java is going to make that worse.
"What's a pointer? What's a memory address?"
Basic concepts forgotton, and I'm sure that future software design will reflect this ignorance.
I don't have anything against Java, though. It's a great idea, widespread, and even though it's slow, remember how young it is. It still has some time to grow, and given it's popularity, I know it will.
Java shouldn't be the only language you know, but it should be one of them.
ln -s
bmongar has the best post I've seen on this topic: both correct and succinct. I teach Java at Northeastern University, and I've lived these tradeoffs.
Smalltalk is pure OO, but introductory students aren't sophisticated enough to understand the beauty of immutable numeric singleton objects and other such OO extremes. It is my second choice for a strictly OOP/OOD course in the 2nd year, after Java.
C++ is the best language out there for production of real application software. It is difficult to teach and basically requires that a lot of difficult low-level concepts are pushed into the first year. It is my first choice for a strictly software design course in the 2nd or 3rd year.
Java is the best language for introductory programming and here's why:
That's all you need in the first year. They need to learn abstract thought; a lot of the other posts ignore that fact.
Check out our pedagogical Java toolkit available here. This summer we are moving from toolkit implementation to developing a real good Java curriculum.
PBk
s.push(new Integer(((Integer)s.pop()).intValue()+ ((Integer)s.pop()).intValue()))
Is this *readable*, writing in code what i want to do? In LISP this looks:
(push (+ (pop s) (pop s)) s)
In Smalltalk it's similar easy
Java has certain design flaws from the beginning:
- primitive Types that doesn't fit anywhere
No higher order concepts to imply Casts
(Templates, Macros, etc.)
for the experiencend Programmer it doesn't offer the possibility to get the programming language that *meets* his problem domain. It doesn't scale with the programmers experience. (overloaded operators, templates) It combines awful things from different worlds:- it requires compiler runs before testing
- it is as slow as an interpreter language
(even Perl can run faster)
- it is picky about Types as a machine compiled language
It maybe offers some security and platform independence. but the latter is unimportant for learning to hack in CS. I would start the beginning with something clean:I shouldn't contradict you, since I'm co-author of an introductory CS text using Scheme, but actually the read-eval-print loop isn't a distinguishing advantage vis-a-vis Java, because there is a cool Java environment called BlueJ that essentially provides the same kind of interface, where you don't have to write I/O code to interact with objects' methods. See http://www.bluej.org/. (Of course, there are other reasons why Scheme may still be a good choice.)
Java is a very nice tool for web-apps, etc. But there are so many obscure little quirks that make it hard to understand. The built in libraries are complex and allow new programmers to not have to learn how to do many basic functions b/c they are already included in these libraries. Furthermore, it takes a lot of code to do simple tasks. I mean a simple output to the console is "System.out.prinln("Java is FUBARed as an into language")." I go to Georgia Tech and the first two semesters of C.S. are Psuedo-code (another serious waste of time) and Java (which is the main portion of both semesters). Asking a new programmer to reverse engineer programs that java allows to be really complex and memory hogs makes the entire learning process too hard to be beneficial. C/C++ are good intro languages. These would give newbies a feel of how systems work before they start memory management. Allowing people to learn design and get an understanding before jumping into GUIs and stuff. Jumping into languages that can easily make GUIs without actually understanding how GUIs work will lead to mentally-malnourished programmers. Maybe thats just me...
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!
We can cannot guarantee success