Jump to content
xisto Community
Sign in to follow this  
saint

On Why Java Is 'c'ooler! additions / criticisms invited

Recommended Posts

im basically a C++ programmer and into Java only now..and i seem to falling in love with it.
here are my thoughts on why i think Java seems cooler

i invite people to add on to the list, im sure there are great many things i have missed out..things im yet to be enlightened in Java!


1. no more of those wierd pointers!

this pointer thing always seemed to me something gone all wrong..something that lacked better conception.
thank god i dont have to use * and & alternatively to deal with one same thing. pointers in c and c++ were surely something that made a simple job tough. everyone of us felt it when we first learnt pointers and the feeling never goes away too.


2. no unnecessary bitfields probs!

if pointers seemed all wrong..this one seemed senseless! c'mon...no way can it be our prob to worry about wasted bits and pieces! it is the compiler's headache and it has to take care of it on its own. we have enough to worry about developing our programs.


3. world without multiple inheritence? and it seems smarter!


i agree i couldn't believe this one at first. all the reading and hearing about how C ++ gave a new dimension to OOP with multiple inheritance kept running at the back of my mind. and it took me a long time to actually accept it and understand the new way. but after having understood it...yes...interfacing seems smarter! this one is definitely the icing on the cake..im amazed how they pulled it off.


4. no "unsigned" problems!

wait a minute...did you ever have a negetive int as value for a variable?
another unnecessary piece of coding.


5. no 'global' problems!

oh what a horrid time we had getting variables and functions to work when you declare somewhere but need to use it again somewhere else and in order to reference it you had to look into those global and local declarations...were they all really worth the pain?


6. no overloading and underloading..lol!

use an appropriate method name instead...simple, sweet, cute and more importantly - meaningful.


7. no function pointers!

when pointers by themselves were ugly then what to call this.

use the smarter Reflection.

like:

Method method = Pet.class.getMethod("getFood", null); // invoke getFood() on object "dog"Object address = method.invoke(dog, null);

now a'int this simple and cool?


8. what was 'goto' doing in oop?

i never seemed to get it from the start...you branch off from C and develop C++ as a structured programming and incorporate 'goto'? good logic.


9. no comma operator

a..what? what for?


Java is Cool!

cheerz!

saint

Share this post


Link to post
Share on other sites

I think, wait till you learn .NET, you will find it is cooler than Java. To me, Java is not a very easy programming language. Probably I am .NET trainned because .NET is really easy to program. No much complicated programming skills are need for .NET. In my school, I was taught .NET in the first 2 years. In the 3rd year, I was taught with a brand new programming platform, Java. I find it not easy to get the hang out of it. Java is really sensitive, in which the fact that Java is case-sensitive and more. .NET however issn't case sensitive. If it is, the IDE for .NET will automatically change to the correct case so the programmer can basically not bother about it.I don't really like the use of extended classes in Java as it gets complicated when the program gets bigger. Sometimes a "null exception" happens for no reason. And this error basically halts the entire programming work. Sometimes I restarted the computer, the null exception error just go away. Weird, but it's true. Such disadvantages made me think bad about Java.Of course on the other hand, Java is a free programming language that is used quite commonly now adays. However I believe once Windows Vista is launched, Java may be supported lessly on the Vista operating system. Vista will be fully a .NET compatible software. Since .NET is from Microsoft, we all have to pay a price for it, otherwise Java will be an alternative.Pro and cons.. The programmer have to decide on preferences, compatibility and scalability.

Share this post


Link to post
Share on other sites

I'll agree to Saint. I think Java has really a lot of advantages about C++. One of the main problems of Java, the speed, is improving more and more an I think it won't take very long and ths speed problem is no problem any more. But today one shouldn't compare Java to C++, it's better to compare it to C#. With the .NET environment there are a lot of advantages you didn't had with C++, like for example the pointer stuff which has been replaced by C#. But generally I think Java is at present the best programming language to use! And I also think it's a good choice for beginners to start with, cause you can achieve first results relatively easy.Greets, Chris

Share this post


Link to post
Share on other sites

I agree that java's generally designed to encourage good coding practices, which is great compared to c++. Its pre-written code libraries are also excellent. Having a pre-written and accurate API is wonderful. However, I'm worried that with the addition of garbage collection new programmers are going to have a very poor idea of memory management. Java automates a lot of the little things that you have to do in C++ manually -- which isn't necessarily bad. However, add in an IDE like Eclipse that practically writes a third of your code for you, and someone who learns Java first is never going to find C++ accessible.Pointers are a but kludgy, but are absolutely essential to systems programming in C. I have not yet, and I hope never to see an OS written primarily in Java. ;-) The same goes for bit fields -- you could never write malloc in Java.One other neat feature is its ability to support "native" code (meaning c++) to get around its own limitations.

Share this post


Link to post
Share on other sites

I would definitely go with Java, its got more power and compatibility than anything else. I couldnt help but notice a little noobishness about the difference between the languages themselves and an ide, and the null exception was prolly the ide as well. Also, Java will still be quite prominent when Vista comes in - Microsoft doesnt make their software on Java, instead Java makes their libraries on Windows. Oh yeah, and if you get a Java license you are actually entitled to modifying Java itself (add another point to the list - it does have applications).

Share this post


Link to post
Share on other sites

Even though this may be considered an old topic, I feel I have a few pennies worth of ideas.

1. no more of those wierd pointers!
this pointer thing always seemed to me something gone all wrong..something that lacked better conception.
thank god i dont have to use * and & alternatively to deal with one same thing. pointers in c and c++ were surely something that made a simple job tough. everyone of us felt it when we first learnt pointers and the feeling never goes away too.

If it is such a simple job don't use a pointer in the first place. Also, problems with pointers is is a problem of the coder not understanding. Pointers are crucial to so many things.

3. world without multiple inheritence? and it seems smarter!

i agree i couldn't believe this one at first. all the reading and hearing about how C ++ gave a new dimension to OOP with multiple inheritance kept running at the back of my mind. and it took me a long time to actually accept it and understand the new way. but after having understood it...yes...interfacing seems smarter! this one is definitely the icing on the cake..im amazed how they pulled it off.

If you aren't going to use multiple inheritance than don't use it. Having it allows flexibility. Think about other things in life, isn't it always better to have something even though you think you'll never use it, just in case.

6. no overloading and underloading..lol!
use an appropriate method name instead...simple, sweet, cute and more importantly - meaningful.

Once again, if you don't want to overload the function, then don't. Nothing in C++ keeps you from giving functions different names.

7. no function pointers!
when pointers by themselves were ugly then what to call this.


What is so hard about
int (*function)(int c);
? Also, for the third time, if you don't want to use it then don't.

8. what was 'goto' doing in oop?
i never seemed to get it from the start...you branch off from C and develop C++ as a structured programming and incorporate 'goto'? good logic.

Once again, for the fourth time, if you don't want to use it then don't (like almost every C++ programmer), it was probably kept to keep compatibility with some C stuff.

9. no comma operator
a..what? what for?


You're complaining about a comma, a simple comma, when in Java just do a simple little program, you have to do
public class Hello{	 public static void main(String args[])	 {		 System.out.println("Hello World");	  }}
as opposed to C++
#include <iostream>int main(){	std::cout << "Hello World\n";	return 0;}
or Perl, one of the most powerful languages
#!/usr/bin/perlprint "Hello World\n";

Also, Hiko Haieto, I'm sorry but Java is nowhere close to being more powerful than anything else.

Also, speed is horrible. Using the unix time utility I timed a Hello World program written in Java and time output this:
real 0m0.305s
I've written much more complex programs in C or C++ and they never even go above 0m0.100s and rarely above 0m0.50s

I only agree with WindandWater, let us pray a operating system is never written in Java.

I leave with these articles: http://forums.xisto.com/no_longer_exists/
http://www.paulgraham.com/javacover.html
Edited by windowpane (see edit history)

Share this post


Link to post
Share on other sites

I only agree with WindandWater, let us pray a operating system is never written in Java.

So do I. The only reason why I use java because in my college use it. Personnaly I really like C/C++. Java application's speed is very-very poor for critical application. Some example, I have JDK 1.5.07 we know java born in 1995 and it's eleven years old.

Why for eleven years old. I try to make program to show user save/open/etc dialog, it takes about 5-6 seconds to open!!! if we use our OS theme. Men...!, people who used will sleeped until the box open! :)

C/C++ is the best programming language that ever born!!

Share this post


Link to post
Share on other sites

There are numerous things that are great about java and numerous things that are better in c++. Java for one is very portable and very OOP oriented. However, because of the JVM java also is slower than natively compiled C++ programs since machine code runs fast than a JVM that has to compile on the spot. Also, C++ is much better at numerical calculations than java. As for no pointers in Java you could not be any more wrong. In Java, everything is a pointer and there are numerous ways you can use pointer arithmetic and other pointer operations that are very useful in C++ also in java.Overall, you have to look at what you are going to do and then decide on a language. Just because you like one language better than another does not mean you should always use it. Use a language because the strengths that you are using out weight the negatives.

Share this post


Link to post
Share on other sites

I dont know Java, at least yet. But there is one thing that is for sure that can be added to the why java is cooler list. It is that there is a high amount of job opportunities for it, I read it on this link:

http://www.eweek.com/c/a/Mobile-and-Wireless/HP-TouchPad-Needs-68-Weeks-for-Additional-Shipments-142584

In it you can see it compared with 10 other languages, including .Net, and you can see that in that investigation it is numer one in job opportunities. So I think that makes it a lot cooler than the rest.

Share this post


Link to post
Share on other sites

I am not really that inclined in the technical aspect of Java but I have been programming for 3 years and I can safely say that it is my strongest programming language compared to other lanuages such as C++ and .NET Right now, I am doing Java Mobile applications to be ported on your mobile phone, and I believe Java will be the way to go when these things are concerned. Just to correct the post by Saint (No Offence)1. Pointers will always be there, it is crucial for any programming language. It may not be as complicating syntax-wise as C Programming, but it will always be there. 2. Multiple inheritance is allowed in Java. I don't see why you say that it is gone. For example, A person may inherit from a human and a human can inherit from a species. There may not be 2 instances of inheritances within a class but there can be multiple inheritances. For some reason, I think Java being case sensitive is beneficial to us. .NET simply pamper us too much with their casing changes. With Java, we will learn to program in the right way with proper variable naming conventions and things such as that. I second your post though, Java is cool! I love Java

Share this post


Link to post
Share on other sites

I think, wait till you learn .NET, you will find it is cooler than Java. To me, Java is not a very easy programming language. Probably I am .NET trainned because .NET is really easy to program. No much complicated programming skills are need for .NET. In my school, I was taught .NET in the first 2 years. In the 3rd year, I was taught with a brand new programming platform, Java. I find it not easy to get the hang out of it. Java is really sensitive, in which the fact that Java is case-sensitive and more. .NET however issn't case sensitive. If it is, the IDE for .NET will automatically change to the correct case so the programmer can basically not bother about it.

 

I don't really like the use of extended classes in Java as it gets complicated when the program gets bigger. Sometimes a "null exception" happens for no reason. And this error basically halts the entire programming work. Sometimes I restarted the computer, the null exception error just go away. Weird, but it's true. Such disadvantages made me think bad about Java.

 

Of course on the other hand, Java is a free programming language that is used quite commonly now adays. However I believe once Windows Vista is launched, Java may be supported lessly on the Vista operating system. Vista will be fully a .NET compatible software. Since .NET is from Microsoft, we all have to pay a price for it, otherwise Java will be an alternative.

 

Pro and cons.. The programmer have to decide on preferences, compatibility and scalability.

 


1. we were taught java during our first years....well, to be exact, not taught, but rather we were "forced" to self study it :)

2. You're comparing the IDE and not the language.

3. extend classes are found in most OOP Languagees. And it's only daunting for beginners, but very useful for amateurs and beyond :P

4. Programming Language is free ! Even .NET is free! ...However, their IDEs are not.

