Jump to content
xisto Community
shiv

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 :o

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!

shiv
Edited by shiv (see edit history)

Share this post


Link to post
Share on other sites

It really depends what I'm doing with it to determine which language I prefer. Quick little programs I prefer java but more intense programs that actually interact with the OS it's all about the c/cpp. Then again there are some things that annoy me about java even in smaller programs, like just i/o and file /io I find alot more intuitive with c/cpp. Really which language you prefer is all about preference. Persaonlly I agree with java not using pointers is usually a good thing, as they've caused me more then my fair share of headaches... but then again you can do some insanely powerful things with them when used properly so I like having them around heh.

Share this post


Link to post
Share on other sites

In my opinion, each language has its own perks. Java for its rapid development of applets, multi-threaded applications and it's easy to use GUI classes. However, C++ is definitely the more powerful language. There seems to be no limitations to what you can do with the language. Windows, linux, large games, etc... almost anything that is in the commercial mainstream is developed using C++. I also think that any large program developed using java, lacks the performance you can gain with C++ since C++ doesn't have the additional overhead of the Java virtual machine. Most of the syntactical issues mentioned just take practice and it won't be a problem anymore.

Share this post


Link to post
Share on other sites

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 :lol:

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.



That is a common misconception about Java. True that you will never have to use C-like points like -> to access them, but behind the scenes Java is FILLED with pointers.

Google around the topic about Java and Pointers and you'll read better stuff than I could ever explains. But it is true, Java has pointers, just not what you would expect to be pointers.

Share this post


Link to post
Share on other sites

I have always been a student of c/c++. However, recently I have discovered Java. I mean, it really was not a discovery, because Java has always been there (at least to me). However, couple of months ago I began reading on Java. I suppose one major factor that got me extremely interested was the revelation of a major misconception regarding Java. For instance, the conception (which was held by yours truly since couple of months ago) that Java is slow. Java *is* slow. However, speed, like everything else, is relative. The real question is that *how* slow is the performance of Java code. Obviously the question of how relates to the relative speed of Java runtime performance to c/c++. After doing several performance comparison tests with c++/win32/API programs against Java runtime performances, I realized that Java is not...*that* slow. "That" is a great generalization, I know. What I mean by "that" is: Java, as an interpreted language will *always* be slower than c++/win32. However, the speed differences are simply not that great. In terms of functionality and end-user performance, the speed difference is lot...lot smaller then one is led to believe. - Demirelli

Share this post


Link to post
Share on other sites

After doing several performance comparison tests with c++/win32/API programs against Java runtime performances, I realized that Java is not...*that* slow.
"That" is a great generalization, I know. What I mean by "that" is: Java, as an interpreted language will *always* be slower than c++/win32. However, the speed differences are simply not that great. In terms of functionality and end-user performance, the speed difference is lot...lot smaller then one is led to believe.

- Demirelli


thing i loved with java is that i can slam the users face with the words.. "go help your self"..

some users will make your life a hell by bugging all the little details to you.. like.. they are sure that the program you made will only run on windows and bugs you that it wont run when they copy it on linux/ubuntu/mac os.

everytime i face this situation i was forced to explain for 30 minutes or so that if it was said not to run on those OS.. it wont run..

-----

now i have special codes for this group of people.. i made them thru java and deploy to the user.. gives them all the downloaded virtual machine in one shiny cd for them to install.

now everytime they came back.. i can safely say.. "did you read the manual i gave and the single file you need to run and install to make the program work?".. it saved me a lot of time explaining things since the java portability can really run on almost all OS and i have manage to bring the challenge to my end users.

:)

--
big memory and a faster cpu will make your java program run fastter but the loading times will still be slow. well almost all programs loads slow just that some of them have this fancy splash screen.

Share this post


Link to post
Share on other sites

Good review!! I really like Java, especially the Garbage Collection part. I like to have my code managed for me-- it just seems to be the "right" way of doing things. I also really like the cross-platform capabilities of Java, where Java can be run by any machine having a Java JRE, which is nearly every operating system out there. C# is pretty cool too, but it does not have a much cross-platform capabilities as Java does. I have used C++, C#, and Java (among other programming and scripting languages) and I definitely like Java the best. I do not, however, like how Java handles XML, but I guess that's ok. I'll probably just build my own XML parser frontend.

Share this post


Link to post
Share on other sites

There is indeed no 'best' coding language, but the language you are more comfortable with or whichever is more advantageous to the specific project. As a student Information Technology I'm starting to like working with Java.

Share this post


Link to post
Share on other sites

Take a look at some reasonable sized software and you'll see why it's slow and bulky.... I know I did.But I personally didn't think the larger applications I came across should have been done in Java period.Java serves it's purpose I suppose very well, but also don't forget that C/C++ isn't the only language around.

Share this post


Link to post
Share on other sites

Well, Java is certainly easier to learn and hides quite a number of hassles and headaches which Cpp serves, so of course its recommended for beginners to programming. Though you have to admit, Java *IS* slower compared to cpp/c programs, especially on relatively big programs. CPP, though its really very nitpicking and sometimes gave errors which is illogical, but its versatile. Much more effectitve in coding bigger and more complex programs.

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

×
×
  • 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.