Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I liked most of it. But when it came to this atmosphere stuff, it was vietnam all over again!

What's wrong with those Scala developers?

They could make beautiful frameworks and APIs, always start to create crazy method names.

> "org.scalatra" %% "scalatra-atmosphere" % "2.2.1",

> send(("author" -> "system") ~ ("message" -> "Only json is allowed") ~ ("time" -> (new Date().getTime.toString )))

What's wrong with them?!



Same symptom is shown in Haskell circles. I suspect it might be due to the enthusiasts of these languages often being mathematicians. And mathematicians love crazy sigils, as we know.


probably :\

And this is rather sad.

You got a language which allows you to write nearly litteral code and still build stuff only mathematicans can understand.


yah they should've done something like:

    send(JSONSerialization.with(StringSerializer.class, DateTimeSerializer.class).serialize(JSONObjectFactory.put(PairFactory.of(String.class, String.class).getInstance("author", "system"), PairFactory.of(String.class, String.class).getInstance("message", "Only json is allowed"), PairFactory.of(String.class, DateTime.class).getInstance("time", new Date())).getInstance()))
no, it's just json4s dsl for constructing json. If you wanted, you could've used constructors yourself:

    send(pretty(render(JObject(List(JField("author", JString("system")), JField("message", JString("Only json allowed")), JField("time", JString(new DateTime().getTime().toString()))))
usually scala libraries come with an easy to read/write DSL version of the API along with a more verbose java-style API shown above. Many libraries don't document with a plenty of examples. But, it really takes 10 minutes to learn DSL version in many cases. And, it gives you wings. There are plenty of benefits of DSL. You can research online about them.


I hate the Java style as much as this nonsense-operator-like-function-name style of Scala.

Why do they have to name them ~ % %%, if they can name them ANYTHING. Just to make the writing shorter?

It's like using variable names like a, b, c, data, value etc.

I want readable code, not short code by hook or by crook...


operators like +, -, /, %, ^, ... read much better once you learn their meanings and how to use them.

it's okay to learn things.




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

Search: