News for hackers. Stuff that matters.
Re:Help me sort out the meaning of “{}” as a constructor arg... by bitL on Tuesday November 22, 2016 @01:07PM (#13016020)
You'll go from bad to worse; Scala is to Java what C++ is to C; barely anyone understands all constructs in either language. You either know everything or nothing (i.e. you can't understand somebody else's code unless you enforce rules or know the complete language in detail).
Re:Help me sort out the meaning of “{}” as a constructor arg... by edblarney on Tuesday November 22, 2016 @01:50PM (#13016413)
I think this comment is fair, but could be misinterpreted.

Scala allows you to do the same thing in many different ways, and with operator overloading ... the approach you chose to coding defines almost a 'custom syntax' for a project.

Which makes it very hard to read sometimes - you have to infer the 'style' before you can get too far.

To be fair - that's a different kind of 'inconvenience' than C++ from C - but the comparison is pragmatically valid.

Re:Help me sort out the meaning of “{}” as a constructor arg... by astral303 on Tuesday November 22, 2016 @03:03PM (#13017139)
Exactly, the "custom syntax" is the problem.

The problem is that Scala seems to attract the same type of thinking as C++, where there is a culture that rewards obscure, bizarre syntax.

I mean, why is it an exclamation mark to send messages to actors in Akka?

I need to write code to get things done. I want to spend minimal time figuring out bizarre operator-overloaded library syntax.

Re:Help me sort out the meaning of “{}” as a constructor arg... by edblarney on Tuesday November 22, 2016 @03:34PM (#13017413)
"I need to write code to get things done. "

Yes. But their cultures are a little different.

C++ I think is 1/2 academic, 1/2 Engineering - with a lot of voices, and a lot of anachronistic 'grey beards' arguing over stuff. Even for Java, James Gosling said 'Sun less less a company than it is a debating society'.

Scala is almost purely academic - but driven by a single person / small team. Scala was not designed to solve an Engineering problem, thus it seems a little 'intellectually masturbatory' (pardon the term).

Scala is way to hard to learn - partly because it's a 'new paradigm' but partly for the reasons aforementioned. So it's only going to make it's way into production for specific entities.

Scala may have a 'big future' if tutorials, training and approaches settle down on commonly accepted standards and practices.

Re:Help me sort out the meaning of “{}” as a constructor arg... by walkingolof on Tuesday November 22, 2016 @04:24PM (#13017802)
Scala is increasingly used in projects that underpin allot of todays infrastructure, for example Kafka, Spark, Akka and Finagle.
Re:Help me sort out the meaning of “{}” as a constructor arg... by edblarney on Tuesday November 22, 2016 @04:46PM (#13017956)
I don't doubt at all that Scala is 'industrial grade tech' and is theoretically capable of supporting even banks.

But it's not going to go mainstream because the alternatives are far more accessible.

The examples you mentioned are relative small. You know what's big? Walmart. WellsFargo. Honeywell. Novartis.

I don't think 'it will be a while' before Scala gets into those shops, I think it will be 'never' unless there is a change to how Scala is presented. As of 2016, it's still a little academic and cliquish.

Though I predict some things will change and it might gain popularity.

Re:Help me sort out the meaning of “{}” as a constructor arg... by premium-concern on Tuesday November 22, 2016 @06:07PM (#13018487)
> theoretically capable of supporting even banks

https://scala.epfl.ch/

> The examples you mentioned are relative small. You know what's big? Walmart. WellsFargo. Honeywell. Novartis.

https://www.lightbend.com/resources/case-studies-and-stories...

https://www.lightbend.com/resources/case-studies-and-stories...

https://medium.com/@kvnwbbr/transitioning-to-scala-d1818f25b...

Re:Help me sort out the meaning of “{}” as a constructor arg... by edblarney on Tuesday November 22, 2016 @11:51PM (#13020137)
Yeah - that's a lot of links for one point - Wallmart.ca.

Which is cool, and doesn't surprise me.

But I don't see the trend lines of Scala heading in the direction they need to be in such that it becomes and incumbent language.

I don't see it as having enough disruptive power to break into the Javascript/C/C++/Java or even C# club.

My own experience is with Scala is that there is just way, way to much 'change' for some added value.

I wish they could make some tweaks to Java to incorporate some elements of Functional programming and I would be happy.

And before you blow up, it's possible to mix both styles, obviously Scala itself is an example of that.

A specific example: a lot of FP comes along with how collections, lists, maps etc. are managed and used. Lodash/underscore provides a lot of that for JS and makes a lot of JS 'functional-like'. If Java had such libraries with the mechanisms to use them (first class functions - Lambda's are not quite that) - then Java would be a lot better. Anyhow - to get the 'good things' about FP I don't think you need an entirely new linguistic paradigm.

Re:Help me sort out the meaning of “{}” as a constructor arg... by bitL on Tuesday November 22, 2016 @03:21PM (#13017309)
Fun like this:

http://www.flotsam.nl/dispatch-periodic-table.html

When I was a teenager, it was fun to do that in C++ until I realized everybody thought it was fun but their version of fun wasn't compatible with my version of fun.

Re:Help me sort out the meaning of “{}” as a constructor arg... by premium-concern on Tuesday November 22, 2016 @06:12PM (#13018513)
If all you found was an old API from half a decade ago that doesn't even exist anymore, than I think that's a pretty good case for Scala.
Re:Help me sort out the meaning of “{}” as a constructor arg... by bitL on Tuesday November 22, 2016 @08:31PM (#13019213)
That's irrelevant. Scala simply allows your coworker to go "off the rails", employing their creativity even to language constructs, and you either spend time to learn their way of thinking, set firm rules about what is allowed, or you are simply out of luck, like often with C++.
Re:Help me sort out the meaning of “{}” as a constructor arg... by walkingolof on Tuesday November 22, 2016 @02:38PM (#13016867)
Even if C++ have been the way I've earned money the past +20 years, I've programmed quite allot of Scala in my spare time. If find the language beautiful in its compact, expressive syntax, I also like the standard lib and the vibrant community. Being able to mix OO and functional programming, is also something I enjoy very much.

So being able to use this language as a system language, I very much look forward to.

But your mileage may vary.

Re:Help me sort out the meaning of “{}” as a constructor arg... by bitL on Tuesday November 22, 2016 @02:47PM (#13016965)
Sure, I use and like both of them. C++ for 3D graphics, Scala for Big Data. Yet I have seen so many things go wrong in both of them so my perspective is a bit different. Imagine if somebody redefines basic operators to mean something different, starts throwing int as exception in C++ or use templates with template parameters with number parameters and you have to figure out what exactly does this thing do? Or in Scala if somebody feels super clever and redefines half of the language by preparing some half-baked barely functioning DSL unable to compile a slightly different code than expected and you have to use it? It's the price you pay in both C++ and Scala for expressibility.
Re:Help me sort out the meaning of “{}” as a constructor arg... by jjnoakes on Wednesday November 23, 2016 @11:45AM (#13023796)
How is that different from using a C function called add_two_ints which deletes the root file system and returns 42?

I don't think it is possible to create a language that can prevent dumb code from being written.

Re:Help me sort out the meaning of “{}” as a constructor arg... by bitL on Wednesday November 23, 2016 @02:01PM (#13024878)
It's not about dumb code. Actually both C++ and Scala can allow you unbelievably clever code which is also super difficult to understand by somebody uninvolved. Remember how some Haskell guys were complaining they aren't able to understand the code they wrote at the top of their game anymore?
Re:Help me sort out the meaning of “{}” as a constructor arg... by jjnoakes on Thursday November 24, 2016 @12:02AM (#13028251)
Being too clever or too terse is possible in any language though. It is an education and experience problem, not a language problem.

Some languages may be slightly worse than others, but the root cause (and solution) is the same across the board.

Re:Help me sort out the meaning of “{}” as a constructor arg... by paulddraper on Tuesday November 22, 2016 @03:51PM (#13017542)
That comparison is unfair.

For starters, there's not the syntactic ambiguity (or at least human uncertainty) found so often in C++.

There may be language complexity, e.g. how visibility interoperates can be difficult in weird cases. But I can at least parse it.

Re:Help me sort out the meaning of “{}” as a constructor arg... by lmm on Tuesday November 22, 2016 @04:57PM (#13018036)
Not my experience at all. There are a lot of dense one-liners in Scala but they tend to be the result of combining several orthogonal features in one place; the set of fundamental constructs is quite small and you can learn them pretty quickly, at which point as long as you're willing to keep calm, take your time, and read the one-liner like it's the five or ten lines it would be in other languages, you'll be fine.
Re:Help me sort out the meaning of “{}” as a constructor arg... by premium-concern on Tuesday November 22, 2016 @01:40PM (#13016338)
I'd say this is blatant non-sense usually coming from people who lack any kind of experience in C++, Scala or both.
Re:Help me sort out the meaning of “{}” as a constructor arg... by bitL on Tuesday November 22, 2016 @01:45PM (#13016382)
OK. Enjoy your ignorance then.
Re:Help me sort out the meaning of “{}” as a constructor arg... by premium-concern on Tuesday November 22, 2016 @06:17PM (#13018549)
I'm not the one being ignorant. See your other comment where you have been flat-out misinformed.