• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Storyyeller

How do people stand Java?

50 posts in this topic

I don't have much experience in Java (I've mostly done C++). However, whenever I try it, it seems very awkward to program in. A lot of common features like operator overloading and first class functions are missing, so it seems to require unnecessarily complicated constructs and boilerplate code to accomplish simple tasks. This isn't a necessary difference with high level languages either. I've done a little C# and Python programming, and they are much nicer to work with.

But Java is a commonly used language. So I feel I'm missing something. Perhaps due to my unfamiliarity with the language, I don't understand all the tricks and idioms that people use in Java to make programming easier. So the question is, how do people stand Java?
1

Share this post


Link to post
Share on other sites
[quote name='Storyyeller' timestamp='1310097921' post='4832635']
I don't have much experience in Java (I've mostly done C++). However, whenever I try it, it seems very awkward to program in. A lot of common features like operator overloading and first class functions are missing, so it seems to require unnecessarily complicated constructs and boilerplate code to accomplish simple tasks. This isn't a necessary difference with high level languages either. I've done a little C# and Python programming, and they are much nicer to work with.

But Java is a commonly used language. So I feel I'm missing something. Perhaps due to my unfamiliarity with the language, I don't understand all the tricks and idioms that people use in Java to make programming easier. So the question is, how do people stand Java?
[/quote]

Java is commonly used for pretty much the same reasons as C++, momentum, prior to Microsofts release of .Net and C# there wasn't that many languages to choose from if you wanted a high level c-style language that was easy to work with.
0

Share this post


Link to post
Share on other sites
Had to take a college course on it, and hated every minute of it. I cant see how they thought some of the stuff was a good idea. The only satisfaction I get from java is bending its bad design to act like C++, confusing the professor constantly. Especially operator overloading, and not having [] for vectors/strings. Really?
1

Share this post


Link to post
Share on other sites
[quote name='Storyyeller' timestamp='1310097921' post='4832635']so it seems to require unnecessarily complicated constructs and boilerplate code to accomplish simple tasks[/quote]I had a boss once, who measured lines-of-code-per-hour [img]http://public.gamedev.net/public/style_emoticons/default/cool.gif[/img] as an indicator of performance...
1

Share this post


Link to post
Share on other sites
[quote name='Storyyeller' timestamp='1310097921' post='4832635']
I've done a little C# and Python programming, and they are much nicer to work with.
[/quote]
What [i]exactly [/i]is so much nicer in C# ?

[quote name='Storyyeller' timestamp='1310097921' post='4832635']
But Java is a commonly used language. So I feel I'm missing something. Perhaps due to my unfamiliarity with the language, I don't understand all the tricks and idioms that people use in Java to make programming easier. So the question is, how do people stand Java?
[/quote]

You miss considering the entire development environment, available frameworks, IDEs, etc.
The last time I looked into Visual Studio for instance, it felt like being years behind Eclipse, IntelliJ or Netbeans. The overall productivity is just much higher in Java.
Naturally, choosing the language AND environment that suits your tasks best is what professionals do. And for commercial business applications that is definitely not C++ with its ugly and error prone features (like operator overloading).
Java is far from being perfect, compare it to more modern languages, but C++ or its cloned sibling C# are for sure no ideal models to follow.
0

Share this post


Link to post
Share on other sites
I'm a java coder (work) and C++ coder (hobby gamedeveloper) for more than a decade. The basic idea behind java was to supply a C++ like object oriented programming language without the more complicated (an therefore error prone) features like operator overloading, multiple inhertiance, templates etc. but with a strong out-of-the-box framework which works on multiple plattforms. When you talk about java, you talk about a framework not a programming language alone. Over the years some borders between intial goal and reality blurred and java approaches C++ more and more (generics ~ templates) and got too many features in too man external projects (jXYZ project ....), but still java provides a very robust , feature rich and almost plattform indepedent framework ( you can write a client-server application with java6 with 20 lines of code in about 15 minutes).

Which language to choose depends on your goals. Java is really strong at server development, on the other hand writing a game with heavy use of math (operators) or memory manipulation would be easier with C++. But a support tool for multiple plattforms could be done in java really quickly.

.Net (which introduced C#) is Microsofts answer to Java to get a bigger slice of the server market (enterprise application development). Over the last years .Net and Java develops more or less the same features, still java seems to be first choice for server side development (hardware/os independent) and .Net for client/windows only desktop applications.
2

Share this post


Link to post
Share on other sites
Yeah being primarily a C++ programmer myself, I don't much care for it either.
1

Share this post


Link to post
Share on other sites
[quote name='Storyyeller' timestamp='1310097921' post='4832635']However, whenever I try it, it seems very awkward to program in. A lot of common features like operator overloading and first class functions are missing, so it seems to require unnecessarily complicated constructs and boilerplate code to accomplish simple tasks.[/quote]I have used it in the past with mixed results. People don't like it much around here but I think it's rather good. Sure some design choice in the library rather than the language are odd. And the "if it can be abused, then we don't support it" attitude is hateful for someone coming from the freedom of C/C++.
But in general, I don't feel the need for operator overloading [size="1"](I don't use it anymore even in C++ after it bite me some years ago)[/size]. While first-class function may look useful, they are really not so much [size="1"](I'd say less than 1% of the code I have is not in some class)[/size] and the simple workaround [size="1"](static functions)[/size] delivers.

I guess it's mostly subjective. I cannot stand Python for what it counts, whitespace indent? Really? [size="1"]oh sure, let the flaming begin[/size]
In general, I don't think Java "by itself" to be easier than other languages. By sure it isn't "harder", whatever this means.

A key thing is the garbage collection. Since stuff such as "object management" and "lifetime" and "ownership" are difficult to explain, a good way to work around this is to just take 'em out of the equation. Everybody is happy: teachers get a "modern" feel [size="1"](you don't have to manage memory! nor resources!)[/size] and people get to screw up systems horribly with insane memory usage while still cashing in.
I could mention at least a case in which GC screwed up a high-level behavior big way, the point is that sometimes lifetime is important, which is why I don't trust managed languages.

Point out a language which does not suck in some way...
1

Share this post


Link to post
Share on other sites
[quote name='6510' timestamp='1310103469' post='4832655']
What [i]exactly [/i]is so much nicer in C# ?
[/quote]

Operator == for strings.
Delegates.
LINQ.
The tendency for libraries to be named based on what they DO, rather than meaningless names that are somehow related to a caffinated beverage.
Interoperability.
2

Share this post


Link to post
Share on other sites
Java is dummy friendly. In big development teams, you usually end up with some of them. If you give them C++, you will need a squad to track and fix all the problems that come up. With Java, it's harder so you can get some productivity out of them. This may not be relevant for one-man projects, but it is for projects with a lifetime counted in decades.

As a bonus, compilation time is much shorter than a C++ equivalent project. When I modify a class somewhere, I don't need to recompile the whole application.
0

Share this post


Link to post
Share on other sites
[quote name='Serapth' timestamp='1310127812' post='4832739']
You sir, are insane. Having just finished working in Eclipse on an Android project, I will say that Visual Studio is not even in the same league as Eclipse, its hundreds of times better. The only place Eclipse ever had the edge was refactoring tools and now that is moot as well. Regardless to the language, Visual Studios is hands down the best IDE on the market by a country mile.
Also I cannot think of a single way that Java is superior to C#, although the opposite is not true. This makes sense though, as C# came later it got to learn from Java's mistakes, and it did.
[/quote]
Eclipse's intellisense isn't as balls as VS imo. With visual assist I think VS is better, but then you are comparing like a $300+ product to a free product and it's still a lot closer than it should be.

On the language itself, Java's primary selling point is being cross platform friendly. If you ignore that because coding in it is different than another language you are doing it wrong. C# has a couple bonuses over Java, but they're so similar I'd hardly call it a landslide in either direction; though I do prefer C#.

Java's whole concept is around being simple and multi-platform. In that regard it succeeds. I would say operator overloading would be nice, but at the same time it makes it easy for developers to know exactly what every operator should do at any given time.

[quote]
Had to take a college course on it, and hated every minute of it. I cant see how they thought some of the stuff was a good idea. [b]The only satisfaction I get from java is bending its bad design to act like C++[/b], confusing the professor constantly. Especially operator overloading, and not having [] for vectors/strings. Really?[/quote]
If you are doing this, your java code is probably horrible.

