Java

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

ajtgarber
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 97
Joined: Wed Jun 10, 2009 8:56 am

Java

Post by ajtgarber »

Everywhere I go, I always end up hearing people complain about Java, usually the "Ugh... Java? couldn't we use something else?" (that sort of thing anyway). What are your guys's complaints about Java?

Note: I'm not a Javatard, to be quite honest I kinda like C++ better :P
User avatar
Armyof1
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 11
Joined: Sun Sep 05, 2010 12:03 am
Programming Language of Choice: C++
Location: Nebraska
Contact:

Re: Java

Post by Armyof1 »

Its not that java is bad, but the fact that c++ is used more in Game Development and I'm just more comfortable with it makes me "favor it" in a way. Java often gets a bad rep for being slow compared to other languages like C/++.

Another important note is C++ is going to stay the same since no one "owns" c++. Java, on the other hand is owned by either Sun or Oracle (don't know for sure). But they have the authority to change anything about the language.
wearymemory
Chaos Rift Junior
Chaos Rift Junior
Posts: 209
Joined: Thu Feb 12, 2009 8:46 pm

Re: Java

Post by wearymemory »

Have you asked these people what they dislike about the language? Those who belittle languages often have no cause nor reason for their senseless accusations, or do so simply because they think it's cool. Why is a screwdriver better than a drill? It's all about finding the right tool for the job.
Armyof1 wrote:Java often gets a bad rep for being slow compared to other languages like C/++.
In some cases, Java has been reportedly faster than C or C++. However, speed is rarely a cause for concern nowadays.
Armyof1 wrote:Another important note is C++ is going to stay the same since no one "owns" c++. Java, on the other hand is owned by either Sun or Oracle (don't know for sure). But they have the authority to change anything about the language.
Oracle owns Java, and while they may have the authority to change anything about the language, the odds of that happening are highly unlikely, due to the repercussions that would ensue. Another thing to note is that, even though C++ isn't owned, the third-party libraries that you use to develop your games and programs might be, therefore you are at the mercy of those designers.
User avatar
Armyof1
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 11
Joined: Sun Sep 05, 2010 12:03 am
Programming Language of Choice: C++
Location: Nebraska
Contact:

Re: Java

Post by Armyof1 »

oh, whoops... prolly should have done my homework on java speed :)
User avatar
EccentricDuck
Chaos Rift Junior
Chaos Rift Junior
Posts: 305
Joined: Sun Feb 21, 2010 11:18 pm
Current Project: Isometric "2.5D" Airship Game
Favorite Gaming Platforms: PS2, SNES, GBA, PC
Programming Language of Choice: C#, Python, JScript
Location: Edmonton, Alberta

Re: Java

Post by EccentricDuck »

I think that part of it is that it's the language that first year Computer Science/Math/Physics majors often start with (from what I've seen, Math/Phys usually have to take some programming and I've always seen it be the same class that Comp Sci students take). Teaching myself, I did a tiny bit of C++, did some Python, then learned C# (I couldn't claim to have much practical experience with the former two since I only learned them for 1 and 4 months respectively). I still consider myself a novice who has lots to learn, but if I were to go to another language I think I would have chosen C or C++... and Java feels kind of forced upon me.

My first Comp Sci class will be on Friday (I initially thought it would start Tuesday if you read one of my other posts) and to be honest, the closer I get the more I'm actually looking forward to learning Java. I do want to learn something that's multi-platform (of course, C/++ would suit this criteria as well), but Java is also similar in a lot of ways to C# from what I understand since they're both just-in-time compiled languages. In addition, I'll be using BlueJ (which is supposed to be an easy to pick up Java IDE) and the course aims to be more of a general introduction to Object-Oriented programming than a specific introduction to Java. Shortly after opening the textbook, it says that you likely won't be using Java for your entire, or perhaps any of your programming career. It also dives into more advanced topics really quickly to give a broad overview, so while a bunch of the students are looking at the breadth side I think I'll be happy to dive in deeper and not get bored with the class.
wearymemory
Chaos Rift Junior
Chaos Rift Junior
Posts: 209
Joined: Thu Feb 12, 2009 8:46 pm

Re: Java

Post by wearymemory »

EccentricDuck wrote:Shortly after opening the textbook, it says that you likely won't be using Java for your entire, or perhaps any of your programming career.
Really? Could you post the title and author?
User avatar
Milch
Chaos Rift Junior
Chaos Rift Junior
Posts: 241
Joined: Sat Jul 11, 2009 5:55 am
Programming Language of Choice: C++
Location: Austria, Vienna

Re: Java

Post by Milch »

That statement confuses me too, because I worked as an internship in a quite big company and they used Java - and I'm pretty sure they are not the only one.

My personal thought on Java: (using it for about 1 month, so I might do not understand stuff right )
Less controll.
Less memory leaks.
Less speed.

Let me explain my statements:
Less controll because you have to use the implementation that Java tells you to use.
Less memory leaks because you don't have to free stuff. ( but also have less controll! )
Less speed because of 2 reasons.
1. You dont know when stuff is freed, so it can get freed as soon as you delete the last reference of an object. ( as far as I know )
This can also happen in performance intensive parts of your code - so it would slow down your program.
2. Don't have controll about the implementations ( can also be faster! )

Anyway - I'm still learning that whole Java stuff, so I might got stuff wrong.
Follow me on twitter!
User avatar
EccentricDuck
Chaos Rift Junior
Chaos Rift Junior
Posts: 305
Joined: Sun Feb 21, 2010 11:18 pm
Current Project: Isometric "2.5D" Airship Game
Favorite Gaming Platforms: PS2, SNES, GBA, PC
Programming Language of Choice: C#, Python, JScript
Location: Edmonton, Alberta

Re: Java

Post by EccentricDuck »

wearymemory wrote:
EccentricDuck wrote:Shortly after opening the textbook, it says that you likely won't be using Java for your entire, or perhaps any of your programming career.
Really? Could you post the title and author?
David Barnes and Michael Kolling
Objects First with Java | A Practical Introduction Using BlueJ

He wasn't saying that it's not used - quoting the text: "Java was chosen because of a combination of two aspects: the language design and its popularity... The large amount and good quality of support material makes Java an excellent choice as an introduction to object-oriented programming."

What he goes on to say is that change in programming languages and paradigms is the way it has been since people started coming up with programming languages. You may or may not not use it out of school, but in all likelihood if this is what you're looking to do for your career you likely won't be programming in Java in 30 years. Things change. The goal is to give a good introduction to object-oriented design and programming (along with some additional software engineering topics).
User avatar
MrDeathNote
ES Beta Backer
ES Beta Backer
Posts: 594
Joined: Sun Oct 11, 2009 9:57 am
Current Project: cocos2d-x project
Favorite Gaming Platforms: SNES, Sega Megadrive, XBox 360
Programming Language of Choice: C/++
Location: Belfast, Ireland
Contact:

Re: Java

Post by MrDeathNote »

I'm not a huge Java fan myself but it is used widely in the software industry so it's pretty useful to know. I'm actually studying for my SCJP at the min purely because the company i'm working for uses java and they're paying for it :)
http://www.youtube.com/user/MrDeathNote1988

Image
Image

"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
User avatar
GroundUpEngine
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 835
Joined: Sun Nov 08, 2009 2:01 pm
Current Project: mixture
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Location: UK

Re: Java

Post by GroundUpEngine »

ajtgarber wrote: Note: I'm not a Javatard, to be quite honest I kinda like C++ better :P
GroundUpEngine wrote: Good.. Good..
Image
User avatar
EccentricDuck
Chaos Rift Junior
Chaos Rift Junior
Posts: 305
Joined: Sun Feb 21, 2010 11:18 pm
Current Project: Isometric "2.5D" Airship Game
Favorite Gaming Platforms: PS2, SNES, GBA, PC
Programming Language of Choice: C#, Python, JScript
Location: Edmonton, Alberta

Re: Java

Post by EccentricDuck »

BlueJ has something called a "Code Pad" that's basically used the way you'd use dynamic scripting - except in Java. Well, I've managed to break it 3 different ways so far... not sure the cause of 2 of them. It works by pre-compiling part or all of the code (you can compile a single class and test it). The things I've tested it with are only tiny files, but so far they compile almost instantly (faster than Python did dynamic interpretation).

Really handy and I love the idea (I missed having that in Python when I went to C#), but I broke it 3 times today...
1) First, it just stopped receiving input.
2) Second, it started opening up a terminal window to display output for every project file that had been running since I booted up the IDE (since I was playing around with 3 project files, even though I had closed the first two I had 3 windows popping up when I went to use the "Code Pad").
3) Third, for the hell of it I typed in while(true){ }... 3 minutes later it's still running it and it stopped receiving input while it runs.

Currently it's too buggy to be practical. The IDE also oversimplifies some other stuff which is unfortunate, because I actually really like the clean and intuitive layout of their system, but it's not really use-able for actual development. My first reaction was "Cool!"... we'll see from here - I'm going to keep playing around with it.

EDIT: Never mind the third error - they do have a way to terminate operation through the debugger.
wearymemory
Chaos Rift Junior
Chaos Rift Junior
Posts: 209
Joined: Thu Feb 12, 2009 8:46 pm

Re: Java

Post by wearymemory »

The codepad feature is buggy, but it is useful when evaluating simple expressions and short snippets of code, large amounts of complicated code should not be typed out in the codepad. If the code you typed in was truly compiled by javac, one might assume that it wouldn't have as many issues as it does. BlueJ was designed for introductory teaching, not for enterprise development.
User avatar
EccentricDuck
Chaos Rift Junior
Chaos Rift Junior
Posts: 305
Joined: Sun Feb 21, 2010 11:18 pm
Current Project: Isometric "2.5D" Airship Game
Favorite Gaming Platforms: PS2, SNES, GBA, PC
Programming Language of Choice: C#, Python, JScript
Location: Edmonton, Alberta

Re: Java

Post by EccentricDuck »

wearymemory wrote:The codepad feature is buggy, but it is useful when evaluating simple expressions and short snippets of code, large amounts of complicated code should not be typed out in the codepad. If the code you typed in was truly compiled by javac, one might assume that it wouldn't have as many issues as it does. BlueJ was designed for introductory teaching, not for enterprise development.
Yeah, I know it's not for large-scale development. It's too bad really - it's intuitive and incredibly agile for testing ideas. It's got a great UML like interface that is the start point.

The interface is obviously too simple in that it lacks a bunch of functionality. It also doesn't have active error checking (big shift from Visual Studio). It's so useful to be able to start typing out some method's constructor and see its parameters pop up (or give you the option to look through different constructors if there are more than one). Even with something like RotateX() it's hard to say what paramaters will exist without checking it (which is why having a tiny box pop up dynamically is so helpful). I don't see why their choice of design couldn't be implemented on a larger scale though (I guess it's a fairly new IDE and it's worked on by only a handful of academic researchers).

It's definitely an intuitive design though.
User avatar
WSPSNIPER
Chaos Rift Regular
Chaos Rift Regular
Posts: 145
Joined: Sun Jan 03, 2010 6:19 pm
Current Project: top down shooter
Favorite Gaming Platforms: ps3
Programming Language of Choice: c++

Re: Java

Post by WSPSNIPER »

im not the biggest java fan because of its annoying OOP forcage lol i love OOP but i like to implement it with some procedural as well.. i also dislike the fact that in java you have no solid idea of where your allocated memory is going, is it being collected or not? in c/c++ i know my garbage is being collected because i write the code. I also love low level programming which you can not do as well in java... java is not bad i just like c/c++ better :D.
User avatar
davidthefat
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 529
Joined: Mon Nov 10, 2008 3:51 pm
Current Project: Fully Autonomous Robot
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: California
Contact:

Re: Java

Post by davidthefat »

No me gusta Java. Por que? Porque Java es nombre estúpido.
Post Reply