Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
30 minutes to make a collaborative paint with Play2, Canvas and WebSocket (greweb.fr)
45 points by gren on March 12, 2012 | hide | past | favorite | 9 comments


Gaetan, excellent demo. You covered 3 technologies that work wonderfully together: Play! 2.0, WebSockets and Canvas. Fortunately the usage of each was all straight forward but you married them together into a creative demo app that didn't require black-magic in any of the implementations.

I've never worked with Canvas before but was surprised/pleased to see how it feels a lot like working with Java2D when rendering a 2D context (strokes, lines, joins, etc.) -- I felt the same about WebSockets, definitely had a "It is that easy to use them? Nice!"

Scala on the otherhand... I'll happily concede that I am possibly a lost-cause when it comes to Scala (14 years of Java will do that do you, and C/C++ before that). When you went to that Hub impl on the server side, a small tear rolled down my cheek caused by brain-pain trying to feel my way through that Scala code (nothing wrong with your code, I just don't like the way Scala looks/feels).

Thanks again for putting this all together and sharing.


Play also has first class support for Java. I would love to see how this Scala code translates to Java. My understanding is it should be fairly straightforward.


I wasn't clear on the role of Java/Scala in Play2, he used the standard "play new app" approach to gen the new app and got all Scala templates, that is what confused me... it wasn't like "play new app -scala" or some specific switch.

I've used Play1 quite a bit and would hate to lose it as a tool.


Hi rkalla and thanks for your feedback.

The idea behind Play2 is to have a framework written in Scala (the core) but providing a full API for both Scala and Java languages. Hence, users can choose their preferred language to write web applications.


Scale is definitively an acquired taste -- some of us have just acquired that taste before.


Aside from not being able to see the video due to a missing-plugin. The demo is really neat.



Mmh sorry for that, that's strange I thought Youtube has HTML5 video support - moreover i've encoded my video in WebM format.


I think that might be the problem. For some reason Chrome was not playing nice with WebM and HTML5 Video which I am registered for. The problem was on my end not on yours. I whispered sweep nothings to my computer while i restarted chrome and it worked fine afterwards.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: