• 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
Robin123

Java or C++?

44 posts in this topic

Hey guys.

Im new to programming. I only started learning about a week ago. My plan was to go through Java and then move on to C++. My goal is to be able to make games (all sorts of games for all sorts of platforms).

I was just wondering if I should bother with Java or just skip it and go straight to C++?

When dealing with engines such as Unity, Cry-engine and the UDK is Java at all useful to know?
0

Share this post


Link to post
Share on other sites
[url="http://www.gamedev.net/topic/621783-whats-wrong-with-java/page__st__40"]Look at the last post.[/url]

For the record, I will say that if you're new to programming, do not start with C++. It's a beast of a language.
0

Share this post


Link to post
Share on other sites
This really depends on what your goal is. If you want to target many platforms as you want, I would said go for Java. But it seems you want to use those engines, most of them have their own scripting language and have an API in C++,. So better learn C++ if you want to use them.

Personally, I would say start with C++ because there is no great difference between the two languages from beginner's perspective. Since you are going to learn them from the very beginning anyway. And select one platform first for your initial project before targeting another platform.
-2

Share this post


Link to post
Share on other sites
C++ will burn you and make you regret things. You need a fairly deep understanding of various concepts, including all the nasty little dark corners of memory management, before you should take it on.

C# and XNA is a commonly recommended good starting point. I've no direct experience of it but from what people who's opinions can be trusted say, I'd support that recommendation. For now your ambition of "all sorts of platforms" is too much. You need to focus on just learning and understanding how the basic things work, and piling multiplatform on top of that is just going to make things more difficult. Instead getting something that will work well on a single platform, and that does a lot of the messy heavy lifting for you, will be better in the longer run.
0

Share this post


Link to post
Share on other sites
I'd also recommend Python over Java and C++. Python is designed to be beginner friendly and easy to code in.
0

Share this post


Link to post
Share on other sites
Even though Python is designed to be user friendly (which i still doubt), its syntax is very different than C++ or Java.
Therefor i would suggest you to go on either C# or Java, then move on to C++.

Both C# and Java are taking care of alot of programming aspect for you already, so you can skip things and keep learning, and when you feel ready, you can start learning C++ and learn all those "dark corners" as mhagain has mentioned.

Good luck.
-1

Share this post


Link to post
Share on other sites
I was in same limbo years ago, when I just started with programming in college. The thing that I learned is, you should learn a language that helps you to understand important concepts in Computer science ( such as OOP) faster and easier. So if you go with C++ at this stage it will be harder (painful in fact) for you instead of Java or C#.

Personally I suggest to start with C# or Java to learn important concepts and after that you can switch to C++ (with much better perspective) anyway you can also start with some framework such as XNA (C#) to get familiar with concepts and techniques in a game software (such as collusion detection or applying basic AI). At the end all C++, C# and java are from C family so they share lots of thing with each other so it will be easy for you to jump from C#/java to C++.

cheers
0

Share this post


Link to post
Share on other sites
[quote name='learner45' timestamp='1332066369' post='4923004']
Even though Python is designed to be user friendly (which i still doubt), its syntax is very different than C++ or Java.
Therefor i would suggest you to go on either C# or Java, then move on to C++.

Both C# and Java are taking care of alot of programming aspect for you already, so you can skip things and keep learning, and when you feel ready, you can start learning C++ and learn all those "dark corners" as mhagain has mentioned.

Good luck.
[/quote]

Java syntax is also very different from C++. C# is a lot closer. But I don't think there's a problem anyway. If you're going to C++ from a managed language, you're going to have to relearn a lot anyway, so a different syntax doesn't make things any harder. And it might even be an advantage because it stops you from trying to just do the same things, which is usualy a bad idea. (Ever seen Java coders write C++ which is full of void pointers and pointless dynamic allocations everywhere)?
1

Share this post


Link to post
Share on other sites
Listen to evreybody here, I made the mistake of starting with c++, probably going to c# because I will probably forget all syntax's for c++ if I go java. If you wanna go c++ later c# would probably be better because you will have a headstart with the different syntax's.
-1

Share this post


Link to post
Share on other sites
I don't see what the issue with different syntax is. I regularly program in both C++ and Python, and occasionally do Java too, and I don't have any troubles.
1

Share this post


Link to post
Share on other sites
[code]
int (&fn1(int (&arr)[4]))[4] {
typedef int (&fn(int (&)[4]))[4];
return arr;
}
[/code]
???
0

Share this post


Link to post
Ok now I'm confused. I was notified of a reply to this topic, but there's no reply. What happened?
0

Share this post


Link to post
Share on other sites
I think most of the posters above are far more experienced programmers, but I aswell recommend going to anything else but C++. There are some things, that are good to understand from C++ though. References, pointers and copying variables is something, that C++ actually forces you to learn which I think is pretty useful.

