+ Reply to Thread
Results 1 to 21 of 21

Thread: C, C++, Java, or ???

  1. #1

    Default C, C++, Java, or ???

    Hi everyone,

    I known the following question is close to hollywar,
    but could you answer what language do you prefer to use
    for game development?
    Why you use C++ or Java?
    Why you don't use Java or C++?
    Or why you use some other language, for example C or Basic.
    What can make you switch from C++ to Java or vice versa?

    Thanks!

  2. #2
    Senior Member
    Join Date
    Mar 2008
    Location
    Gainesville, Florida
    Posts
    794

    Cool

    It really does depend on the target platform(s).

    I use C++ for Mac/Win. If I were to write a CellPhone game (excluding iPhone) I'd use Java. C for a lot of embedded devices.

    Even then, I guess it would depend on the tools I use to create the game. What if you want to use Torque or BlitzMax? They use their own scripting languages.

    The right tool for the right job. You also have to be flexible: When all you have is a hammer, then everything looks like a nail.
    -James
    Haunted Hotel I, Haunted Hotel II, Jane Croft

  3. #3

    Default

    Well, I currently focus on Java. I try to keep my eyes open for other alternatives though. If you're looking for a pre-built engine to work with, you'll have a lot more choices going the C++ route. There's a couple out there for Java, but I haven't been able to build a whole game around one yet for numerous different reasons.

    I'm building my own game engines using Java and LWJGL. I like Java for it's "forgiving" nature over C++ (things like automatic garbage collection and the like, and since it's a VM it's better at not crashing the whole system when there's a development mistake). But currently, Java is pretty much limited to openGL for 3D acceleration, which is fine (and preferred by me) for everything except Windows Vista.

    As for the "what could make me switch," I'm not sure. I like the compile-once-run-anywhere concept of Java, whereas with C++ I'd need to recompile for each platform. I used to think it was a drag to have to include the Java JRE with my games, but these days it's not really much larger than all the libraries you'd have to include with a C++ distribution. I think it'll take either Unity or Shiva stepping up their game to get me to move away from self-built game engines on Java. If Unity included Windows platform support in their indie license, I'd probably be there already (and if Shiva had a Mac IDE, I'd take a solid look at them too... hint, hint).

  4. #4
    Senior Member
    Join Date
    Jul 2004
    Location
    Durham, UK
    Posts
    4,873

    Default

    I use Java because it's easy and I'm not very clever.

    Cas

  5. #5
    Senior Member
    Join Date
    May 2005
    Location
    Warsaw, Poland
    Posts
    2,707

    Default

    In my current iteration of the engine (i stopped counting after a while after the number reached two digits, although i suppose its still a two digit number :-)) i use plain old C. At the past i used C++ and Java with LWJGL. The reason for C is that i'm much more comfortable with writing optimized and clean code with C than Java and since last year or so i prefer the simplicity of C. While i could write C++ in "C style" i don't do it for three reasons:

    1. I dislike the strict typing system. For example i dislike type casting in malloc and similar functions and i prefer
    Code:
    char* foo = malloc(...);
    this is valid in C but not in C++ because malloc returns void* and foo is char*. In C you can assign void* to any kind of pointer.

    2. C exported name conventions for symbols are pretty much universal: '_foo' for the symbol 'foo'. When making tools with other languages (such as Lazarus/FreePascal) it is much easier to interface than if C++ was used because most link-time languages can load C symbols directly whereas every C++ compiler (or even different versions of the same compiler) handles this differently. Although my main world editor is written in C and GTK+, i do have some minor tools written in Lazarus which benefit from this simplicity. Also makes writing a plugin system a much easier process and people can use pretty much any language that can handle DLL files.

    3. Compiler speed. For some this isn't an issue, but for me it is, especially since i use SCons which by itself is slower (but much much easier to use and extend) than make or other similar tools. I'm comparing C compiling to C++ compiling here since Java is faster than C when compiling code. Also i know this is a compiler-specific issue, but it is the case that most compilers i tried are faster when compiling C code than C++ code and in GCC -which is what i use- the difference is huge.

    Next month i might use Visual Basic .NET.


    not.

  6. #6

    Default

    I use Java because it's easy and I'm not very clever.
    Awesome. Just. Awesome.

  7. #7

    Default

    Thanks guys for your answers!

  8. #8
    Senior Member
    Join Date
    Aug 2004
    Posts
    947

    Default

    Quote Originally Posted by jpoag View Post
    What if you want to use Torque or BlitzMax? They use their own scripting languages.
    Just to be clear, BlitzMax is a programming language, so it doesn't use a scripting language. It's an IDE, a debugger and a compiler, that's it. It doesn't have tools or editors the way Torque does, so there is nothing to script. It compiles to machine code, and that is the only way it works. It cannot function as an interpreter ( although there is a third party product which does offer a scripting language which has pretty much the same syntax as BlitzMax. )

  9. #9

    Default

    BTW princec I could't run any game from your site under Mandriva 2009.0
    Firefox and Konqueror offers to open jnlp file using IcedTea,
    but IcedTea does not exist on Mandriva 2009.0.
    IcedTea was completely replaced with OpenJDK 6.0.

    Ok, I am just downloading jnlp and trying to run:
    >javaws droidassault.jnlp
    netx: Invalid XML document syntax.

  10. #10

    Default

    Quote Originally Posted by Sybixsus View Post
    It's an IDE
    Oh, it's so ugly IDE... I don't understand how people can use this.

  11. #11

    Default

    princec:

    I remove Open JDK 6.0 and install Java-1.5.0-sun.
    Now browser offers to open jnlp file using Java Web Start,
    and installation is working, but it doesn't work correctly.
    I have Compiz installed, and fullscreen mode doesn't work with your
    game (I tries Droid). Taskbar at bottom of the screen,
    cover part of the game screen. Сlock, volume control, etc,
    disappeared from taskbar

    p.s.
    I think "pack all together" will work better for any platform
    instead of using Web Start technology.
    Last edited by esmelon; 12-12-2008 at 01:34 PM.

  12. #12
    Senior Member
    Join Date
    Mar 2008
    Location
    Gainesville, Florida
    Posts
    794

    Cool

    Quote Originally Posted by Sybixsus View Post
    Just to be clear, BlitzMax is a programming language, so it doesn't use a scripting language. It's an IDE, a debugger and a compiler, that's it. It doesn't have tools or editors the way Torque does, so there is nothing to script. It compiles to machine code, and that is the only way it works. It cannot function as an interpreter ( although there is a third party product which does offer a scripting language which has pretty much the same syntax as BlitzMax. )
    Yepp, yepp. Fired BlitzMax up for the first time today. 'An Enhanced' version of BASIC as the packaging says.

    Not really impressed with it though, First install, 30 days remaining in the trial and it would NOT compile or run the demos it comes with (useless!).

    Yes, the IDE is ugly, but I've seen games that have come out using it and I have to say that it must do the job.

    Also, I guess there's a Lua Module.
    -James
    Haunted Hotel I, Haunted Hotel II, Jane Croft

  13. #13
    Senior Member
    Join Date
    Jul 2004
    Location
    Durham, UK
    Posts
    4,873

    Default

    Quote Originally Posted by esmelon View Post
    BTW princec I could't run any game from your site under Mandriva 2009.0
    Firefox and Konqueror offers to open jnlp file using IcedTea,
    but IcedTea does not exist on Mandriva 2009.0.
    IcedTea was completely replaced with OpenJDK 6.0.

    Ok, I am just downloading jnlp and trying to run:

    Never mind eh. Get a proper OS and it'll run OK.

    Cas

  14. #14
    Senior Member
    Join Date
    May 2005
    Location
    Warsaw, Poland
    Posts
    2,707

    Default

    @esmelon:
    Compiz is a hack. Not as much of a hack as xgl was, but still a hack to provide "3d desktop". Yes, it adds nice effects that will wow most of the people, but it slows down the rest of the system, adds a lot of compatibility issues with X programs (especially some Java programs seem to dislike Compiz), is still very unstable, and adds very little in usability terms (i love the "expose"-like functionality and being able to zoom-in, but after a while using a compositing desktop i got bored of the issues).

    Also OpenJDK/IcedTea doesn't work well. I had issues running jEdit with these which were solved once i switched to Sun Java 6.

    As a last note, for some reason most Linux distributions seem to get one thing or other wrong. However Ubuntu seems to have most things done right so i highly recommend it instead of every other distribution especially if you don't know much about Linux. I try other distros every now and then, but i always switch back to Ubuntu.

    My only issue with Ubuntu is that when you install a Java-based application from the repositories (say, Eclipse), it will drag all Java VMs even if you already have one installed. And guess what, all of them -with the exception of Sun's- have so many problems most Java programs won't work. I tried to install Eclipse a few days ago in 8.10 and then i had to manually remove them one by one.

  15. #15
    Senior Member
    Join Date
    Aug 2004
    Location
    Arlington, VA
    Posts
    656

    Default

    Quote Originally Posted by jpoag View Post
    Yes, the IDE is ugly, but I've seen games that have come out using it and I have to say that it must do the job.
    I think BlitzMax secret is that it keeps you from making things complicated. You hack together the game without getting all "Systems" on it and you get the game done instead of falling into opimization hell.

    For BlitzMax you should consider Grey Alien BlitzMax Game Framework is a proven framework and gives you some legs up on development. List of Framework Games
    Philip Ludington
    Mr. Phil Games

  16. #16
    Junior Member
    Join Date
    Dec 2007
    Location
    Virginia, US
    Posts
    3

    Default

    Quote Originally Posted by esmelon View Post
    Oh, it's so ugly IDE... I don't understand how people can use this.
    Yea, Blitzmax's IDE is pretty bad when you have large projects to manage. But that's not your only option.
    http://blide.org/

    Blide is an extremely nice IDE for blitzmax. It's about as close to VS as you'll get (and the developer is always improving it) with blitzmax. It has auto-complete, project management, etc. Anyone that liked what Blitzmax had to offer, but hated the working environment I'd highly encourage to try out blide free edition for a few days.

  17. #17
    Senior Member
    Join Date
    Aug 2004
    Posts
    947

    Default

    Quote Originally Posted by esmelon View Post
    Oh, it's so ugly IDE... I don't understand how people can use this.
    I don't think anyone does. Like most compilers, it's not tied to an IDE. The original IDE is open source, so there is a heavily modified version of that floating around for starters.

    There is Blide, which is very similar to Visual Studio, and a few others for those who prefer something more lightweight. I think there's a plugin for Eclipse too.

  18. #18
    Senior Member
    Join Date
    Jul 2004
    Location
    Redmond, WA
    Posts
    210

    Default

    Quote Originally Posted by MrPhil View Post
    I think BlitzMax secret is that it keeps you from making things complicated. You hack together the game without getting all "Systems" on it and you get the game done instead of falling into opimization hell.

    For BlitzMax you should consider Grey Alien BlitzMax Game Framework is a proven framework and gives you some legs up on development. List of Framework Games
    Unfortunately, that's not for sale any more. Big Fish owns it now.

    I got the last copy
    --Charles Oines
    Irrational Designs

  19. #19
    Senior Member
    Join Date
    Jul 2004
    Location
    Durham, UK
    Posts
    4,873

    Default

    Quote Originally Posted by esmelon View Post
    princec:

    I remove Open JDK 6.0 and install Java-1.5.0-sun.
    Now browser offers to open jnlp file using Java Web Start,
    and installation is working, but it doesn't work correctly.
    I have Compiz installed, and fullscreen mode doesn't work with your
    game (I tries Droid). Taskbar at bottom of the screen,
    cover part of the game screen. Сlock, volume control, etc,
    disappeared from taskbar

    p.s.
    I think "pack all together" will work better for any platform
    instead of using Web Start technology.
    No idea what Compiz does or any of that weird linux stuff. I suppose until they stop trying to be clever and settle on a single distro it's never really going to work properly for everyone.

    Cas

  20. #20
    Senior Member
    Join Date
    Aug 2004
    Location
    Arlington, VA
    Posts
    656

    Default

    Quote Originally Posted by Ratboy View Post
    Unfortunately, that's not for sale any more. Big Fish owns it now.

    I got the last copy
    OH wow! Your right, I must have missed that announcement. How lucky I am!
    Philip Ludington
    Mr. Phil Games

  21. #21
    Senior Member
    Join Date
    Jul 2004
    Location
    Calgary, AB
    Posts
    522

    Default

    Quote Originally Posted by MrPhil View Post
    OH wow! Your right, I must have missed that announcement. How lucky I am!
    Ditto.

    I wonder if GreyAlien was able to negotiate a sweeter deal with BigFish for the inclusion of his IP into the new gig...

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts