I have decided to separate the technical parts of this blog to their own posts, tagged with "Technical:".
This one will talk about choosing and using node.js on the back end / server side of the game. With every choice there are good and bad parts.
So I use only javascript in this game development, because we have front end that naturally uses and requires javascript, as we are talking about HTML5 game development and server side has node.js which works with javascript.
Node.js has matured to a really potential framework, so it was chosen for the back end. I come from mostly from PHP background and when I compare the node.js enviroment to working with PHP, it is unfortunately a long way part still. Unfortunately node.js has a lot of downfalls and problems. A lot of these problems can surely be outcome with different solutions, but they have been handled in many other programming languages a lot better. Partially due to node.js being from dynamic HTML-enviroment and partially because it is a language that has history, not being designed as a programming language, but based on needs for a simple scripting language so it has it's own burdens.
Mostly what I hate about node.js, is the handling of errors. There are many situations where unexpected / unhandled errors are not handled at all. I mean node.js will just not show any errors or problems, everything seems to work, but it doesn't, when you start looking at the variables and the state of the app. In front end the browser handles the errors many many times better.
The part that I most love about node.js and the reason why I still did choose it and why I consider it very good enviroment is that you can use the same codebase in browser and in server. This does require some small modifications, but can be done quite easily. I have already learned the hard lesson of modularizing in javascript. I already knew the technique before and the idea behind it and I did use it a bit. Now when I use the same code in browser and in the server, the modularization of javascript code is really really important. Some libraries are different from browsers and node.js, with modularization I can easily pass these different libraries to the modules in different enviroments.
I will also say that node.js seems to have a very capable system for communicating or exchanging data with the server. Why it doesn't concern me is that these features are not used in this game. These features are very potent for many games, but as our game is not dynamic, but turn-based, we do not need it and thus we don't use it.
No comments:
Post a Comment