PDA

View Full Version : What language did they make Java in?



jverkoey
06-30-2005, 11:41 PM
I'm curious.

-edit-
My reasoning behind asking this:
http://www.collegeboard.com/ap/pdf/adhoc_report_surveys.pdf

To quote:

Reasons for Changing
• Safety is important at all levels of software design but especially when learning to program. Although there
is some confusion about what a safe programming language is, we are using safety to mean: Any attempt to
misinterpret data is caught at compile time or generates a well-specified error at run time. Java is a safe
programming language. The Java compiler catches many inadvertent errors and the Java run time
environment ensures that any attempt to misinterpet data will generate a well-defined exception.
• A simple language should be used to teach programming in an introductory computer science course. A
simple language will be grammatically as well as semantically uncomplicated. It will be easy to learn,
because the notation will express programming concepts in a straightforward way. The appendix includes
a comparison of some language features that illustrate how simplicity helped guide the APCS Ad Hoc
Committee’s recommendation to switch to Java.
• Object Orientation involving encapsulation, inheritance, polymorphism, and abstraction, is an important
approach in programming and program design. It is widely accepted and used in industry and is growing in
popularity in the first and second college-level programming courses.

Point 1: What the hell? Why is it that we are deeming it ok to let programmers become lazy with their code now?
Point 2: Simple language? Are you kidding me? If you want to teach a simple language, teach basic or something! Java is right on par with C++ on difficulty level.
Point 3: Object Orientation: And..umm, C++ doesn't have that? *raises eyebrow*

It just annoys me that Sun goes out of their way to bash C++ in to the ground.


-edit 2-
And why does Sun have a C compiler?
http://docs.sun.com/source/819-0494/index.html

Seems a bit odd....

nickname_changed
07-01-2005, 03:45 AM
Point 1: What the hell? Why is it that we are deeming it ok to let programmers become lazy with their code now?

Where the hell did it say that? Making it harder for programmers to make a mistake does not mean lazy.


Point 2: Simple language? Are you kidding me? If you want to teach a simple language, teach basic or something! Java is right on par with C++ on difficulty level.
Yeah, I hate spending hours chasing those simple memory errors in Java :rolleyes:


Point 3: Object Orientation: And..umm, C++ doesn't have that? *raises eyebrow*
C++ does have object orientation. It also works great as a hacky procedural langauge. Take a look at the C++ board, half the posts I can see there are using procedural methods and old C functions. You won't be tempted to do this in Java, and it will force students that are learning to do things the right way. Typedefs, #define macros, all make it easy to make your "object oriented C++ code" a royal mess and turn it back into C.


It just annoys me that Sun goes out of their way to bash C++ in to the ground.
That's OK, "Micro$oft" go out of their way to bash Sun ;)

nickname_changed
07-01-2005, 04:08 AM
Oh, and I don't think they "made Java" in any language (except maybe English to start with). The Java runtime engines however were probably written in C or C++. That doesn't prove anything though - beautiful houses can be made from blu-tac and rusty nails (a lot of them).

Brian
07-01-2005, 05:41 AM
Java was written in C++. Of course they're going to bash it into the ground if they're trying to sell Java.

My reasons for not using Java would be:
*Its slowness.
*Its tendancy to hog memory.
*The horrible, forced syntax.

nickname_changed
07-01-2005, 06:59 AM
*And the style - camel cased method names? Eww!

7smurfs
07-01-2005, 06:59 AM
That is one thing I like about the university I plan on going to, they allow you take C++ courses instead of Java, but they do have a few "forced language" courses.

Sang-drax
07-01-2005, 07:47 AM
Java isn't 'made' or 'written' in another language. It is a language by itself, with specifications created and written by humans in a human language.

Most Java implementations are likely written in C or C++, but it doesn't really matter. It is possible to write a C compiler in Java too.

kermit
07-01-2005, 07:53 AM
It is possible to write a C compiler in Java too.

[flame bait]

But that is just evil...

[/flame bait]

;)

Sang-drax
07-01-2005, 07:53 AM
Java is right on par with C++ on difficulty level.
No, it is not. Java is much, much simpler.

No multiple inheritance (virtual base classes etc.)
Very, very simple templates compared to C++
Not both pointers and references
Easier syntax (no pointer to a pointer to an array of pointers to a function)
Only one type (almost) of allocation (new)
EDIT: No macros
EDIT2: Garbage collection

The list probably goes on.

jverkoey
07-01-2005, 12:27 PM
To clarify, I meant what did they make all of the compilers/virtual machines in. I don't see them pointing out to the press that mostly their whole base is founded upon C and C++....

Also, I am not completely dull on the topic of Java, I have taken the time to learn the language, so that I may present a valid arguement. I have to say, from what I saw in the course that I was in from the other students, when people go from Java to C++, it's a pretty good jolt. Seeing as, because of the AP board switch, my school completely stopped teaching C++ that year, I started offering to teach kids C++ after school, and I noticed that the people who had learned Java initially had the most trouble understanding memory management and such, seeing as they've been working in an environment where you don't have to clean up after yourselves at all.

There's something I read in the rationale for changing the C standard (to c99) http://www.open-std.org/jtc1/sc22/wg14/www/C99RationaleV5.10.pdf

• Trust the programmer.
• Don’t prevent the programmer from doing what needs to be done.
• Keep the language small and simple.
• Provide only one way to do an operation.
• Make it fast, even if it is not guaranteed to be portable.
These are the general rules of C, and I think they're fantastic. I know C isn't C++, but C++ builds off of C in a lot of ways, so much of the C standard applies in C++.

