[codecraft] Java EE vs. Play

Michael Bar-Sinai mich.barsinai at icloud.com
Mon Nov 23 03:17:11 EST 2015


Another point for Play!: even the warnings are informative.

Below is a warning about a non-exhaustive pattern matching:

[warn] /Users/michael/Documents/Consulting/sayarch/ECF/Conflict-Database/ecf-db/app/ecf-db/app/controllers/EcfJSONFormats.scala:71: match may not be exhaustive.
[warn] It would fail on the following input: FieldAction()
[warn]         fa match {
[warn]         ^
[warn] one warning found


Pretty sweet, I'd say :-)

> On 22 Nov 2015, at 15:00, Michael Bar-Sinai <mich.barsinai at icloud.com> wrote:
> 
> True, but at that point Play! did not rely on dependency injection. From 2.4 on, it does. And the stack traces in Play! are still better, have less frames, and are more readable. The error messages, like he says, are informative and useful.
> Note, however, that when there are multiple compilation errors, you only get one of them on the error page! Sometime you'd get an error that's not the root cause (and as scala is statically typed and uses type inference, this can happen often when making a large refactoring). So sticking with the errors at the console helps (they also have file names and line numbers).
> 
> 
> 
> 
> 
>> On 22 Nov 2015, at 14:37, Philip Durbin <philipdurbin at gmail.com <mailto:philipdurbin at gmail.com>> wrote:
>> 
>> Hmm. But Michael, I thought you made a big deal about how stacktraces were much more readable in your presentation at http://www.mbarsinai.com/blog/2014/06/10/playful-eye-for-the-jee-guy/ <http://www.mbarsinai.com/blog/2014/06/10/playful-eye-for-the-jee-guy/>
>> 
>> I just flipped through your slides at http://www.slideshare.net/MichaelBarSinai/playful-eye-for-the-jee-guy <http://www.slideshare.net/MichaelBarSinai/playful-eye-for-the-jee-guy> and expected to see a screenshot similar to http://horstmann.com/unblog/2015-11-21/play-error.png <http://horstmann.com/unblog/2015-11-21/play-error.png> (good!) as opposed to http://horstmann.com/unblog/2006-06-07/images/stacktrace3.gif <http://horstmann.com/unblog/2006-06-07/images/stacktrace3.gif> (bleh!).
>> 
>> Anyway, I'm kind of used to wading through enormous stacktraces because, well, I have to.
>> 
>> On a related note I just found this: http://www.nurkiewicz.com/2012/03/filtering-irrelevant-stack-trace-lines.html <http://www.nurkiewicz.com/2012/03/filtering-irrelevant-stack-trace-lines.html> which links to http://stackoverflow.com/questions/9606614/cleaning-noise-out-of-java-stack-traces <http://stackoverflow.com/questions/9606614/cleaning-noise-out-of-java-stack-traces> which I just voted up. :)
>> 
>> On Sun, Nov 22, 2015 at 7:03 AM, Michael Bar-Sinai <mich.barsinai at icloud.com <mailto:mich.barsinai at icloud.com>> wrote:
>> ...And then came the migration to Play 2.4, where the static parts are being deprecated, and everything is getting dynamic and dependency injected, and there were quite a few error screens, and stack traces. Not from hell, though*.
>> 
>> * Just finished porting a Play app to 2.4. Not an easy task, even though I like the DI better than Java EE's. Play! still seems to be better-suited for HTTP interfaces, as it does not try to abstract HTTP away. But it's not a clear-winner-by-KO.
>> IMHO, the main issue with Play! is the tools - IntelliJ is the only IDE to that supports it at the moment. ScalaIDE has some official support, but since I've installed it the JVM crashes (that is, I get the OSX's crash dialog, not even Eclipse's). There's a NetBeans plug-in on the way (http://nbpleasureplugin.com <http://nbpleasureplugin.com/>).  As IntelliJ is expensive, buggy, eats RAM and CPU and is generally annoying, I currently use Sublime text and the console. The amazing part - I'm still quite productive with this setup.
>> 
>>> On 22 Nov 2015, at 13:49, Philip Durbin <philipdurbin at gmail.com <mailto:philipdurbin at gmail.com>> wrote:
>>> 
>>> http://horstmann.com/unblog/2015-11-21/index.html <http://horstmann.com/unblog/2015-11-21/index.html>
>>> "All work and no play makes Jack a dull programmer. And I just felt the dull pain of another stack trace from hell from my Java EE app server. There has to be a better way. So I ported the troublesome code to run on the Play framework, and it was all play. No stack trace from hell, just a few screens with clear error messages, and then sweet success."
>>> 
>>> _______________________________________________
>>> codecraft mailing list
>>> codecraft at or8.net <mailto:codecraft at or8.net>
>>> http://or8.net/mailman/listinfo/codecraft <http://or8.net/mailman/listinfo/codecraft>
>> 
>> 
>> _______________________________________________
>> codecraft mailing list
>> codecraft at or8.net <mailto:codecraft at or8.net>
>> http://or8.net/mailman/listinfo/codecraft <http://or8.net/mailman/listinfo/codecraft>
>> 
>> 
>> _______________________________________________
>> codecraft mailing list
>> codecraft at or8.net <mailto:codecraft at or8.net>
>> http://or8.net/mailman/listinfo/codecraft
> 
> _______________________________________________
> codecraft mailing list
> codecraft at or8.net
> http://or8.net/mailman/listinfo/codecraft

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://or8.net/pipermail/codecraft/attachments/20151123/c9f7e003/attachment-0001.html>


More information about the codecraft mailing list