Saturday, May 22, 2010

Why is Java used instead of C++ in AP Computer Science?

I do not understand why Java is becoming so popular in programming curricula-supposedly it is "easer" to learn/teach because it only supports object-oriented structure; however, I completely despise it due to the high abstraction level (it lacks support for many functions)-it makes no sense to me at all. I've also heard C/C++ is more widespread in software (extensively used in UNIX/Linux applications).

Why is Java used instead of C++ in AP Computer Science?
In some respect it depends upon the philosophy of your CS teachers. Much of CS involves learning things like data structures, algorithms, etc., which are independent of language. Using a relatively easy language to learn like java helps concentrate on what they think is important in the long run. It is a smaller hurdle to jump over than C/C++.





On the other hand there are some areas in CS that are less amenable to java. You aren't going to write an operating system or device driver in it, for instance. So in the long run you will probably learn some C/C++ and maybe assembly anyway.





Open your mind to java a bit. Managed languages have their place in the world and there is much in java (namely OOP) which you are going to need for C++ anyway. It is all about collecting a set a tools. Each has it uses and it is better to have more than less.
Reply:Java works as a standalone application ( IE: to run on your pc like any normal software )





It also runs in a webbrowser.So you can basically create powerful Apllications on the internet and on a standalone PC.





Rather than learn C , Learn java. Its basically the same anyway.
Reply:Because it's cheaper (free) for students, not sure if universities have to pay Sun for using it, Object Orientated language, and less complex. They can teach object orientation and classes a lot sooner, instead of explaining the differences between pointers, references, string manipulation, STL, memory allocation and the heap, and other things. No worries about what sort of machine to execute on either. Much less of a headache all around.





Edit to add:





C is easier than C++. Inheritance and polymorphism is a lot easier to learn under Java, because in C++ you can have multiple inheritance which can be a pain. For instance, if you have a virtual function in your class, you better make your destructor virtual as well, or it might not get called properly. There are all these little gotchyas with C++ that you do not need to confuse new students with when learning the language.
Reply:I know what you mean about Java being the "in" language when it comes to Comp Sci. The problem with languages like C++ is that they are extremely complex (as is Java) but there are a lot of different characters used in C++ that are very hard for beginner programmers to grasp the concept of such as the redirection character and class member symbol.





The good think about Java is that it paves the way for Internet Technologies as well as Desktop Applications not forgeting that it is a platform independent language.

flowering plum

No comments:

Post a Comment