School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,391 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,571 people online right now. Registration is fast and FREE... Join Now!




Python VS. Java games

 

Python VS. Java games

WithnoMute

30 Jun, 2009 - 01:14 PM
Post #1

New D.I.C Head
*

Joined: 24 Feb, 2009
Posts: 5


My Contributions
I was wondering peoples takes on Python vs. Java games, i am mainly looking for multi platform programming.
Basically any information about these languages in game programming would be great, im fairly capable of programming in both languages(java a little less).
I know both have good libraries for game dev, but im not sure on speed and security of the game. Python being interpreted(can be made into an executable) and Java being run in VM, will impair the speed of the game. Java and Python are quite easy to get the source code, this is what worries me in the sense of making the game secure.

Any views and ideas are appreciated,
-With.no.Mute

User is offlineProfile CardPM
+Quote Post


coden4fun

RE: Python VS. Java Games

30 Jun, 2009 - 01:25 PM
Post #2

D.I.C Regular
Group Icon

Joined: 27 Feb, 2009
Posts: 288



Thanked: 6 times
Dream Kudos: 350
My Contributions
Python is a high level programming language designed for readability. As far as I know most all python games are made with the library Pygame, which is a wrapper of an older C++ library SDL.

Java is a cross platform independent object-oriented programming language which realizes on a virtual machine called JVM. One can use the J2SE API or various other API's and libraries to make games. Making games in java can be hosted on a website, or be compiled to a program for any OS to play.

I hope this helps!
User is offlineProfile CardPM
+Quote Post

BetaWar

RE: Python VS. Java Games

30 Jun, 2009 - 01:31 PM
Post #3

#include <soul.h>
Group Icon

Joined: 7 Sep, 2006
Posts: 4,729



Thanked: 269 times
Dream Kudos: 1400
My Contributions
Python or Java can be used (Both offer OOP style). I prefer python because you can create C/C++ libraries for it to use (that is what wxpython, pygame and most other python addons are made of - It greatly increases the speed as well as allows for compiling and increased security).

Most of it is dependant on what you like best.
User is offlineProfile CardPM
+Quote Post

Tom9729

RE: Python VS. Java Games

30 Jun, 2009 - 02:05 PM
Post #4

Debian ninja
Group Icon

Joined: 30 Dec, 2007
Posts: 2,129



Thanked: 53 times
Dream Kudos: 425
My Contributions
QUOTE(BetaWar @ 30 Jun, 2009 - 04:31 PM) *

Python or Java can be used (Both offer OOP style). I prefer python because you can create C/C++ libraries for it to use (that is what wxpython, pygame and most other python addons are made of - It greatly increases the speed as well as allows for compiling and increased security).

Most of it is dependant on what you like best.

Offtopic, but you can use C/C++ libraries in Java.

http://en.wikipedia.org/wiki/Java_Native_Interface

Also I would argue that if anything using native libraries is less secure because you open yourself up to things that probably wouldn't happen in Python (buffer overflow, etc).
User is offlineProfile CardPM
+Quote Post

WithnoMute

RE: Python VS. Java Games

30 Jun, 2009 - 02:35 PM
Post #5

New D.I.C Head
*

Joined: 24 Feb, 2009
Posts: 5


My Contributions
Yeah, my main focus is good cross platform code, i think using native libraries will just complicate things. I use Linux and always want to make cross platform programs.
How would i protect the source code if using Python, i know you can encrypt source code like C++ but how will this work with Pythons interpreter.
Which language is faster on the loading? I often used Java apps and they seem to take awhile to load, only used smaller Python programs so cant compare to larger scale.

This post has been edited by WithnoMute: 30 Jun, 2009 - 02:37 PM
User is offlineProfile CardPM
+Quote Post

BetaWar

RE: Python VS. Java Games

30 Jun, 2009 - 02:43 PM
Post #6

#include <soul.h>
Group Icon

Joined: 7 Sep, 2006
Posts: 4,729



Thanked: 269 times
Dream Kudos: 1400
My Contributions
I believe there is a way to create a compiled python file, I am not sure if it does much other than zipping the files together, it may work.
User is offlineProfile CardPM
+Quote Post

Tom9729

RE: Python VS. Java Games

30 Jun, 2009 - 03:40 PM
Post #7

Debian ninja
Group Icon

Joined: 30 Dec, 2007
Posts: 2,129



Thanked: 53 times
Dream Kudos: 425
My Contributions
You can byte compile Python .py files into .pyc files, but you still need the interpreter to run them.

Edit:
http://docs.python.org/library/py_compile.html
http://docs.python.org/library/compileall.html

This post has been edited by Tom9729: 30 Jun, 2009 - 03:42 PM
User is offlineProfile CardPM
+Quote Post

WithnoMute

RE: Python VS. Java Games

1 Jul, 2009 - 07:28 AM
Post #8

New D.I.C Head
*

Joined: 24 Feb, 2009
Posts: 5


My Contributions
so whats the speed difference between Python and Java?
Just wondering which you can get to run faster.
User is offlineProfile CardPM
+Quote Post

Tom9729

RE: Python VS. Java Games

1 Jul, 2009 - 10:04 AM
Post #9

Debian ninja
Group Icon

Joined: 30 Dec, 2007
Posts: 2,129



Thanked: 53 times
Dream Kudos: 425
My Contributions
http://shootout.alioth.debian.org/u32q/ben...ython&box=1

You can play around with some benchmarks there. Generally it looks like Java kills Python in just about everything which isn't really that surprising considering what they're usually used for.

As a beginner, don't worry about performance. I'm not trying to tell you which language to use, but for most things Python will be "fast enough".
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 09:46PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month