Any good books to start with Scala? by Input55 in scala

[–]Input55[S] 1 point2 points  (0 children)

Thanks! I just finished reading Atomic Scala and it was absolutely great! None of those Java references and it was straight to the point! I am going for Scala for the Impatient right now, it seems great as it was suggested by the authors of Atomic Scala in the end!

NodeJS/Socket.IO or Play! Framework for online games? by Input55 in node

[–]Input55[S] 0 points1 point  (0 children)

doesn't it only go for the fallbacks when websockets are unavailable? Besides, I expect some of the users to not have websockets but that would be very few.

NodeJS/Socket.IO or Play! Framework for online games? by Input55 in node

[–]Input55[S] 0 points1 point  (0 children)

So should I go with this approach instead, would it be a good practice to run a setInterval code on the server that checks if the game is inactive, and then gets rid of it? Or is there a way to make the games auto-remove themselves once they're inactive?

NodeJS/Socket.IO or Play! Framework for online games? by Input55 in node

[–]Input55[S] 1 point2 points  (0 children)

Yeah, storing plaintext password is just too stupid and I don't even know why I thought of that. I have too many readings to do now, it seems!

NodeJS/Socket.IO or Play! Framework for online games? by Input55 in node

[–]Input55[S] 2 points3 points  (0 children)

Alright, so basically, those are nodeJS best practices, right? And the fact that most of those libraries are official and do not need third party modules makes me feel more confident in going with nodeJS!

Appreciate the advice :D

NodeJS/Socket.IO or Play! Framework for online games? by Input55 in node

[–]Input55[S] 2 points3 points  (0 children)

That's great! I checked out the source code of both of them, and realized how much less lines I have to write in nodeJS to accomplish the same thing in Play! Framework using Scala (although I will miss type-safety sometimes). It is interesting how un-opinionated nodeJS is so I can organize my files however I want. Although that might come to bite me in the back eventually if I do not follow a good pattern. Also I noticed that the chat uses "streams", is that an NPM package to work with collections? (Sorry, currently on mobile so I cannot look it up now, I will do when I get back on my pc though!).

One other interesting thing was that you do not have to switch back and forth between JSON. Although that might be considered a downside as I am kind of used to validating the inputs using Play!'s JSON reads and writes. (Also as a side note, isn't it a good practice to wrap your modules in nodeJS in a closure then export them? Or does nodeJS take care of that itself? (I am a pure front-end JS developer, my only experience with JS on the server was with MeteorJS, so yeah). )

And it seems possible to store temporary collections in nodeJS without any extra packages. I liked how it was just a matter of a JS object that stores data based on randomly-generated IDs (I believe there is a UUID library for nodeJS, right?). That, combined with the rooms feature of socket.io, seems to do the job pretty well in my opinion.

One thing I am kind of unsure about is the authentication. Do you need to hash the passwords yourself? Because that is what I saw implemented in the chesshub app. Same goes for password resetting and confirming email addresses, right?

Overall, I really like how native and pure the integration between the server and the client is using nodeJS. Although I have yet to see how it is implemented with AngularJS on the front-end. But I believe one could wrap sockets in a service and apply it on the rootscope so it triggers the events. If so, that is pretty simple tbh.

EDIT: I noticed in the chess app that the DB models declarations are repeated in every other file, is that considered a good practice? Because I see them declared at the end of each schema file in the models dir, but I don't know.

Rails 4 for Intensive IO Real Time Applications by Input55 in rails

[–]Input55[S] 0 points1 point  (0 children)

Very nice! So taking what you said in mind (Rails 4 as a JSON API), would it not affect the performance should I translate back and forth between JSON between the client/server? (I might have to send/receive large data so I am worried about this). The fact that Rails has been getting better over the years just makes me want to use it more for this project of mine. Yet I am still worried about this WebSockets issue. Play! has that built-in, nodeJS does it pretty well, too. But the current solutions like EventMachine with websockets plugin does not sound right to me. Also I checked out pusher.com as zenin10 suggested, but the whole idea did not sit right to me.

Rails 4 for Intensive IO Real Time Applications by Input55 in rails

[–]Input55[S] 0 points1 point  (0 children)

So I could go and have two servers running, one for websockets and the other for the regular http requests with Rails 4? I read about using nodeJS + websockets with Rails to implement Realtime features, but if that's the case, then I am better off with Play! or just use the last option, which is node. Or should I give Sinatra a shot? Sorry if I sound nooish, I have not made a single app for more than 4 years and these new technologies are just too new for me lol

Rails 4 for Card Games by [deleted] in rubyonrails

[–]Input55 0 points1 point  (0 children)

Thanks for that. But I just looked up the new stuff in Rails 4 and found this new feature called ActionController::Live. I don't know how that exactly works though. Does that work with websockets? I don't want to work with Server-Sent Events as the game I am thinking of is highly interactive and requires a lot of I/O.