edit: bare in mind that I don't even like java that much. It's just that the reasons given for not liking it are doing exactly what you shouldn't be doing as a software engineer; trying to fit a round peg into a square hole. They teach java first in university because it's easier and safer than C++ for people just starting. It's used in enterprise software because it's cross platform and very friendly to rapid iterative development while still having great performance for enterprise software needs.

Programming languages are different and they shouldn't act the same, so don't expect them to act the same.

double edit: if you really want something to complain about program actionscript in the flash ide.
2

Share this post


Link to post
Share on other sites
[quote name='SimonForsman' timestamp='1310099326' post='4832638']
[quote name='Storyyeller' timestamp='1310097921' post='4832635']
I don't have much experience in Java (I've mostly done C++). However, whenever I try it, it seems very awkward to program in. A lot of common features like operator overloading and first class functions are missing, so it seems to require unnecessarily complicated constructs and boilerplate code to accomplish simple tasks. This isn't a necessary difference with high level languages either. I've done a little C# and Python programming, and they are much nicer to work with.

But Java is a commonly used language. So I feel I'm missing something. Perhaps due to my unfamiliarity with the language, I don't understand all the tricks and idioms that people use in Java to make programming easier. So the question is, how do people stand Java?
[/quote]

Java is commonly used for pretty much the same reasons as C++, momentum, prior to Microsofts release of .Net and C# there wasn't that many languages to choose from if you wanted a high level c-style language that was easy to work with.
[/quote]

This.

In ~1995 it was the best thing since sliced bread. Now there's a whole lot of it we need to maintain, and the tooling for it exists pretty much everywhere.
0

Share this post


Link to post
Share on other sites
I think Java is pretty good... It's not perfect but the Java VM is wicked fast compared to others and there isn't much you can't do with it. I think the Java language's biggest problem is that it stopped evolving. After it got generics support (which it only did because C# 2 had it and people began to see how great type safety really is), not much has changed while C# has since gotten LINQ, dynamic type support, co/contravariance in generics, etc.
0

Share this post


Link to post
Share on other sites
I have a strong background in C and I don't hate Java. It was created with specific design goals and, to a large extent, meets them. It certainly falls short in some areas, but overall it's a very useful tool for a number of domains. Even games.

Errors in C or C++ don't always come from stupidity. C++ is a complex language with very few safeguards. Hence the proliferation of C++ coding standards among different shops, permitting and forbidding different features, in an attempt to reduce the chance of costly errors. And programmers *will* make mistakes. Java provides built-in safeguards which go a long way to reducing the common errors C and C++ programmers make. There are other errors you can make in Java, but (for the most part) they aren't on the same scale as things such as buffer overruns and pointer corruption. The benefit of this can be seen in the lack of a proliferation of Java coding standards among different shops.

I love C for the simple fact that I know what's happening with each line of code and I have the freedom to do pretty much anything. But I've got a lot of plumbing to protect myself from the mistakes I will inevitably make during one of those long coding sessions where the code I just wrote looks great and runs perfectly during testing, but blows up in the wild. I love Java for letting me forget about all the internals and allowing me to just get on with building my app, slapping me on the wrist when I make one of those mistakes during a long coding session so that my app *doesn't* blow up in the wild.

That's how I can stand Java. The fact that I've been paid to use it may have something to do with it, too.
1

Share this post


Link to post
Share on other sites
I've been working with Java for about 10 years.

As long as you have a decent IDE with good auto-completion Java's verbosity is easy to manage. I've used both IntelliJ and Eclipse.

It maps well to 'enterprise' software where you have many, many developers of wildly different talent across multiple locations. The verbosity and rigidity of the Java language itself makes it easy to quickly grok new unfamiliar code-bases and have decent tools that'll mostly work out of the box.

In this kind of environment certain C/C++ 'advantages' e.g. the preprocessor and operator overloading usually end up being more trouble than they are worth.

When it comes to development time I find Java definitely adequate. The performance is "good enough". Most of the systems I work on don't have strict realtime performance requirements and thus memory usage and disk space is not a concern (just throw more hardware at it). The amount of time I save from not having to troubleshoot memory leaks, memory corruption, buffer overruns, etc. is more time available cranking out business requirements.

A few other advantages of Java is that it's probably the best cross-platform (e.g. Solaris, Mac, Windows, Linux) language if your needs include GUI and/or web application stacks, more third-party libraries than you could ever imagine, and finally just about anyone either knows Java or can learn it making hiring easier.

It boils down to using the right tool for the right job.
0

Share this post


Link to post
Share on other sites
[quote name='Hodgman' timestamp='1310100375' post='4832644']I had a boss once, who measured lines-of-code-per-hour [img]http://public.gamedev.net/public/style_emoticons/default/cool.gif[/img] as an indicator of performance...[/quote]
Your boss was measuring performance based on how many lines of code you wrote per hour!? Lol, I would have been fired after two days XD It's really a mystery how obvious retards like that end up in the software industry ...
0

Share this post


Link to post
Share on other sites
[quote name='Hodgman' timestamp='1310100375' post='4832644']
[quote name='Storyyeller' timestamp='1310097921' post='4832635']so it seems to require unnecessarily complicated constructs and boilerplate code to accomplish simple tasks[/quote]I had a boss once, who measured lines-of-code-per-hour [img]http://public.gamedev.net/public/style_emoticons/default/cool.gif[/img] as an indicator of performance...
[/quote]

"Measuring software productivity by lines of code is like measuring progress on an airplane by how much it weighs." - Bill Gates
2

Share this post


Link to post
Share on other sites
[quote name='Moe' timestamp='1310158948' post='4832926']
"Measuring software productivity by lines of code is like measuring progress on an airplane by how much it weighs." - Bill Gates
[/quote]
And all this time people have been telling me my airplane design was foolish.
0

Share this post


Link to post
Share on other sites
I haven't used Java since the early 2000s but the one thing I hated about Java was that their libraries seemed to be over all the place and had no logic to them. I don't know how it is now, but when I compare that to C#2.0, C# was a dream come true. The other thing I hated about Java (which wasn't really Java's fault) was that every book handled ... I think it was.... mouselisteners differently. Some with inheritance, some with composition, and no real explanation whatsoever. I was new to the language and my programming skills sucked, so I didn't know what the hell was going on. But at the time, it would drive me nuts.
0

Share this post


Link to post
Share on other sites
Oh, Java is just great. Of course, at the start it is somewhat too complicated, but for large program packages it is just very conveniant and structured.
0

Share this post


Link to post
Share on other sites
Enough people have pointed out to use the right tool for the job, so I won't reiterate that very important point.

However, I feel that java is getting criticized unfairly when C++ tends to get away with murder. The backwards compatibility with C results in what I really feel is a messy design. Bad C++ code is one of the horribly unreadable things I've ever seen, and you can't attribute that to a lack of programming skill because we're really all prone to certain pitfalls now and again.

I am a java programmer by profession but I have more experience in C++... and yes, in some ways C++ is better. And sure, operator overloading would be nice in java, but multiple inheritance is a bit problematic and other constructs (structs? union types?) don't really seem to have much of a purpose. The lack of consensus on C++ standards is a testament to this. Java has some faults, it certainly does. But to say that C++ has great design itself is something I cannot take seriously. But the worst thing about C++? Of all programming languages, it seems to have the most fanboys and blind followers who do not really take the time to consider - realistically - how good C++ itself really is. [sup]
[/sup]
0

Share this post


Link to post
Share on other sites
[quote name='way2lazy2care' timestamp='1310130600' post='4832758']
[quote name='Serapth' timestamp='1310127812' post='4832739']
You sir, are insane. Having just finished working in Eclipse on an Android project, I will say that Visual Studio is not even in the same league as Eclipse, its hundreds of times better. The only place Eclipse ever had the edge was refactoring tools and now that is moot as well. Regardless to the language, Visual Studios is hands down the best IDE on the market by a country mile.
Also I cannot think of a single way that Java is superior to C#, although the opposite is not true. This makes sense though, as C# came later it got to learn from Java's mistakes, and it did.
[/quote]
Eclipse's intellisense isn't as balls as VS imo. With visual assist I think VS is better, but then you are comparing like a $300+ product to a free product and it's still a lot closer than it should be.
[/quote]

Oh...Are you and 6510 talking about the VS C++ intellisense? If so, then I agree; VS's C++ intellisense sucks and VAX makes it tons better. This is one of the reasons I don't like C++: It shouldn't be this hard to write intellisense for languages anymore. C++ just goes out of its way to be complex in the syntax and semantics departments.

On the other hand, my experience with VS's default C# intellisense is godlike (I actually have to turn OFF VAX because I like the built-in one better).
0

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0