News for hackers. Stuff that matters.
Re:Yammer moving from Scala to Java by frio on Tuesday November 29, 2011 @07:49PM (#3293109)
The big problem I had with Scala, and the reason I stopped actively developing in it months back, was its similarity to Perl's philosophy: there are too many ways to skin the same apple. Problems can be resolved functionally, imperatively, or in some (inevitably, when you come back to work on it, hard to follow) hybrid of the two; unless you set down clear restrictions and code guidelines, one man's Scala is entirely different to the next's.

I initially liked the expressivity the language afforded (and some of the supporting ecosystem - sbt, specs - I found extremely impressive), but came to abhor it over time. Unfortunately, after maintaining legacy Perl applications I've developed an aversion to anything that doesn't follow the Zen of Python: "There should be one-- and preferably only one --obvious way to do it."

Re:Yammer moving from Scala to Java by dustingetz on Tuesday November 29, 2011 @08:25PM (#3293210)

  > I've developed an aversion to anything that doesn't 
  > follow the Zen of Python: "There should be one-- and 
  > preferably only one --obvious way to do it."
this is an interesting argument. but surely, given enough rope, a non-expert can hang himself in any language. I'm starting to wonder that all these language X vs language Y problems are really a matter of the skills of the team matched with the difficulty of the problem. joe bloe's blog needs beginner skills with python. embedded wireless systems need experts and C/asm, nuclear control systems are prototyped by experts in haskell. bigcos need large teams of average skill with Java, but as they are driven to become more competitive, perhaps they will turn to small teams of experts using scala.
Re:Yammer moving from Scala to Java by frio on Tuesday November 29, 2011 @08:46PM (#3293265)
> surely, given enough rope, a non-expert can hang himself in any language

I completely agree, and sometimes productivity absolutely demands that developers become more expressive. I've found Java overly restrictive in the past, and have spent time learning Python, Haskell and other languages (and seen decent increases in productivity when I feel less fettered by the language I'm programming in). That said, I've also come to appreciate the effect of more restrictive languages: readability and long-term maintainability. Coming back to old code can always be jarring; having to maintain decade-old Perl written in a variety of different styles was maddening.

While you can screw up in anything, it's worth appreciating that more expressive languages effectively hand you more "rope" :).

Re:Yammer moving from Scala to Java by draegtun on Wednesday November 30, 2011 @09:00AM (#3295014)
> having to maintain decade-old Perl written in a variety of different styles was maddening.

Interesting... I wonder how many languages can still run a decade old program?

This shows both the strength and weakness of Perl in that...

i) It has excellent backward compatibility

ii) So no one is forced to improve or update the program (over time) :(

Re:Yammer moving from Scala to Java by reginaldo on Tuesday November 29, 2011 @09:37PM (#3293397)
nuclear control systems are prototyped by experts in haskell

Do you have any source to back that (honest question)?

Re:Yammer moving from Scala to Java by fpgeek on Tuesday November 29, 2011 @10:20PM (#3293516)
It might be a pun referencing Atom ( http://hackage.haskell.org/package/atom-1.0.11 ) which is used for control systems, but not nuclear ones, AFAIK
Re:Yammer moving from Scala to Java by wtracy on Wednesday November 30, 2011 @06:00AM (#3294634)
I honestly suspect that kind of stuff is more likely to be done in Ada.
Re:Yammer moving from Scala to Java by gtani on Wednesday November 30, 2011 @12:34AM (#3293897)
not a nuclear control system, but embedded monitor (slide 26:

http://www.galois.com/~leepike/fm-galois.pdf

Re:Yammer moving from Scala to Java by dustingetz on Wednesday November 30, 2011 @12:52AM (#3293954)
nah, no sources, but its the quintessential application of haskell
Re:Yammer moving from Scala to Java by spaznode on Tuesday November 29, 2011 @10:13PM (#3293504)
C. For the non-control and more fucking your shit up systems
Re:Yammer moving from Scala to Java by rayiner on Tuesday November 29, 2011 @11:20PM (#3293698)
It's easy to blame the user, but the fact is that there are languages designed in good taste and languages designed in bad taste. I'd argue C++ is an example of the latter, with its panoply of awkward non-orthogonal features. It's quite possible that Scala is too, and that it's not just the user's fault.
Re:Yammer moving from Scala to Java by soc88 on Wednesday November 30, 2011 @10:40AM (#3295343)
I'd consider that Scala is pretty much on the “good taste” side.

The features are very orthogonal and thought-out and much of the old legacy cruft is removed.

Re:Yammer moving from Scala to Java by bad_user on Wednesday November 30, 2011 @11:55AM (#3295676)
I don't know how you can consider Scala's features as being orthogonal.
Re:Yammer moving from Scala to Java by soc88 on Wednesday November 30, 2011 @02:36PM (#3296498)
Because I actually have used it, which separates me from “experts” like Colebourne.
Re:Yammer moving from Scala to Java by drivebyacct2 on Tuesday November 29, 2011 @08:45PM (#3293262)
The difference is how easy a language makes it to hang ones self, or how many ropes are lying around to do it with. I think the article touches on it aptly. It's not so much a fault of the language (one can debate the semantics of it), so much as it is an outcome of greater-than n-sized (where n is 1, 2, maybe 3) non-high-expert-Scala-users teams. The lack of an easy to grok idiomatic way of writing code is hard on a team. It bothers me when I write code and don't know the idiomatic way of doing it, and I'll often solicit feedback and rewrite it just for my own sake (really, on code that no one else will ever really see or touch).
Re:Yammer moving from Scala to Java by liquidcool on Tuesday November 29, 2011 @09:10PM (#3293326)
I spent a while in Perl and tend to agree, I was the only one in my group who went out of his way to write readable/maintainable code. Everyone else believed in extreme code ownership and enjoyed playing "golf".

I've never coded in Python, but spent a little time in Ruby and liked how they knew you could do things many different ways, so the community and leadership focused on identifying and promoting idioms. I think that's a key factor in adoption. Perl had some of that (and the excellent "Effective Perl" had a chapter on it), but you need to make it part of your culture.

Re:Yammer moving from Scala to Java by draegtun on Wednesday November 30, 2011 @07:56AM (#3294861)
> so the community and leadership focused on identifying and promoting idioms. I think that's a key factor in adoption. Perl had some of that (and the excellent "Effective Perl" had a chapter on it), but you need to make it part of your culture.

Yes it does need to be part of your culture. And there is no reason for a Perl team/shop not to because best practise idioms are heavily preached [1] and baked into [2] Perl and its community.

[1] Modern Perl movement & Perl Best Practises (http://en.wikipedia.org/wiki/Perl_Best_Practices)

[2] Perl::Critic (https://metacpan.org/module/Perl::Critic), Moose (http://moose.perl.org), EPO extended core (http://www.enlightenedperl.org/extendedcore.html), etc

Re:Yammer moving from Scala to Java by spaznode on Tuesday November 29, 2011 @08:34PM (#3293234)
Python has been by far the most straightforward and easy language for me to pick up and just code and also read out of anything I can remember. Not that I use it a whole lot, it's still beautiful to me.
Re:Yammer moving from Scala to Java by thurn on Tuesday November 29, 2011 @08:25PM (#3293209)
This is a fair complaint, but doesn't Python let you mix functional and imperative styles just as much?
Re:Yammer moving from Scala to Java by frio on Tuesday November 29, 2011 @08:49PM (#3293274)
It does, but the point is that with Python there's generally one "obvious" way of accomplishing something. With Scala, I found when tackling certain problems (and my memory is fuzzy here; like I said, it's been several months :)), no particular solution stuck out as obvious. I'd consider myself fairly expert in Python now, so it may well be that what I see as obviousness may well be (reasonably) deep domain knowledge... but I didn't find the curve with Python anywhere near as steep as Scala's.
Re:Yammer moving from Scala to Java by code_duck on Wednesday November 30, 2011 @04:32AM (#3294414)
It's not nearly as ingrained into the language as Scala. Python's functional tools are rather basic. My understanding is that Guido believed that adding too much functional style to Python risked making the language muddled, exactly as we're discussing. A prime guideline for the language has always been (from the Zen of Python):

> There should be one-- and preferably only one --obvious way to do it.

http://fold.sigusr2.net/2010/03/guido-on-functional.html

http://python-history.blogspot.com/2009/04/origins-of-python...

has some notes on the history of functional tools in Python, though not much reasoning.

> Curiously, the map, filter, and reduce functions that originally motivated the introduction of lambda and other functional features have to a large extent been superseded by list comprehensions and generator expressions.

Re:Yammer moving from Scala to Java by chromatic on Tuesday November 29, 2011 @08:06PM (#3293162)
unless you set down clear restrictions and code guidelines

What happened when you tried?

Re:Yammer moving from Scala to Java by frio on Tuesday November 29, 2011 @08:51PM (#3293277)
I was using Scala on some lone projects as prototypes, working with at most one other developer. In the end, we decided against it; there was never a chance to set down such guidelines (which I'm sure would be effective). The spectre of our Perl codebase was too much, sadly.
Re:Yammer moving from Scala to Java by rjbond3rd on Tuesday November 29, 2011 @10:26PM (#3293539)
> The spectre of our Perl codebase was too much, sadly.

Just curious, though -- was that Perl codebase written and factored correctly, or was it already a big mess when you got it?

Re:Yammer moving from Scala to Java by dthakur on Tuesday November 29, 2011 @08:28PM (#3293225)
Compared to Perl though, thankfully in Scala you do have a static type system to protect you from going too crazy.
Re:Yammer moving from Scala to Java by jronkone on Wednesday November 30, 2011 @03:09AM (#3294256)
> I've developed an aversion to anything that doesn't follow the Zen of Python: "There should be one-- and preferably only one --obvious way to do it."

Ok, so which language(s) are you using then?

Re:Yammer moving from Scala to Java by lloeki on Wednesday November 30, 2011 @07:39AM (#3294826)
ZoP doesn't say that there should be only one way to do something, it say there should be one obvious way to do it. That doesn't preclude alternate, equally or - preferably - less obvious ways. Many languages could stand close to that aphorism.