What Language to Use

Started by
9 comments, last by xTbs 8 years ago

Hey everyone,

After around 5 years of being away from any sorts of programming, I decided to pick it up again and try making something, I'm not 100% sure if I want to do a game, chat app, or a combo of both, but I want to utilize mysql's database properties with it, for things such as user accounts or other things that a table may be less cumbersome to use. Anyways, when I was programming on a more regular basis, I used to use java, c++ or visual basic. Since I havent programmed in a while and have basically forgot all the syntax and fun basic stuff, I figured I'll try to learn (or relearn) a language to use.

So enough beating around the bush. What I really want to know in the end, Is what programming language I should be using for a game or app of this sorts that is going to rely off of a sql database. I am open to suggestions and would love any input.

Thank you in advance. :)

Advertisement

Depends on what your target platform will be but if you know C++ then use that.

For an easier re-introduction into code you could pick up C# as fantastic language that can run cross platform under Mono. C# started as a poor Java clone hut has left Java in the dust playing catch up for years now. The Unity engine also runs on C# so good ease into 3d engine etc.

Most languages will talk with an SQL database, how usually depends on the language/database in question.

Since you've already done C++, I'd say go with that. It will give you the most options overall in the game development field, and it's the standard in the industry.

If you are going to be using an intermediate service for your game to connect to MySQL (i.e REST api) then any language will be fine. If you did Visual Basic .NET (rather than VB6) then you will be quite familiar with C# since it is actually the same technology (standard library etc...) apart from the syntax. But I agree with 0r0d and highly recommend C++ in the long run for portability and overall knowledge (in your CV etc...).

If you are going to have your game connect to MySQL directly, a slight warning regarding Unity (if you were planning to use it). The C# .NET connector for the MySQL database is not likely to work with the .NET mono implementation provided by Unity since Unity uses an extremely old version of .NET (from a time before C# actually was considered better than Java). Think of C# only really as a scripting language when used with Unity. By all means though you can write a C++ plugin and do the database connectivity through that.

I am currently working on a project involving the Unreal Engine (so C++) connecting to a HTTP REST API for user accounts (so PHP) connecting to a PostgreSQL database (so SQL).

This setup seems to be working well.

Edit: We use a simple C library called libcurl to allow Unreal Engine to connect to the REST API via HTTP. It is a lot more powerful than the inbuilt stuff in both Unreal and Unity.

http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.

Well, first question is what are your plans (yes, I have read that you don't know yet... lets work from the assumption you do).

Do you want to program for the heck of it, want to low level stuff and have fun writing renderers and stuff? Do you want to create small 2D games?

If you want to go full DIY, the skys the limit... though I would also recommend either staying with C++, or picking C# for an easier beginning should have forgotten too much of C++.

There are many frameworks that might give you a boost... SDL, Mono and whatnot. IDK if all of them are language agnostic, most will most probably force you to use one or the other language. If you want to do less low level plumbing and concentrate more on your game, keep this in mind.

Do you want to concentrate on your game and work at max efficiency? Pick a game engine, and work with that.

Every game engine will force you to work with its (or one of its) languages used for the scripting part of the engine. I would recommend Unity 5 or Unreal Engine 4, which happen to support C++ (Unreal Engine 4) or C# (Unity). Of course these are rather big 3D engines. They have a lot of options, but also a steep learning curve. There are certainly smaller 2D engine you could use with C++ and C#....

Thank you everyone for the input, I really appreciate it.

Right now I am using netbeans as my IDE because of its versatility with languages, I'll be honest I never thought c++ was good for game design but with that being said, When I was in my programming course everything was command prompt based, no gui. I havent looked into putting Unity on my pc yet, but I think I will look into it. As far as what type of game I was looking at the idea of 3d.

I also just want to double check on this, is c++ cross platform? I know it runs native on windows but do other os' support it? Or would c# be more appropriate for that?

I also just want to double check on this, is c++ cross platform? I know it runs native on windows but do other os' support it? Or would c# be more appropriate for that?

C and C++ are really the only fully cross platform languages that games are written in today.

However to actually make them work across different platforms takes some work. This is where languages that run inside a virtual machine come in handy (such as Java and the JVM or VB.NET/C# and the .NET VM). The VMs in effect provide a "virtual" platform ontop so you just need to target that.

However, porting these virtual machines to get them running on different platforms takes work and when it comes to consoles or smaller devices, they are often less supported. I.e getting Java VM to run on a PS4 is not likely, whereas getting a .NET VM to run on a Blackberry is equally unlikely.

For most platforms people use today, Mono (the open-source .NET implementation) does work fine. But for future platforms (?), older or server platforms (Windows <2000, Solaris <10, AIX) or exotic platforms (Plan 9), C and C++ are probably the best choice.

As an aside, C++ can be compiled to ASM.js to run in a web browser (Unity and Unreal use this behind the scenes).

Also, C++ can run inside a .NET virtual machine by using Microsoft's C++/clr compiler.

C++ can also run inside an Adobe Flash VM using Adobe cross bridge compiler.

If you intend to write code to support that absolute locked-down mess that is Windows RT, then Microsoft C++/cx is available.

I personally find that on Linux, Steam games requiring Java or Mono are a little bit flakey due to the provided VMs. Native code is still the only first class citizen.

http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.

Awesome, Thank you so much. I guess I need to brush up a bit on c++

I also just want to double check on this, is c++ cross platform? I know it runs native on windows but do other os' support it? Or would c# be more appropriate for that?

C++ is platform-independent. There are compilers and APIs for every platform you can think of, not to mention tons of sample code and people and forums to look for help.

You might also want to look into C++11 since that has many new and useful features.

This topic is closed to new replies.

Advertisement