js vs python

Started by
6 comments, last by Krohm 10 years, 8 months ago

I am not sure if this topic is apropriate here, but indeed it would be very interesting to me read something about it here.

Personally I am almost exclusively involved in c coding (about 5 years of experience (maybe more depends of the way of counting)) never used high level languages to coding something like a small (or bigger) game,

Recently I interested myself accidentaly in some javascript language listings that seemed to me nice in some way (I think it looks much nicer than languages like java or c# ), prewiously I also knew python a little (but really not to much) -- so now those two languages javascript and python seem to me the two main candidates for writing some games in high-level-friendly way

(I do not argue that this is a better way of writng games than in low level c, it is worse because of performance and other things, but writing listings in such high level has some nice properties too)

My question is: if treating such languages javascript and python as competitors (both are high level, but both are very different ) which of them would be the better for game coding and why?

(the look of the listing/game source means the most here for me, If someone wants someone may assume that both languages would be working on top of the same framework, Im just curious in comparing the language itself the most)

(but on the other way the real frameworks and possibilities of the two languages and environments also may be compared - Is something potent to say something to me about this ?)

Advertisement

Javascript has WebGL, which is pretty important if you want to make a browser-based game. I don't really think Python has an equivalent to that.

I'm not sure if I'd see Javascript and Python as equals to begin with however.


My question is, if treating such languages javascript and python as competitors (both are high level but both are very different ) which of them would be the better for game coding and why?

JavaScript is the language of the web. If you are developing an HTML5 game, that means Javascript.

You can develop games in python with libraries like PyGame. They are a different demographic.

I recommend that game developers learn a collection of languages. These include C++, C#, Java, JavaScript, Python, and Perl. All of them have their uses, and being comfortable in multiple languages expands your options as you look for solutions to problems.

At the moment the easiest way to develop web games is to use Javascript. Python can't be (easily) used to target the web.

Python is a fine language for general purpose - you can use it to write native games, but not web ones (easily) (NB: I think that it's possible to compile Python into JS, but not easy. )

On the other hand, their semantics are broadly similar - but Python has a much nicer syntax.


Python is a fine language for general purpose - you can use it to write native games, but not web ones (easily) (NB: I think that it's possible to compile Python into JS, but not easy. )

Maybe not the front end, but there's nothing to stop you writing the backend in python.

if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight
It may be worth pointing out that JS is a viable alternative to C# when using Unity.

On the other hand, their semantics are broadly similar - but Python has a much nicer syntax.

It could be interesting for me to hear opinion of somebody who has good knowledge in both.

For example why you think python has a much nicer semantics, could you show some examples (two routines one in js one in python ?)

IMO Interesting is that they are both very different syntaxes (and probably much different semantics) and to look which one is better and why.

Basically every computer has JS interpreter installed. It even got a name which means something to the user, you don't need to explain them what an interpreter is... it's just "the browser". I think this is a major plus.

Previously "Krohm"

This topic is closed to new replies.

Advertisement