I started learning programming from C++, but I honestly think Java and C# are a lot more better choises. A lot of people in this thread seems to suggest Python aswell, this is a language I never touched myself, but for some reason I honestly think you shouldn't start with Python, because there is huge possibility, that you will make too much mess with it, just because of the untyped nature of the language. At least I think you should learn the difference between ints, strings and not being able to write function in same way. I think this will be nightmare for new programmer, when there is like nothing guiding the programmer into good ways of programming, although this is only personal preference. I am pretty sure some people, who started learning programming from untyped language can easily tell, why it is better way of learning programming, than me who kind of hate untyped languages, because it is less error proof, but more painful at the same time.

So my recommendation is to start from Java or C#. Learn the concept of programming from either of the languages, because of the very strong object oriented way of programming. These languages give very good base of learning programming as a concept. Once you have an idea how to program, I personally think, you should look at C++ pointer/reference/arrays, and try to learn the idea behind of pointers. Once you grasp the concept of them, you'll learn why Java / C# passing of ints work differently than passing of object. Why changing stuffs in objects from one place affects the data seen from other places too(same instance, same values), and why it sometimes does not(different instanes with same values).

After this, it is not exactly hard to move from one language to another, except some of languages that base on completely different way of thinking like Haskell, which I haven't ever tried to learn tho.

Edit: Oh yeah, and I personally think if you go with Java/C#, you should start with console-programming, not the win forms / java swing.
0

Share this post


Link to post
Share on other sites
[quote name='Storyyeller' timestamp='1332128000' post='4923185']
I don't see what the issue with different syntax is. I regularly program in both C++ and Python, and occasionally do Java too, and I don't have any troubles.
[/quote]

Theres nothing wrong with C++ syntax, the syntax is fairly straight forward and easy to learn, I dont think anyone would have an issue with the syntax.

Theres a old book called 'Writing Secure Code 2nd Edition', I decided to get it a few months ago for the sake of writing secure code in .net, out of the whole book only one chapter was dedicated to managed languages while the rest was heavily focused on unmanaged languages and the problems associated with C/C++, ranging from buffer overruns, dangerous APIs, exploits etc

I only skimmed through the unmanaged sections as I wasnt that interested in C++ then and one thing I noticed the author say over and over was how easy it was for developers to forget about certain everyday problems and even worse how difficult it was to track it later. The book is about 10 years old so im not sure what rules still apply but from what I remember the managed section rules still applied even till this day and even then the chapter was mainly focused on SQL Injections more than anything with ASP.NET

E: Dont get me wrong I am not saying C++ is a bad language, I think it is a great language and reading C++ books has helped me greatly in ways I couldnt imagine with C#, but as for a first language it isnt a very good choice. In terms of ease, C# is a fantastic language and with the next features that will be available in the future (C# Scripting (Roslyn) like python, php etc, Async programming with minimum effort etc) it really does make it a easy, fun and efficient language to work with
0

Share this post


Link to post
Share on other sites
[quote name='Dynamo_Maestro' timestamp='1332177824' post='4923352']
[quote name='Storyyeller' timestamp='1332128000' post='4923185']
I don't see what the issue with different syntax is. I regularly program in both C++ and Python, and occasionally do Java too, and I don't have any troubles.
[/quote]

Theres nothing wrong with C++ syntax, the syntax is fairly straight forward and easy to learn, I dont think anyone would have an issue with the syntax.
[/quote]
One big problem with syntax and beginners is templates. Especially when you have:

[code]
std::vector<std::string> vector;
vector.begiin(); // or some other small error with the type
[/code]

And then the compiler spits out the intimidating error:

[code]error: ‘class std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >’ has no member named ‘begiin’[/code]

And the beginner goes, "WTF is class std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >??? What's going on!?" And that's just a simple example.

Another common one is misplacing a semicolon (maybe not putting it at the end of a struct or class) or brace, and the compiler spits out thousands of errors, none of which tell you that line 99 should have a semicolon or brace that you've forgotten.

C++'s syntax is just... tedious, especially for a beginner, and even more so when the compiler gives very non-beginner-friendly error/warning messages. That's the main issue with C++'s syntax and beginners. Its general form really isn't that bad, but only once you get the hang of it and can understand what it is the compiler is complaining about.
0

Share this post


Link to post
Share on other sites
[quote name='Cornstalks' timestamp='1332211164' post='4923504']
[quote name='Dynamo_Maestro' timestamp='1332177824' post='4923352']
[quote name='Storyyeller' timestamp='1332128000' post='4923185']
I don't see what the issue with different syntax is. I regularly program in both C++ and Python, and occasionally do Java too, and I don't have any troubles.
[/quote]

Theres nothing wrong with C++ syntax, the syntax is fairly straight forward and easy to learn, I dont think anyone would have an issue with the syntax.
[/quote]
One big problem with syntax and beginners is templates. Especially when you have:

