News for hackers. Stuff that matters.
Re:Is Scala really more complicated than Java? by plinkplonk on Friday September 18, 2009 @12:41PM (#830585)
"ML type inferencer in Scala is great when it works (in simple situations) but it is a headache to figure out _why_ it causes problems in the cases when type inference doesn't work as intended."

I've heard this many times. I think learning some formal type theory might help. It worked for me, helping me get my head around Haskell and make sense of type error messages.

Re:Is Scala really more complicated than Java? by osipov on Friday September 18, 2009 @01:25PM (#830673)
"learning some formal type theory might help" -- understanding formal type theory is not a prereq for understanding Java. If you are you suggesting that knowledge of formal type theory is needed to be an effective Scala programmer, then as I pointed out, Scala is more complex than Java.
Re:Is Scala really more complicated than Java? by plinkplonk on Friday September 18, 2009 @01:34PM (#830693)
@osipov

" then as I pointed out, Scala is more complex than Java."

I didn't comment (either way) on this.

I was just trying to say learning type theory worked well for me when I was learning languages with powerful type systems (Haskell in my case), especially in understanding type errors. It may or may not work for you. It is just an experience report/suggestion.

I don't care if Scala is more complex than Java or not. Apologies if you thought I was making a claim to that effect.

Re:Is Scala really more complicated than Java? by osipov on Friday September 18, 2009 @01:58PM (#830747)
No apologies needed, I thought your comment about learning formal type theory and your book recommendation were valuable. My comment was based on the premise of this thread (per the title) and the premise of the article.
Re:Is Scala really more complicated than Java? by joe_the_user on Friday September 18, 2009 @07:41PM (#831406)
An interesting thing about this article is it makes me think about just how natural the english-fragments within mainstream (c-like) languages are.

Loosely speaking, a c-like English would be: "For each tree in the grove, paint on the stem"

But what would a Scala-like sentence be??? "trees in the grove - paint circles on their stems"???

Re:Is Scala really more complicated than Java? by rincewind on Saturday September 19, 2009 @04:38AM (#831795)
That might show that idioms from C got into your english, not the other way round:

"For every cookie in the jar; I ate that cookie" vs. "I ate all the cookies from the cookie jar" vs. "The cookie jar is empty"

(the last one assumes that the cookie jar was type-safe and contained nothing but cookies)

Re:Is Scala really more complicated than Java? by silentbicycle on Saturday September 19, 2009 @01:12PM (#832140)
Using something that requires you to understand a couple big ideas ("formal theory", as you put it) is usually a lot less complex than using something that doesn't, but requires you to remember a bunch of inconsistencies and exceptions to rules. It's easier to remember concepts than details.

I haven't used Scala, but it's certainly a more general rule. Prolog or Make, for example, are damn simple once you understand the model they're based on - they're just fundamentally different from (say) Java or Python. Make has a reputation of being weird and complicated* because people assume its complexity adds to whatever model they're familiar with, but actually it replaces it entirely. Once you understand make's underlying model, everything you need to know to use it would comfortably fit on one page.

* Except the GNU make extensions added to bend gmake into a more 'conventional' tool / make it work with the autotools. The original, non-GNU make is vastly simpler. (Same with gawk vs. regular awk.)

Re:Is Scala really more complicated than Java? by yosh on Saturday September 19, 2009 @04:32PM (#832305)
"make it work with the autotools" ? The auto* family of tools have a ton of complexity to make things work with non-GNU tools. Automake would be vastly simpler if there wasn't the specific design goal of working with non-GNU make.
Re:Is Scala really more complicated than Java? by silentbicycle on Saturday September 19, 2009 @06:14PM (#832385)
That didn't come out right - I meant that sometimes people get the impression that make is incredibly complex because they look at makefiles generated by the autotools. Those makefiles are typically very different from hand-written ones.
Re:Is Scala really more complicated than Java? by yosh on Saturday September 19, 2009 @07:35PM (#832452)
Those makefiles wouldn't have to be as complex if automake only targeted GNU make. A lot of the messiness is there to support conditionals.
Re:Is Scala really more complicated than Java? by silentbicycle on Saturday September 19, 2009 @08:04PM (#832495)
That's because conditionals are implicit in the underlying selection of targets. Trying to force explicit conditionals into the language gets cumbersome and ugly. You don't see explicit 'if's in Prolog, either.
Re:Is Scala really more complicated than Java? by yosh on Saturday September 19, 2009 @08:15PM (#832509)
I disagree. Writing multiplatform makefiles without explicit conditionals is cumbersome and ugly, mainly because the problem space contains so many exceptions. In this case, purism isn't really practical.
Re:Is Scala really more complicated than Java? by barrkel on Friday September 18, 2009 @12:49PM (#830604)
Unfortunately, many many essays have been written attempting to describe e.g. monads, which are actually a really simple concept, just very abstract.

The evident difficulty the general programming public has had getting to grips with even this topic would make me pessimistic as to the efficacy of your advice.

Re:Is Scala really more complicated than Java? by plinkplonk on Friday September 18, 2009 @12:53PM (#830611)
That is why I said formal type theory (which is very different from describing monads in the essays for the "general programming public").

Working through Pierce's book "Types And Programming Languages" (aka TAPL) is more what I had in mind. It is very clearly written and not that difficult(I have no formal Computer Science education and had no trouble with the book).

Monads aren't really very difficult when learned from the Type Theory perspective (vs from weird essays comparing them to elephants, space stations and so on).

I was specifically addressing this bit.

" but it is a headache to figure out _why_ it causes problems in the cases when type inference doesn't work as intended"

In my experience, knowing basic type theory helps this "figuring out" process.

'would make me pessimistic as to the efficacy of your advice.'

Fair Enough! I just posted what worked for me. YMMV :-)