5. Java is OS independent (at least, it's almost is). The java community would only have to make a java compiler and virtual machine and it'd be alright.

6. MS is not as strong as before. In fact, the delay in vista's launched has cost them greatly. If open office gets more acceptance in the years to come. we might see the end of MS monopoly.

 

I'll agree to Saint. I think Java has really a lot of advantages about C++. One of the main problems of Java, the speed, is improving more and more an I think it won't take very long and ths speed problem is no problem any more.

But today one shouldn't compare Java to C++, it's better to compare it to C#. With the .NET environment there are a lot of advantages you didn't had with C++, like for example the pointer stuff which has been replaced by C#.

 

But generally I think Java is at present the best programming language to use! And I also think it's a good choice for beginners to start with, cause you can achieve first results relatively easy.

 

Greets, Chris

 


1. Yes, speed-wise C++ is definitely better. But then again, why stop there? why not go for assembly? - the reason, because the bigger your project becomes, the lesser that difference in speed becomes.

2. Pointers are very useful. Eventhough i specialize in java, i never forget my pointers. it will help you understand a lot of things :P

3. For beginners, i prefer teaching C. But if you want output right away, go for .NET. I'm in java because i love the huge opensource community (plus a few more reasons) !!! :P

 

I would definitely go with Java, its got more power and compatibility than anything else. I couldnt help but notice a little noobishness about the difference between the languages themselves and an ide, and the null exception was prolly the ide as well. Also, Java will still be quite prominent when Vista comes in - Microsoft doesnt make their software on Java, instead Java makes their libraries on Windows. Oh yeah, and if you get a Java license you are actually entitled to modifying Java itself (add another point to the list - it does have applications).

 


precisely ! well said ! B)

 

Even though this may be considered an old topic, I feel I have a few pennies worth of ideas.

If it is such a simple job don't use a pointer in the first place. Also, problems with pointers is is a problem of the coder not understanding. Pointers are crucial to so many things.

If you aren't going to use multiple inheritance than don't use it. Having it allows flexibility. Think about other things in life, isn't it always better to have something even though you think you'll never use it, just in case.

Once again, if you don't want to overload the function, then don't. Nothing in C++ keeps you from giving functions different names.

What is so hard about

int (*function)(int c);
? Also, for the third time, if you don't want to use it then don't.

Once again, for the fourth time, if you don't want to use it then don't (like almost every C++ programmer), it was probably kept to keep compatibility with some C stuff.

You're complaining about a comma, a simple comma, when in Java just do a simple little program, you have to do

public class Hello{	 public static void main(String args[])	 {		 System.out.println("Hello World");	  }}
as opposed to C++
#include <iostream>int main(){	std::cout << "Hello World\n";	return 0;}
or Perl, one of the most powerful languages
#!/usr/bin/perlprint "Hello World\n";

Also, Hiko Haieto, I'm sorry but Java is nowhere close to being more powerful than anything else.

 

Also, speed is horrible. Using the unix time utility I timed a Hello World program written in Java and time output this:

real 0m0.305s

I've written much more complex programs in C or C++ and they never even go above 0m0.100s and rarely above 0m0.50s

 

I only agree with WindandWater, let us pray a operating system is never written in Java.

 

I leave with these articles: http://forums.xisto.com/no_longer_exists/

http://www.paulgraham.com/javacover.html

 


i agree with most of what you said, with a few exceptions:

1. speed-wise...read my msg above :P

2. OS written in java? highly unlikely :P they made a microcontroller before that run on bytecodes...and it basically sucked ! im not really sure what they were trying to do, but hardware and java don't mix well (unless a standard protocol is established).

 

There are numerous things that are great about java and numerous things that are better in c++. Java for one is very portable and very OOP oriented. However, because of the JVM java also is slower than natively compiled C++ programs since machine code runs fast than a JVM that has to compile on the spot. Also, C++ is much better at numerical calculations than java.

 

As for no pointers in Java you could not be any more wrong. In Java, everything is a pointer and there are numerous ways you can use pointer arithmetic and other pointer operations that are very useful in C++ also in java.

 

Overall, you have to look at what you are going to do and then decide on a language. Just because you like one language better than another does not mean you should always use it. Use a language because the strengths that you are using out weight the negatives.

 


1. Yes, JVM slows down the app a lot. I do hope they can make one which is similar to that of .NET :P very effective

2. Numerical calculations? I'd go for Mathematica or Matlab :P

3. Umm...in java, not everything is actually a pointer. im not really sure what you mean. but if you're refering to passing params by reference, then no. Java only supports pass by value, never by reference (although it may look like its by reference,it's not). If you mean everything is being accessed through their address because they're objects...not quite. java is not a full OOP Language (haven't tried 6 yet though). it still has some primitive data types, as opposed to .NET which has none.

 

 

 

IMHO, use the language the best suits your needs. For me? - java, because of the numerous open source community out there :P

 

...just my 2 cents worth

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.