Page 1 of 2

JAVA: What's the big deal?

Posted: 04 Mar 2012, 16:30
by inxt-generation
Why does it seem like everyone here is so against Java? I've played with it a bit, and it's not that hard :twisted: . What's the big deal?

Re: JAVA: What's the big deal?

Posted: 04 Mar 2012, 18:53
by aswin0
I cannot speak for others but to my experience the Java language is just as easy to master as the various C dialects for the NXT. Setting up an environment to develop java programs i found difficult. This is mainly because there are different tools to edit, compile, link, upload, etc. The newest release of Lejos has a Windows installer that configures the environment. So things should be easier now.
Once you master java you will appreciate the richness of Lejos.

Re: JAVA: What's the big deal?

Posted: 05 Mar 2012, 16:31
by spillerrec
Whether I like or dislike a language is not based on how easy/difficult it is to use, it is based on minor differences in the languages. I hate JavaScript and PHP, especially the latter, partly because they are too easy to start programming in. I really dislike that in PHP you can just create a new variable by using it, for example.

Anyway, stuff like this is religion and people constantly try to convince each other with no prevail. So don't listen to them and try it out and see for yourself whether you like it or not.

Re: JAVA: What's the big deal?

Posted: 05 Mar 2012, 16:38
by inxt-generation
spillerrec wrote:Whether I like or dislike a language is not based on how easy/difficult it is to use, it is based on minor differences in the languages. I hate JavaScript and PHP, especially the latter, partly because they are too easy to start programming in. I really dislike that in PHP you can just create a new variable by using it, for example.

Anyway, stuff like this is religion and people constantly try to convince each other with no prevail. So don't listen to them and try it out and see for yourself whether you like it or not.
Yeah, that's true. I was just wondering because it seems as if whenever it's mentioned here, they go like ".....JAVA :x :evil: ", or something like that. I may start using Lejos for multiple NXT projects, because it's real easy to use BlueTooth with it. I've tried BlueTooth with RobotC, and I couldn't get it to work very well at all. But, then again, it's not unlikely that I was doing it wrong.

Re: JAVA: What's the big deal?

Posted: 05 Mar 2012, 22:45
by bullestock
inxt-generation wrote:Why does it seem like everyone here is so against Java? I've played with it a bit, and it's not that hard :twisted: . What's the big deal?
Everyone? I thought it was only doc-helmut who hated Java.

Anyway, for the record, I like LeJOS.

Re: JAVA: What's the big deal?

Posted: 05 Mar 2012, 23:44
by inxt-generation
bullestock wrote:
inxt-generation wrote:Why does it seem like everyone here is so against Java? I've played with it a bit, and it's not that hard :twisted: . What's the big deal?
Everyone? I thought it was only doc-helmut who hated Java.

Anyway, for the record, I like LeJOS.
That's why I said "seems". I know that Doc doesn't like it, but it seemed to me that everyone got all :evil: when it was mentioned.

Re: JAVA: What's the big deal?

Posted: 06 Mar 2012, 19:43
by pepijndevos
Image

Nothing against Java though. I'm just not too happy with "everything is an Object", I prefer "everything is data, as code, as data, data as code, code as data, […] code with data, data with code"

Re: JAVA: What's the big deal?

Posted: 07 Mar 2012, 03:37
by muntoo
(Previous image from http://xkcd.com/801/)

And I am definitely not guilty of Java-bashing.

Re: JAVA: What's the big deal?

Posted: 07 Mar 2012, 16:57
by HaWe
it's a matter of bad experience I had trying to expand classes or objects or instances by different incapsulated methods of other classes or object implementations, e.g. when I once had to extend my rcx navigator robot class by own new additional methods and by the methods incapsulated in the comm class and in the behavior class (and finally by the bash into the garbage can class).

A frustrating never-ending story.

(For the following examples I wrote all out of memory and some things or other may be confused by terminology and I apologize for my googlenglish :)

for me a subject (I or you or a robot for which the program was written) is acting with an item.
I throw the ball into the basket.
I screw the light bulb into the socket.

The subject uses a procedure to achieve something with an item.

I haven't seen any object ball (well, maybe, someday there maybe will be) which has got his own methods
ball.lies
ball.rolls
ball.throw_into_basket
or a light bulb which can shine or srew itself into the socket like
LightBulb.shines
LightBulb.screws_into_socket

or any other item which is able to implement any intention by itself.

Of course I may have an object implementation for an instance myballrobot which has an incapsulated method of the class ballrobot
ballrobot.throw_ball_into_basket
and another object implementation for an instance mynavigatorrobot which has an incapsulated method of the class navigatorrobot
navigatorrobot.get_odometry_position

but e.g., because I've written my program for my single Robot I don't have to have a class of robots grabbing balls, raising arms and opening claws and implementations of robots grabbing balls, raising arms and opening claws and instances of robots grabbing balls, raising arms and opening claws
and other classes of robots avoiding walls, calculating positions, and finding paths and implementations of robots avoiding walls, calculating positions, and finding paths and instances of robots avoiding walls, calculating positions, and finding paths
and other classes of robots sending Bluetooth messages, receiving Bluetooth messages and controlling Bluetooth remote motors and implementations of robots sending Bluetooth messages, receiving Bluetooth messages and controlling Bluetooth remote motors and instances of robots sending Bluetooth messages, receiving Bluetooth messages and controlling Bluetooth remote motors,
and breaking my head how one class of robots or implementation of robots or instance of robots of one kind can achieve to do something of another incapsulated method of a class of robots or implementation of robots or instance of robots, and I have only 1 robot and not 10 of one kind and 20 of the other kind and fourhundredmillions of the third kind....

If I want my robot to be able to do something, I just write a suitable procedure and call it whenever I want or need to do it, or add another one if I want to - that's it.
So I prefer it to do it like:
procedure grabBall(){...}
procedure raiseArm() {...}
procedure openClaw() {...}
procedure OdometryPosition() {...}
procedure sendBTmsg() {...}
procedure moveBTRemoteMotor() {...}

That's the way my programs are: procedural, not objectural, and maybe you once will remember me when you will have to handle classes and object implementations and instances extending them by encapsulated methods of other classes or object implementations or whatever and ever...
(...not to forget about the exception throwing, or setting or changing paths to libs, classes, jar files.....)

Re: JAVA: What's the big deal?

Posted: 22 Mar 2012, 17:33
by pepijndevos
I just noticed that the Lejos forums has more than twice as many members as this one. Considering that this is a melting pot of languages, and theirs only about Java, I would think some people like it.

Anyway, I just noticed it has classes for several painful things I was trying to do in NCX.