I have been using PHP for some time now. And I have been thinking about learning Node.js to go along with it to use the non blocking idea for creating an online game or app. There is quite a bit of info on using the two together. Using Node as part of the back end of a game could really speed up some aspects of the game, especially if the game allows users to play against each other in real time.
Well, lately I have also been looking into learning Python (yes I have a lot of time on my hands). There are many features about it over PHP which I really like. But for the use of Node.js to do the background work like I was considering with PHP, I cannot find much information at all. I have also noticed that Python does have some threading features. As I am still very new to Python's world, would I even need Node.js in Python? Can Python handle these kind of features that Node.js can? Or would there still be benefits to using Node, or would I actually need it.
As a side note, since I started looking up Python, I also discovered Twisted which seems to be another framework like Node. But Twisted is written in Python. So in either of the cases above would Twisted be better (aside from the fact that Twisted seems to have been out longer and is more stable than Node). I just mean in general is it worth using at all, either Node or Twisted? And if so is one better than the other with Python?
Sorry for the big question, but I'm just so unsure and n00b in this area. Thanks.
So as it stands, after reading the helpful answers, I see the following options:
- PHP + JS
- Python + Twisted
- Python + PyJamas
- Python + Node.js
- Node.js
- Twisted
I already know PHP and am comfortable with it, and am currently learning JS. This this was a major possible route for me. But I was also leaning away from PHP to Python because the in general features of the language I liked.
This option I thought might be more plausible than #3, using Twisted to handle the networking port to allow the player to play live with each other.
This just makes it so you don't have to learn JS, which to me doesn't seem like that big of a deal. I've already started studying it and it's not that hard to learn. But like was mentioned in a question, mixing things like ; and {} could potentially have some issues.
Like #2, but with Node.js. Mostly I see the addition of Node to handle the networking aspect to let the players be able to play in a live/real-time game. And the majority of the code would be in Python.
Sole Node.js was a consideration as well as it is the single language route. But it doesn't have the same benefits of learning and using Python either (it being a general scripting language I can use in, and out of web design. A big reason I wanted to learn and use it.).
Ans as #5 but I was not considering an only Twisted route until reading the comments. While it seems plausible, it doesn't really involve one of the two languages I want to learn, Python and Node.
The above seems to be the main routes I can go. Now I'm still not really sure which route to go. I really want to learn both Node and Python. So it seems I may just need to learn the two separately. But I still need to pick a choice for this project. And so far I am liking numbers 2 and 5, with 6 a close to 5 since Node and Twisted have some very similar functionality. And 1 as a mention because that's what I already know. But I was wanting to learn something new anyways. So still, really numbers 2 and 5. Or 4 as it's similar to 2. Hah, I still need to do some homework. Maybe it deserves another question.
EDIT (9-19-2012): I just wanted to update, to say that I am using mostly Node.js currently for development. And plan on using Redis for PubSub functionality to give the appearance of real time page updates, as I do not need true real time as in games, or in paired content editing.