Game Design Portugal
Olá bem vindo a comunidade GDPT, se quiseres te:

Apresentar aqui

Registar aqui
Últimos assuntos
» Aulas de programaçao gratuitas em Lisboa para adolescentes
Qui Nov 21, 2013 9:51 pm por Talmeida

» Lista Actualizada de Empresas Portuguesas 14/11/2013
Qui Nov 14, 2013 10:17 pm por IuriMonteiro

» Restart - Game Design
Qua Set 11, 2013 8:23 am por IuriMonteiro

» ZombieApocalift
Ter Set 10, 2013 5:24 pm por IuriMonteiro

» Nova GamePlay
Qua Ago 28, 2013 2:14 am por easygamesproduction

» Programador Procura Conselhos
Sex Ago 02, 2013 5:45 am por easygamesproduction

» Unity 4 -Serie: Crie Seu Jogo de RPG 3D
Sex Ago 02, 2013 5:20 am por easygamesproduction

» Videojogos portugueses - Portugal Aqui Tão Perto
Sex Maio 31, 2013 7:39 am por IuriMonteiro

» Rayman Origins
Dom Maio 19, 2013 11:45 am por IuriMonteiro

» Last of Us
Sab Maio 18, 2013 11:16 am por IuriMonteiro

» Lista de todas as empresas portuguesas
Sex Maio 10, 2013 8:09 pm por IuriMonteiro

» Chrome World Wide Maze
Dom Mar 24, 2013 4:26 pm por IuriMonteiro

» Brigade - Real-time path tracing engine - WIP
Dom Mar 24, 2013 4:24 pm por IuriMonteiro

» Novo jogo da Battlesheep: Bounty Monkey
Dom Mar 24, 2013 4:06 pm por IuriMonteiro

» Unreal Engine 3
Seg Mar 04, 2013 11:37 am por Diogo86

» Where can I sell my Indie PC game?
Sab Nov 17, 2012 4:44 pm por IuriMonteiro

» When Players Make the Rules: On Memes and the Meta-Game
Sab Nov 17, 2012 4:41 pm por IuriMonteiro

» Electronic Arts COO Fights to Lead the New Game Industry
Dom Nov 04, 2012 3:36 pm por IuriMonteiro

» Miniclip - Game Designer
Dom Nov 04, 2012 3:31 pm por IuriMonteiro

» Miniclip - Studio Manager
Dom Nov 04, 2012 3:30 pm por IuriMonteiro

Opinion: Why You Might Want To Consider Java And/Or Clojure For Your Next Project

Ver o tópico anterior Ver o tópico seguinte Ir em baixo

Opinion: Why You Might Want To Consider Java And/Or Clojure For Your Next Project

Mensagem por IuriMonteiro em Qui Jul 07, 2011 11:49 am

First, let's be clear: I am speaking to anyone but console/mobile/AAA developers here.

I like to program 'close to the metal.' It gives me a feeling of control, even if the compiler is actually completely rewiring my code. I like C and C++ because they do not try to hide much from the programmer – they are very basic imperative languages. That said, there are many, many things I hate about them.

For a long time, Java struck me as a somewhat mediocre language. Its performance seemed a little bit weak and most people would scoff at the concept of using it for game programming.

More recent versions of the JVM actually have great performance. It can be difficult to organize an effective benchmark, but some tests suggest that Java can actually exceed the speed of C/C++ in certain cases. This is due in part to the fact that Java has more constraints in some areas (i.e. pointers), and that it can be optimized more effectively based on this.

Java can also optimize itself with JIT compilation, and optimize between successive runs. That said, you definitely should not choose Java on the basis of performance alone.

I once heard something that has stuck in my mind ever since: "servers are cheap, programmers are expensive." In other words, you have to carefully choose your battles: at what point is optimization worth a programmer's sanity? Java might not be the fastest language, but it will keep you slightly more sane than C/C++, and is usually worth the slight performance penalty.

But what is really important is that the loss of performance can be a good thing. When you stop focusing on performance, and start focusing more on your game, a new world of opportunity opens up.

I hate to always bring it up in examples, but take a look at Minecraft: simple graphics, but it runs on a variety of hardware and operating systems. Java programs have better potential for a long lifespan – this might not seem too important, but try launching an old DOS game these days — can be quite tricky sometimes, even with an emulator.

Java is also cross-platform — this makes porting really painless. You can also run Java in the browser as an applet or via a quick-launcher. Managing 'imports' and 'packages' is much easier than dealing with '#include' statements in large projects.

You can also easily get a free IDE up and running quickly: Eclipse (for C/C++, last I checked, setting up the compiler could be tricky on Windows, which does not include a compiler by default like gcc on Mac/Linux). C# actually is quite good in many ways as well, but unfortunately its open source counterpart (Mono) leaves it trailing a little bit behind on operating systems other than Windows.

I am no expert on how well Java interfaces with DLLs and what the performance penalty is for accessing the GPU from Java. I also do not recall how Java handles passing resources to the GPU, which are usually passed via pointers. But it is fast enough to generate simplistic graphics at the very least (see: JOGL, JMonkey Engine, LWJGL, etc). While WebGL and Javascript can do the same, Javascript is not quite at the performance level of Java (even with V8 and the like), and as a language it is not the best designed for taking on larger projects.

Clojure is another language you might want to examine. It is a relatively new functional language that compiles to the JVM, and is a LISP dialect. It imposes certain restrictions (i.e. state-based immutable data) to make multithreading as simple and painless as possible. As the number of cores on a CPU increase, I could see Clojure being a real contender, although I am still slightly skeptical of its performance in some areas.

TL;DR: sacrificing performance can be a hard pill to swallow – but it is also very liberating to not worry about it so much and focus on making something simple and easy to code.
Fonte: Gamasutra

Mensagens : 425
EXP : 3645
Kudos : 1
Data de inscrição : 05/09/2010
Idade : 25
Localização : Carnaxide

Ver perfil do usuário

Voltar ao Topo Ir em baixo

Ver o tópico anterior Ver o tópico seguinte Voltar ao Topo

- Tópicos similares

Permissão deste fórum:
Você não pode responder aos tópicos neste fórum