Jump to content
  • Advertisement
Sign in to follow this  

js vs python

This topic is 1740 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 ?)

Edited by fir

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites


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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites


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. 

Share this post


Link to post
Share on other sites

 

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.

Edited by fir

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!