[code]
std::vector<std::string> vector;
vector.begiin(); // or some other small error with the type
[/code]

And then the compiler spits out the intimidating error:

[code]error: ‘class std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >’ has no member named ‘begiin’[/code]

And the beginner goes, "WTF is class std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >??? What's going on!?" And that's just a simple example.

Another common one is misplacing a semicolon (maybe not putting it at the end of a struct or class) or brace, and the compiler spits out thousands of errors, none of which tell you that line 99 should have a semicolon or brace that you've forgotten.

C++'s syntax is just... tedious, especially for a beginner, and even more so when the compiler gives very non-beginner-friendly error/warning messages. That's the main issue with C++'s syntax and beginners. Its general form really isn't that bad, but only once you get the hang of it and can understand what it is the compiler is complaining about.
[/quote]

I'd suggest that you take a look at the error messages and warnings that clang spits out, They are far more useful (Telling you exactly where you forgot that ; , preserving templated typenames as they are written and even correctly pointing out errors and warnings when macros are involved.

consider this:
[code]
template<class T>
class a {}
class temp {};
a<temp> b;
struct b {
}
[/code]

gcc spits out:
[code]
t.cc:3: error: multiple types in one declaration
t.cc:4: error: non-template type 'a' used as a template
t.cc:4: error: invalid type in declaration before ';' token
t.cc:6: error: expected unqualified-id at end of input
[/code]

clang spits out:
[code]
t.cc:2:11: error: expected ';' after class
class a {}
^
;
t.cc:6:2: error: expected ';' after struct
}
^
;
[/code]

same language but the difference in the error message quality you get is huge. (clang however is still fairly new and has poor IDE support so its not really recommended for beginners, but it does show that the quality of error messages has far more to do with the compilers than the language and hopefully other compilers will follow suit in the near future and improve the way they report errors)
1

Share this post


Link to post
Share on other sites
[quote name='SimonForsman' timestamp='1332215139' post='4923519']
(clang however is still fairly new and has poor IDE support so its not really recommended for beginners
[/quote]Actually, it's the default compiler in latest versions of XCode, so if you got a Mac you have no excuse [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img]
On the other hand on windows I had to build it from the source and it was painful.
Speaking of Clang, if you want to know why C++ is a bad choice just watch this excellent video:
[b] [url="http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/Clang-Defending-C-from-Murphy-s-Million-Monkeys"]Clang: Defending C++ from Murphy's Million Monkeys[/url][/b]

In regards to the original post you probably want to go with Java since it's pretty close to C# which is one of the supported languages for Unity, the other being Javascript which is even easier to learn.
0

Share this post


Link to post
Share on other sites
If you want to target C++, then IMHO you should just decide between Java and C#. Python is nice and easy, but is too different (different syntax, different compilation model ...)

Usually this is not a problem at all, but if you want something that simplifies your path toward c++, then C# or Java.

And among these two, I would suggest Java: C# is a very beatiful language, but too much bound to Visual Studio: you could miss important steps performed by its features under the hood.
I suggest Java (notepad++ + javac at first) and then try NetBeans or Eclipse.

Mind you, that's just my opinion: if you pick C# instead that will work nonetheless.
1

Share this post


Link to post
Share on other sites
[quote name='Storyyeller' timestamp='1332169175' post='4923302']
Actually, Python is strongly typed.
[/quote]

Ah sorry, you are right. I meant dynamical typing, if that would be good thing to have for someone that is just learning programming or bad?
0

Share this post


Link to post
Share on other sites
wow guys, far more replies than I expected...a hot topic apparently [img]http://public.gamedev.net//public/style_emoticons/default/tongue.png[/img]. Thanks for all the help. I think I will continue with Java, now that I'm already into it. I will probably not head in the C++ direction straight away instead opting to take a look at C# first.

I have plenty of time to get onto C++.

Thanks!
0

Share this post


Link to post
Share on other sites
Question is, towards what do you want to target your programming?
You can make games in almost any language. If you want to develop for example games for PS3, C++ is a must.
If you want create games as a hobby, java and C# is an excellent choice. C++ will consume allot of time before you will be able to generate something useful (without major bugs).
0

Share this post


Link to post
Share on other sites
[quote name='Vlad86' timestamp='1332258514' post='4923654']
C++ will consume allot of time before you will be able to generate something useful (without major bugs).
[/quote]
That only happens when you scale it up. Hobby games are still doable in C++ without much hassle (if you know what you're doing). You just have to avoid the gimmicks that other programmers sometimes use to make their programs appear more sophisticated than necessary (e.g., excessive use of inheritance, pointers, and unnecessary datatypes when simplier methodology would suffice). The key is to follow a programming paradigm that allows smooth porting of the program between platforms and languages.
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