Why Java? Why C?

C++, C#, Java, PHP, ect...
Post Reply
User avatar
Gunner
Posts: 276
Joined: Sun Aug 14, 2011 12:07 am

Why Java? Why C?

Post by Gunner »

I decided to pick one language to learn, and I have been researching about everything and I don't know why but I feel in love with Java.. Mostly because it has better name than C :D

But really I know nothing about something that differs those languages so I want to make this big step worth it to learn one of them.. At least for now.

Why Java? Why C? I think mostly I will be using to create games in windows and android so which will have more ups for me now? And why those random people on the internet mostly only suggest these 2 instead of the others?
Skype: mrvictordiaz
User avatar
a_bertrand
Posts: 1537
Joined: Mon Feb 25, 2013 1:46 pm

Re: Why Java? Why C?

Post by a_bertrand »

Game development on Android? Then Java but for Android as it's not really the same thing as developing for the desktop with Java.

If you want to develop in desktop, then C++ would be the best choice... yet... I personally work with C# and would not go back to C++ or Java ;) Even for game development.

Maybe your best choice would be C# with Unity 3D
Creator of Dot World Maker
Mad programmer and annoying composer
User avatar
Gunner
Posts: 276
Joined: Sun Aug 14, 2011 12:07 am

Re: Why Java? Why C?

Post by Gunner »

a_bertrand wrote:as it's not really the same thing as developing for the desktop with Java.
can I ask why?

Ok so as I will probably do the android first, should I start from scratch or do you have any recommended java game engine out there?
Skype: mrvictordiaz
User avatar
a_bertrand
Posts: 1537
Joined: Mon Feb 25, 2013 1:46 pm

Re: Why Java? Why C?

Post by a_bertrand »

First of all it's not the JVM which runs the bytecode on Android but something totally different. Second the framework is different and cannot be shared.

I don't use Java, as I don't like it much, so sadly I can't help you with the choice of a framework.
Creator of Dot World Maker
Mad programmer and annoying composer
User avatar
vitinho444
Posts: 2825
Joined: Mon Mar 21, 2011 4:54 pm

Re: Why Java? Why C?

Post by vitinho444 »

C# would be my recommendation hands down.

I'm "learning" JAVA at college, and I can't really like it... C# is very similar but since Micro$oft is behind it with the .NET framework it beats JAVA in my books.

Also, like alain said, if you're using Unity, C# would be the one you should use. There's also javascript (Unity script), but C# is so much better and you can use your experience outside Unity.
Also, since you want to create Windows games and Android, then Unity is the way to go, C# + Unity + one-click-export to all devices. 8-)
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
User avatar
Renavoid
Posts: 60
Joined: Sat Feb 23, 2013 7:48 pm

Re: Why Java? Why C?

Post by Renavoid »

tl;dr: The type of application you're developing changes the style you develop with

I've never developed for Android, nor have I developed games using Java, so I can't really speak there either.

But, I can add some more light to the whole "it's not the same as developing for desktop" question. So, the syntax of the language itself is the same, yes. You'll still initialize an ArrayList by doing new ArrayList<String>(); or whatever type you need. But, the type of framework you use will completely change your execution.

Imagine you're programming a website. Websites are stateless (or at least, socketless websites are stateless). That means that every time your computer sends a request to a server for information about the website you're viewing, it has to send all the information necessary for the server to figure out who you are again. Requests are mapped to a specific location on the server's drive, and typically return a static file or execute a script at that particular location. In the case of applications which use managed code, such as a site running ASP.NET MVC (forgive my IIS terminology, I usually work with Windows), a particular chunk of code inside the application will fire instead of a single script. This means that everything you program will be done in response to a request. You get a single request and do all your logic needed with that request to send back a single result (caveats here, but it's the gist of the matter).

Compare this to developing a WPF application where you will usually be responding to events (you can think of this in terms of javascript as well. same thing). When User taps X, do Y. The application knows what state it is in, and which events are important to the user. There are more likely to be background tasks running which push results back to the screen when complete as well.

Developing for a game is typically somewhere in the middle of those two, depending on the type of game you're using. A 3D game made with something like Unity3D will be updating the drawn images to the screen very frequently (hello, framerates!). In that setting, you have algorithms which run every time the frame is updated, so they're split up into chunks, but the chunks are persistent across frames. Different engines manage this in different ways, and some don't require you to handle coded Updates every frame at all (hello, GameMaker).

I've described this as a sort of spectrum, but it isn't really a spectrum.. it depends on what you're doing, and what you're using to do it.
The winds of change are blowing; will you heed their call?
User avatar
Xaos
Posts: 946
Joined: Wed Jan 11, 2012 4:01 am

Re: Why Java? Why C?

Post by Xaos »

You can use Unity C# to make a game for Android (and iOS). C# is my favorite language, personally.
User avatar
vitinho444
Posts: 2825
Joined: Mon Mar 21, 2011 4:54 pm

Re: Why Java? Why C?

Post by vitinho444 »

Xaos wrote:You can use Unity C# to make a game for Android (and iOS). C# is my favorite language, personally.
+1. If you don't count PHP :D


@Renavoid
Very good explanation ;) Thanks for that.
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
User avatar
Gunner
Posts: 276
Joined: Sun Aug 14, 2011 12:07 am

Re: Why Java? Why C?

Post by Gunner »

and what the hell are all those ++ and # signs? is it like versions?
Skype: mrvictordiaz
User avatar
Renavoid
Posts: 60
Joined: Sat Feb 23, 2013 7:48 pm

Re: Why Java? Why C?

Post by Renavoid »

They're different languages. C++ (pronounced C plus plus) is generally used for systems level operations and embedded software. C# (pronounced C sharp) is usually a .NET platform language. C++ was originally created as something like "C with Classes" hence the name "plus plus" but it's evolved to quite a bit more now (and C has evolved as well for that matter).
The winds of change are blowing; will you heed their call?
Post Reply

Return to “Coding”