Honestly, however, I think "The Spirit of Java" is quite the opposite.

xErath
07-01-2005, 02:45 PM
It just annoys me that Sun goes out of their way to bash C++ in to the ground.

That's what Aza Dotzler (http://weblogs.mozillazine.org/asa/) is doing to Opera


About Java.... The java community always states that Java is real fast, faster than c++, and show results of stupid benchmarks.
Why java is slow than c++ is easily understandble.

runtime constant type-checking (the often dynamic_cast of c++)
lots of heap memory allocation, unlike stack allocation which is much more faster
a giant API which it too modularized (lots of classes and method which stack up upon themselves)
bitcode, unzipping classes from jars
the GC !!!
all methods are virtual, much more overhead than calling non virtual methods
arrays themselves are classes, for which calling the subscript operator implies more method calling
the ideology of no public vars !!! only private with 2 methods for acess - yeah right, 2 virtual functions -> 2 pointers, memory bloat as always
use your imagination


Java as been overused, and overapreciated, just because is favours lazyness, and has über l33t IDEs. Java is no good for a real application, only for learning (OOP), and for webpages applets...

Perspective
07-01-2005, 05:58 PM
>>Java is no good for a real application

hehe, that one made me giggle. Of course there's no *real* applications written in Java :rolleyes: and if anyone ever wrote, say for example a 2.5 million line code application platform with a dynamic plug-in architecture (www.eclipse.org) in java, it would never pan out :rolleyes:

oh, and the rich library set, what were they thinking? Everyone knows its super optimal to reinvent the wheel everytime you need commonly used functionality :rolleyes:

man, i haven't been that sarcastic in a long time... but i got sucked into the language war :(
/me leaves the language war.

xErath
07-01-2005, 06:43 PM
Of course there's no *real* applications written in Java :rolleyes: and if anyone ever wrote, say for example a 2.5 million line code application platform with a dynamic plug-in architecture (www.eclipse.org) in java, it would never pan out :rolleyes:

I'd prefer netbeans which is also in Java. But the point isn't in this case the Java itself, but the Java mentality. A java only programmer doesn't care the least about memory, and resources consuptiom, because the Java mentality says, let the GC or the VM handle it. someone that learns Java never learns those important issues. Then you'll have bloated, slow, applications, like Azureus for instance. (i've used Azureus for a long time - got sick of it).
Fortunatly Eclipse and netbeans are made by professional experienced programmers ;)


oh, and the rich library set, what were they thinking? Everyone knows its super optimal to reinvent the wheel everytime you need commonly used functionality :rolleyes:
yes it's rich, but have you ever looked at the source ?? for Collection each regular method call may stack about 2 to 7~8 different methods calls from the inside. Each GUI call can go up to 10~16 calls till it reaches a native function... That not a ideal of efficiency. Only interface, rich interface.

okinrus
07-01-2005, 06:46 PM
C++ does have object orientation. It also works great as a hacky procedural langauge.

stovellp, in Java you could write all your functions as statics and you'd have something similar to a C functional program.



Take a look at the C++ board, half the posts I can see there are using procedural methods and old C functions.

Even in an object oriented development, using a few C functions for minor utility isn't bad.



You won't be tempted to do this in Java, and it will force students that are learning to do things the right way. Typedefs, #define macros, all make it easy to make your "object oriented C++ code" a royal mess and turn it back into C.

See above about Java static methods.

major_small
07-01-2005, 09:33 PM
going from C++ to java, I have to say I do like the GC, but only because it allows me to be lazy. I do believe, however, that it's a terrible habit to get into, and even worse to teach to fresh programmers... no matter what you think, that memory has to be taken care of. somebody has to do it. I personally would rather do it myself.

As far as java's forced OOP, from a learning programmer's point of view, System.out.print() is the same as printf(), so the learning still doesn't take place. Just because you tell a new programmer they're using a class doesn't mean they now know how to write an OOP--that's a big point of using classes--you can use it without knowing how it works.

and as far as I'm concerned, just because you use cout or System.out.println in your program doesn't make your program OO. for example, a simple hello world program (see below). I wouldn't consider that an OOP. and it's a good point for how OOP isn't always the best way to go. if anything, C++ tells you when it's a good time to use OOP and when it's not.


#include<iostream>
int main()
{
std::cout<<"Hello World";
return 0;
}

Mister C
07-03-2005, 09:14 AM
Also, I am not completely dull on the topic of Java, I have taken the time to learn the language, so that I may present a valid arguement. I have to say, from what I saw in the course that I was in from the other students, when people go from Java to C++, it's a pretty good jolt. Seeing as, because of the AP board switch, my school completely stopped teaching C++ that year, I started offering to teach kids C++ after school, and I noticed that the people who had learned Java initially had the most trouble understanding memory management and such, seeing as they've been working in an environment where you don't have to clean up after yourselves at all.


As for AP CS and Java at Universities: java is here to stay for the immediate future.

AS for Your school if there was enough enrollment it could offer courses on other languages. Many high school teachers I spoke with at Clemson- teach other languages like C++ and Scheme to their students.

As for the Java vs. C++, both have merits and problems.

Mr. C. :D

jverkoey
07-03-2005, 09:57 AM
Enough enrollment? My high school had 1500 kids in it, and 3 programming classes of 20-30 kids each. I don't really classify that as a small enrollment.

7smurfs
07-03-2005, 04:18 PM
CPP.Color = red;
Java.color.type = blue.
I use both,
why can't you?