White Elefant

Hi,

I am a lot older that most of you out there and I have seen a lot of changes in computing in general. I was a Java programmer and trainer.
I am now looking at Scala and functional programming but I am now really doubting much that has been said about this language and the use of functional language.

Industry simplifies tools and process with time in all walks of life. It doesn't complicate them and doesn't lend to complicating the processes.
Copernicus  displaced the earth centric ideas; Quantum displaces or enhances Newtonian, Euclidean models. Every model is simpler.
Scala is the opposite. Now you are relying on very talented programmers who have to limit their semantics to make programs work.
The very power that leverage's Scala is its weakness, because to test it, is almost impossible and very difficult.
It relies on good programming practise  to write good programs. Even syntactically it is untidy.
This has not been the trend in software. The trend is to make it more simple, robust and hopefully more error free.
Scala with lazy evalution and psuedofuntional programming opens a minefield that will cost in production and in maintenance.
Even the code will have to take into account the behaviour of tail end recursion and optimising strategies. This should be done by the compiler, and run time virtual machines and with hooks into the OS.
Surely this should be transparent to any programming language.

OO simplifies the real domain model to the machine image. Scala does not.

I think most Scala will be unmaintainable and unpredictable.

The future will see programming languages change but Scala isn't going to be one of them. Compilers, virtual machines and therefore ultimately the OS will do some of the work to make programming easier with multi threading and multi core.
Think about parallel communication which is now replaced with a simple serial interface. Things get simpler not more elaborate.

Why is it popular. Because academics want to have an interesting time but are not really interested in real world problems. Every one thinks its going to be the paradigm shift like OO was to procedural; it  never will be.
Students think it cool or clever to do it. So is chess but for the most wont provide bread and butter on the table.  Its a dangerous fad that will produce horrible code like concrete did with architecture in the 1960´s.

Very, very sceptical.

Lunalobo

Re: Re: White Elefant



On Wed, Oct 26, 2011 at 4:48 PM, Ittay Dror <ittay [dot] dror [at] gmail [dot] com> wrote:



martin odersky wrote:


On Wed, Oct 26, 2011 at 3:57 PM, Ittay Dror <ittay [dot] dror [at] gmail [dot] com> wrote:



martin odersky wrote:
For a great counter-argument to the original post, see:

  http://www.youtube.com/watch?v=6RwrT6N43lY

(since we're on the debate list...)

You only show that there is a child that can understand Scala. For this to be a counter-argument, you need to show that there are more children that can understand Scala than those that get Java.

  Oh, I know lots more children (see recent Kojo story, and also people I know privately). But they don't have youtube videos :-).

I firmly believe that Scala is easier to learn than Java. For a starter: public static void main( String[] args) what?

I think you view this from the "spec" point of view. Has this definition of 'main' ever cause tricky bugs? Made code harder to write or change?

No, I mean if I have to teach hello world, compare

  object Hello extends App {
    println("hello world!")
  }

to its Java equivalent. How much do you have to explain? Or can you get away with saying: these are incantations that you just need to write, not understand? What feeling does that give to a newbie?
 
And that even leaves aside the Scala REPL, which is a fantastic tool for learning.

The main problem that I see is that the Scala community as a whole sometimes overcomplicates things.

Hence my suggestion for 'idiomatic' approach a-la python.

See this for example: http://stackoverflow.com/questions/7852471/idiomatic-construction-to-check-whether-a-collection-is-ordered
Runar answered with a post containing semigroups and traverse, pointing to a haskell paper
I answered with a solution using iteratees, which is no better
The best solution IMHO was: (l, l.tail).zipped.forall(_ <= _) (by missingfaktor)

yes, that one's nice.
 

A newbie should have a rich resource of such snippets instead of finding answers about traverse/iteratee which are harder to learn, read and more code to write.

 
Could not agree more.

Cheers

 -- Martin

Re: Re: White Elefant

On Wed, Oct 26, 2011 at 8:00 AM, martin odersky <martin [dot] odersky [at] epfl [dot] ch> wrote:
No, I mean if I have to teach hello world, compare

  object Hello extends App {
    println("hello world!")
  }

to its Java equivalent. How much do you have to explain? Or can you get away with saying: these are incantations that you just need to write, not understand? What feeling does that give to a newbie?

Not to belabor this particular point, but yes, there is just as much to explain to a beginner about the example above ("object", "extends" and "App", and what's in App, and how come the example doesn't work if you forget to extend, etc...) as with Java's main.
And of course, the right way of doing it in both cases is: we'll explain these in turn, let's just focus on println() for now.
It's the same thing when you learn to drive: you sit down behind the wheel and there are many things that you can ignore at first. It's a perfectly normal learning process.
-- Cédric


Re: Re: White Elefant



2011/10/26 Cédric Beust ♔ <cedric [at] beust [dot] com>
On Wed, Oct 26, 2011 at 8:00 AM, martin odersky <martin [dot] odersky [at] epfl [dot] ch> wrote:
No, I mean if I have to teach hello world, compare

  object Hello extends App {
    println("hello world!")
  }

to its Java equivalent. How much do you have to explain? Or can you get away with saying: these are incantations that you just need to write, not understand? What feeling does that give to a newbie?

Not to belabor this particular point, but yes, there is just as much to explain to a beginner about the example above ("object", "extends" and "App", and what's in App, and how come the example doesn't work if you forget to extend, etc...) as with Java's main.

I definitely disagree with that. 
class    -- need to explain what a class is, and why Hello is not really one (because no instances are ever created)public   -- need to explain privacy levels  static    -- what the heck is that?void      -- void???main     OK, I might get thatString[] -- need to explain irregular array syntaxargs     -- need to explain command line arguments
Compare that to:
object Hello   -- need to explain what objects are, it's definitely simpler than classes!extends App -- need to explain that Hello an instance of an `App', i.e. something that can be run.
That's all. It's no contest really. The only way you could claim that java is as simple is if you take everything in Java for granted. I guess I have started working with Java earlier than you have, and I can tell you that for teaching the Hello world problem was a big deal. It eventually went away once everyone took Java for granted. But that does not mean that the problem does not exist, only that we do not see it anymore.
Cheers
 -- Martin 

Re: Re: White Elefant

I have to agree with that.

I had the pleasure to try to teach java to a mixture of complete
programming newbies and old school C and COBOL programmers about a
decade ago, when I could not find better work due to the end of the
dotcom boom. It was quite an interesting experience.

Obviously I would start with a standard hello world program. The
amount of concepts you have to explain for the simple hello world
program is staggering. And then you always had so many exceptions.
Everything is an object. Except primitive types, which are not. This
wouldn't be so bad if primitives were some obscure part of the
language that you could ignore in the beginning. But they are pretty
much the first thing people will be confronted with.

Then you have to explain that all functions are part of an object, and
you have another exception for static methods. Again, this is not
something you can delay explaining, because the very first method
people are confronted with is a static method.

I ended up telling people that they should just ignore the noise and
that I would explain it later, but that is not very satisfactory from
a teaching point of view. The C and COBOL programmers would obviously
understand static fields and methods and immediately go to work,
ignoring all that newfangled object oriented stuff.

I think it would be quite interesting to try to teach scala to a
complete programming newbie without any java or C baggage. I could try
with my son, but I guess 11 months is a bit early... :-)

cheers

Rüdiger

2011/10/26 martin odersky :
>
>
> 2011/10/26 Cédric Beust ♔
>>
>> On Wed, Oct 26, 2011 at 8:00 AM, martin odersky
>> wrote:
>>>
>>> No, I mean if I have to teach hello world, compare
>>>
>>>   object Hello extends App {
>>>     println("hello world!")
>>>   }
>>>
>>> to its Java equivalent. How much do you have to explain? Or can you get
>>> away with saying: these are incantations that you just need to write, not
>>> understand? What feeling does that give to a newbie?
>>
>> Not to belabor this particular point, but yes, there is just as much to
>> explain to a beginner about the example above ("object", "extends" and
>> "App", and what's in App, and how come the example doesn't work if you
>> forget to extend, etc...) as with Java's main.
>
> I definitely disagree with that.
> class    -- need to explain what a class is, and why Hello is not really one
> (because no instances are ever created)
> public   -- need to explain privacy levels
> static    -- what the heck is that?
> void      -- void???
> main     OK, I might get that
> String[] -- need to explain irregular array syntax
> args     -- need to explain command line arguments
> Compare that to:
> object Hello   -- need to explain what objects are, it's definitely simpler
> than classes!
> extends App -- need to explain that Hello an instance of an `App', i.e.
> something that can be run.
> That's all. It's no contest really. The only way you could claim that java
> is as simple is if you take everything in Java for granted. I guess I have
> started working with Java earlier than you have, and I can tell you that for
> teaching the Hello world problem was a big deal. It eventually went away
> once everyone took Java for granted. But that does not mean that the problem
> does not exist, only that we do not see it anymore.
> Cheers
>  -- Martin
>
>

Re: Re: White Elefant

In my experience, COBOL programmers had an easier time understanding Scala than Java.

On Thu, Oct 27, 2011 at 10:13 AM, Rüdiger Klaehn <rklaehn [at] googlemail [dot] com> wrote:
I have to agree with that.

I had the pleasure to try to teach java to a mixture of complete
programming newbies and old school C and COBOL programmers about a
decade ago, when I could not find better work due to the end of the
dotcom boom. It was quite an interesting experience.

Obviously I would start with a standard hello world program. The
amount of concepts you have to explain for the simple hello world
program is staggering. And then you always had so many exceptions.
Everything is an object. Except primitive types, which are not. This
wouldn't be so bad if primitives were some obscure part of the
language that you could ignore in the beginning. But they are pretty
much the first thing people will be confronted with.

Then you have to explain that all functions are part of an object, and
you have another exception for static methods. Again, this is not
something you can delay explaining, because the very first method
people are confronted with is a static method.

I ended up telling people that they should just ignore the noise and
that I would explain it later, but that is not very satisfactory from
a teaching point of view. The C and COBOL programmers would obviously
understand static fields and methods and immediately go to work,
ignoring all that newfangled object oriented stuff.

I think it would be quite interesting to try to teach scala to a
complete programming newbie without any java or C baggage. I could try
with my son, but I guess 11 months is a bit early... :-)

cheers

Rüdiger

2011/10/26 martin odersky <martin [dot] odersky [at] epfl [dot] ch>:
>
>
> 2011/10/26 Cédric Beust ♔ <cedric [at] beust [dot] com>
>>
>> On Wed, Oct 26, 2011 at 8:00 AM, martin odersky <martin [dot] odersky [at] epfl [dot] ch>
>> wrote:
>>>
>>> No, I mean if I have to teach hello world, compare
>>>
>>>   object Hello extends App {
>>>     println("hello world!")
>>>   }
>>>
>>> to its Java equivalent. How much do you have to explain? Or can you get
>>> away with saying: these are incantations that you just need to write, not
>>> understand? What feeling does that give to a newbie?
>>
>> Not to belabor this particular point, but yes, there is just as much to
>> explain to a beginner about the example above ("object", "extends" and
>> "App", and what's in App, and how come the example doesn't work if you
>> forget to extend, etc...) as with Java's main.
>
> I definitely disagree with that.
> class    -- need to explain what a class is, and why Hello is not really one
> (because no instances are ever created)
> public   -- need to explain privacy levels
> static    -- what the heck is that?
> void      -- void???
> main     OK, I might get that
> String[] -- need to explain irregular array syntax
> args     -- need to explain command line arguments
> Compare that to:
> object Hello   -- need to explain what objects are, it's definitely simpler
> than classes!
> extends App -- need to explain that Hello an instance of an `App', i.e.
> something that can be run.
> That's all. It's no contest really. The only way you could claim that java
> is as simple is if you take everything in Java for granted. I guess I have
> started working with Java earlier than you have, and I can tell you that for
> teaching the Hello world problem was a big deal. It eventually went away
> once everyone took Java for granted. But that does not mean that the problem
> does not exist, only that we do not see it anymore.
> Cheers
>  -- Martin
>
>



--
Viktor Klang

Akka Tech LeadTypesafe - Enterprise-Grade Scala from the Experts

Twitter: @viktorklang

Re: Re: White Elefant

2011/10/26 martin odersky <martin [dot] odersky [at] epfl [dot] ch>


2011/10/26 Cédric Beust ♔ <cedric [at] beust [dot] com>
On Wed, Oct 26, 2011 at 8:00 AM, martin odersky <martin [dot] odersky [at] epfl [dot] ch> wrote:
No, I mean if I have to teach hello world, compare

  object Hello extends App {
    println("hello world!")
  }

to its Java equivalent. How much do you have to explain? Or can you get away with saying: these are incantations that you just need to write, not understand? What feeling does that give to a newbie?

Not to belabor this particular point, but yes, there is just as much to explain to a beginner about the example above ("object", "extends" and "App", and what's in App, and how come the example doesn't work if you forget to extend, etc...) as with Java's main.

I definitely disagree with that. 
class    -- need to explain what a class is, and why Hello is not really one (because no instances are ever created)public   -- need to explain privacy levels  static    -- what the heck is that?void      -- void???main     OK, I might get thatString[] -- need to explain irregular array syntaxargs     -- need to explain command line arguments
Compare that to:
object Hello   -- need to explain what objects are, it's definitely simpler than classes!extends App -- need to explain that Hello an instance of an `App', i.e. something that can be run.
That's all. It's no contest really. The only way you could claim that java is as simple is if you take everything in Java for granted. I guess I have started working with Java earlier than you have, and I can tell you that for teaching the Hello world problem was a big deal. It eventually went away once everyone took Java for granted. But that does not mean that the problem does not exist, only that we do not see it anymore.
Cheers
 -- Martin 

Isn't it funny how that works. After seeing the same thing for a while, out minds automatically filter it out. Like that box in the corner of the room, that I had intended to put away eventually. Now I don't even notice it. But visitors definitely do.

Someone could invent a programming language that requires the statement "Do not think about a pink elephant" on every other line, but after a while experienced users would not even notice it. Then some newbie would suggest removing it, and he would be scolded for trying to reinvent the language.

--Russ P.

--
http://RussP.us

Re: Re: White Elefant



Someone could invent a programming language that requires the statement "Do not think about a pink elephant" on every other line, but after a while experienced users would not even notice it. Then some newbie would suggest removing it, and he would be scolded for trying to reinvent the language.

You mean like Asterisk dialplans, with every line starting with exten => n, ? 

--Russ P.

--
http://RussP.us

Re: Re: White Elefant

2011/10/26 martin odersky <martin [dot] odersky [at] epfl [dot] ch>


I definitely disagree with that. 
class    -- need to explain what a class is, and why Hello is not really one (because no instances are ever created) public   -- need to explain privacy levels  static    -- what the heck is that?void      -- void???main     OK, I might get thatString[] -- need to explain irregular array syntaxargs     -- need to explain command line arguments

Maybe for someone who's never programmed in their life, but I bet that most people who started programming in Java had some prior exposure to C and/or C++, so I still think the description above is vastly overblown.
Either way, my original point stands: it's really no big deal to tell beginners to not pay attention to some details in the early stages.
-- Cédric

Re: Re: White Elefant

2011/10/26 Cédric Beust ♔ <cedric [at] beust [dot] com>

Maybe for someone who's never programmed in their life, but I bet that most people who started programming in Java had some prior exposure to C and/or C++, so I still think the description above is vastly overblown.

I seriously doubt that. That may have been true 15+ years ago, but Java (and C#) are being taught as a first language in high schools now. I know we were taught it and we had exactly the problems Martin described; lots of confused kids. Our teacher dismissed it as just magic that we needed to do regardless. My young cousin is being taught C# in his high school and he has exactly the questions Martin described.
Languages like Python and Scala (if used as a scripting language) let people drop the cruft and work their way up a shallower learning curve.

Re: Re: White Elefant

I think Scala aims at being simple.  Not being simple for java developers.   Long term vision here.
Scala isn't trying to replace Java, Scala is trying to *be a general purpose programming language on the JVM*.   The fact that a lot of folk are moving from Java to Scala is a sign of pain in Java that's causing the to move to Scala.   But let's get this straight:
Scala needs to attract the young generation more than the older generation for long term success.   If we can attract children, they'll be comfortable with Scala, hopefully some FP and it's a big win for education everywhere.   
Java was a *beast* to learn initially.  Lots of odd rules and strange behavior.  I was able to pick up Scala and even write a book on it.  With Java I had to read all the books first, to really 'get it'.  With Scala, things are *much* more consistent in the language so you can focus on the *hard things* like API design, how much abstraction to use and solving real world problems.
In Java, the language always got in the way.   A great example:  I just read through all of JGit's source.  While a well done Java project, the command line library really confused me for a bit until I saw all the magical reflection things happening with annotations.   In Scala I can just pattern match arguments, no need for get opt and friends.
Scala's in it for the long haul.   We need to think past Java.   In fact, in Pittsburgh at least, the competition is trying to get people to move to Scala from C#.  They've already left the JVM....
- Josh


2011/10/26 Cédric Beust ♔ <cedric [at] beust [dot] com>
2011/10/26 martin odersky <martin [dot] odersky [at] epfl [dot] ch>


I definitely disagree with that. 
class    -- need to explain what a class is, and why Hello is not really one (because no instances are ever created) public   -- need to explain privacy levels  static    -- what the heck is that?void      -- void???main     OK, I might get thatString[] -- need to explain irregular array syntaxargs     -- need to explain command line arguments

Maybe for someone who's never programmed in their life, but I bet that most people who started programming in Java had some prior exposure to C and/or C++, so I still think the description above is vastly overblown.
Either way, my original point stands: it's really no big deal to tell beginners to not pay attention to some details in the early stages.
--  Cédric

Re: Re: White Elefant

I agree Scala should be taught in high-school at least, and elementary school if possible. That is when young minds are really open to new things. Learning Scala then would also give many kids a better grounding in Mathematics, especially if they go on to University.

My personal experience with Java was that it was trivial to learn initially. This was because I was a long time C programmer, as well as C++ and Objective-C. Compared to C++ Java was trivial and made way more sense. Compared to Objective-C, it was just as neat and simple, but also had garbage collection, which was seriously missing in Objective-C.

Today I am increasingly getting frustrated with Java, but that is mostly because as I learn Scala better, when I am writing Java code I routinely know how I would do something in Scala, but I am at a loss of how to do it elegantly in Java.

Cheers, Eric


On 2011-10-26 6:01 PM, Josh Suereth wrote:
CAFLqJkyXx9m8P-R056CTPfcMcpnc4hWK5nRMGXaLKm4sZUogMg [at] mail [dot] gmail [dot] com" type="cite">I think Scala aims at being simple.  Not being simple for java developers.   Long term vision here.
Scala isn't trying to replace Java, Scala is trying to *be a general purpose programming language on the JVM*.   The fact that a lot of folk are moving from Java to Scala is a sign of pain in Java that's causing the to move to Scala.   But let's get this straight:
Scala needs to attract the young generation more than the older generation for long term success.   If we can attract children, they'll be comfortable with Scala, hopefully some FP and it's a big win for education everywhere.   
Java was a *beast* to learn initially.  Lots of odd rules and strange behavior.  I was able to pick up Scala and even write a book on it.  With Java I had to read all the books first, to really 'get it'.  With Scala, things are *much* more consistent in the language so you can focus on the *hard things* like API design, how much abstraction to use and solving real world problems.
In Java, the language always got in the way.   A great example:  I just read through all of JGit's source.  While a well done Java project, the command line library really confused me for a bit until I saw all the magical reflection things happening with annotations.   In Scala I can just pattern match arguments, no need for get opt and friends.
Scala's in it for the long haul.   We need to think past Java.   In fact, in Pittsburgh at least, the competition is trying to get people to move to Scala from C#.  They've already left the JVM....
- Josh


2011/10/26 Cédric Beust ♔ <cedric [at] beust [dot] com" rel="nofollow">cedric [at] beust [dot] com>
2011/10/26 martin odersky <martin [dot] odersky [at] epfl [dot] ch" target="_blank" rel="nofollow">martin [dot] odersky [at] epfl [dot] ch>


I definitely disagree with that. 
class    -- need to explain what a class is, and why Hello is not really one (because no instances are ever created) public   -- need to explain privacy levels  static    -- what the heck is that? void      -- void??? main     OK, I might get that String[] -- need to explain irregular array syntax args     -- need to explain command line arguments

Maybe for someone who's never programmed in their life, but I bet that most people who started programming in Java had some prior exposure to C and/or C++, so I still think the description above is vastly overblown.
Either way, my original point stands: it's really no big deal to tell beginners to not pay attention to some details in the early stages.
--  Cédric

Re: Re: White Elefant


2011/10/26 Josh Suereth <joshua [dot] suereth [at] gmail [dot] com>
Java was a *beast* to learn initially.  Lots of odd rules and strange behavior.

Obviously, everybody will have different experiences about the Java learning curve, but I can tell you that after ten years of a very grueling C++ career, Java felt like an immense breath of fresh air and it appeared so downright simple in pretty much all areas that I went through a constant stream of "This is so simple, why didn't anyone do it this way before?". About the syntax, the disappearance of the dichotomy header file/implementation file, the thread library, the standard collection and how simple they were compared to the STL, etc... It wasn't just the syntax, it was the whole platform.
A new language on the JVM will have to hit that mark if it wants to challenge Java's dominance.
-- Cédric





Re: Re: White Elefant

I Cannot comprehend this view. After more than 10 years of Java I stil don't feel like I understand the language in detail, i still feel like having a hand tied behind my back, I badly miss C++ (or did until scala came along)...
Yes... No header files, but the verbosity and lack of paradigms more than compensates for that... I also think my IQ dropped significantly because of the more typing than thinking needed in Java...
It's just how I feel and I know I'm in the minority on that, but still can't comprehend the opposite view...

Thanks,Razvan
On 2011-10-26, at 9:14 PM, Cédric Beust ♔ <cedric [at] beust [dot] com> wrote:


2011/10/26 Josh Suereth <joshua [dot] suereth [at] gmail [dot] com>
Java was a *beast* to learn initially.  Lots of odd rules and strange behavior.

Obviously, everybody will have different experiences about the Java learning curve, but I can tell you that after ten years of a very grueling C++ career, Java felt like an immense breath of fresh air and it appeared so downright simple in pretty much all areas that I went through a constant stream of "This is so simple, why didn't anyone do it this way before?". About the syntax, the disappearance of the dichotomy header file/implementation file, the thread library, the standard collection and how simple they were compared to the STL, etc... It wasn't just the syntax, it was the whole platform.
A new language on the JVM will have to hit that mark if it wants to challenge Java's dominance.
-- Cédric





Re: Re: White Elefant



2011/10/27 Cédric Beust ♔ <cedric [at] beust [dot] com>

2011/10/26 Josh Suereth <joshua [dot] suereth [at] gmail [dot] com>
Java was a *beast* to learn initially.  Lots of odd rules and strange behavior.

Obviously, everybody will have different experiences about the Java learning curve, but I can tell you that after ten years of a very grueling C++ career, Java felt like an immense breath of fresh air and it appeared so downright simple in pretty much all areas that I went through a constant stream of "This is so simple, why didn't anyone do it this way before?". About the syntax, the disappearance of the dichotomy header file/implementation file, the thread library, the standard collection and how simple they were compared to the STL, etc... It wasn't just the syntax, it was the whole platform.

I felt the same thing then.  And the platform has more than lived up to its initial promise. In fact it is a part of the platform's appeal that it allows languages different than Java to run well on it.

Cheers

-- Martin

Re: Re: White Elefant

2011/10/27 martin odersky :
> I felt the same thing then.  And the platform has more than lived up to its
> initial promise. In fact it is a part of the platform's appeal that it
> allows languages different than Java to run well on it.

this is obviously some definition of the term "well" that i wasn't
previously aware of. :-)

Re: Re: White Elefant


2011/10/26 Cédric Beust ♔ <cedric [at] beust [dot] com>

2011/10/26 Josh Suereth <joshua [dot] suereth [at] gmail [dot] com>
Java was a *beast* to learn initially.  Lots of odd rules and strange behavior.

Obviously, everybody will have different experiences about the Java learning curve, but I can tell you that after ten years of a very grueling C++ career, Java felt like an immense breath of fresh air and it appeared so downright simple in pretty much all areas that I went through a constant stream of "This is so simple, why didn't anyone do it this way before?". About the syntax, the disappearance of the dichotomy header file/implementation file, the thread library, the standard collection and how simple they were compared to the STL, etc... It wasn't just the syntax, it was the whole platform.
A new language on the JVM will have to hit that mark if it wants to challenge Java's dominance.

Sure.  I'm using Scala because it does.   Feel free to use Java.  It's good for what it is.   No one is forcing you to learn Scala.

RE: Re: White Elefant

What my ten year old loved was being able to just write working code in either of:

-          Kojo

-          Interpreter

-          Simplyscala.com

 

You know, just type 1+2 and get back 4…

 

Do that in Java – we’re talking beginners and kids here, right?

 

From: scala-debate [at] googlegroups [dot] com [mailto:scala-debate [at] googlegroups [dot] com] On Behalf Of Cédric Beust ?
Sent: October-26-11 2:13 PM
To: martin odersky
Cc: Ittay Dror; scala-debate
Subject: Re: [scala-debate] Re: [scala-user] White Elefant

 

On Wed, Oct 26, 2011 at 8:00 AM, martin odersky <martin [dot] odersky [at] epfl [dot] ch> wrote:

No, I mean if I have to teach hello world, compare

  object Hello extends App {
    println("hello world!")
  }

to its Java equivalent. How much do you have to explain? Or can you get away with saying: these are incantations that you just need to write, not understand? What feeling does that give to a newbie?

 

Not to belabor this particular point, but yes, there is just as much to explain to a beginner about the example above ("object", "extends" and "App", and what's in App, and how come the example doesn't work if you forget to extend, etc...) as with Java's main.

 

And of course, the right way of doing it in both cases is: we'll explain these in turn, let's just focus on println() for now.

 

It's the same thing when you learn to drive: you sit down behind the wheel and there are many things that you can ignore at first. It's a perfectly normal learning process.

 

-- 

Cédric

 

 

 

Re: Re: White Elefant



On 26 October 2011 19:16, Razvan Cojocaru <pub [at] razie [dot] com> wrote:
You know, just type 1+2 and get back 4…



Scala's got bigger problems than I thought!

Paul
/ 1 + 2 == 3, even for large values of 2

Re: Re: White Elefant

body p { margin-bottom: 0cm; margin-top: 0pt; }



martin odersky wrote:
hrYcJDBVLYZaoGPCor-crecLg++g [at] mail [dot] gmail [dot] com" type="cite">

On Wed, Oct 26, 2011 at 4:48 PM, Ittay Dror <ittay [dot] dror [at] gmail [dot] com" rel="nofollow">ittay [dot] dror [at] gmail [dot] com> wrote:



martin odersky wrote:


On Wed, Oct 26, 2011 at 3:57 PM, Ittay Dror <ittay [dot] dror [at] gmail [dot] com" target="_blank" rel="nofollow">ittay [dot] dror [at] gmail [dot] com> wrote:



martin odersky wrote:
For a great counter-argument to the original post, see:

  http://www.youtube.com/watch?v=6RwrT6N43lY

(since we're on the debate list...)

You only show that there is a child that can understand Scala. For this to be a counter-argument, you need to show that there are more children that can understand Scala than those that get Java.

  Oh, I know lots more children (see recent Kojo story, and also people I know privately). But they don't have youtube videos :-).

I firmly believe that Scala is easier to learn than Java. For a starter: public static void main( String[] args) what?

I think you view this from the "spec" point of view. Has this definition of 'main' ever cause tricky bugs? Made code harder to write or change?

No, I mean if I have to teach hello world, compare

  object Hello extends App {
    println("hello world!")
  }

to its Java equivalent. How much do you have to explain? Or can you get away with saying: these are incantations that you just need to write, not understand? What feeling does that give to a newbie?

Even if this initial snippet is easier, after a little while you need to explain how for comprehension works...

It is I think a fact that most people find Scala complex compared with other languages they know. A product manager should gather all this input and make a list that is taken as-is to be the reasons why Scala *is* more complex. Then work on documentation or features to make it simpler. On the other hand, it should be noted why this complexity is worth it (gaining more maintainable code, performance etc.)

hrYcJDBVLYZaoGPCor-crecLg++g [at] mail [dot] gmail [dot] com" type="cite">  
And that even leaves aside the Scala REPL, which is a fantastic tool for learning.

+1. This is an amazing huge plus for Scala. These are the things that should be emphasized. An introduction should start by telling the user how to quickly get a repl running ('wget <some url> | sh' is nice...)


hrYcJDBVLYZaoGPCor-crecLg++g [at] mail [dot] gmail [dot] com" type="cite">

The main problem that I see is that the Scala community as a whole sometimes overcomplicates things.

Hence my suggestion for 'idiomatic' approach a-la python.

See this for example: http://stackoverflow.com/questions/7852471/idiomatic-construction-to-check-whether-a-collection-is-ordered
Runar answered with a post containing semigroups and traverse, pointing to a haskell paper
I answered with a solution using iteratees, which is no better
The best solution IMHO was: (l, l.tail).zipped.forall(_ <= _) (by missingfaktor)

yes, that one's nice.
 

A newbie should have a rich resource of such snippets instead of finding answers about traverse/iteratee which are harder to learn, read and more code to write.

 
Could not agree more.

Cheers

 -- Martin

Re: Re: White Elefant



On Wed, Oct 26, 2011 at 5:14 PM, Ittay Dror <ittay [dot] dror [at] gmail [dot] com> wrote:



martin odersky wrote:


On Wed, Oct 26, 2011 at 4:48 PM, Ittay Dror <ittay [dot] dror [at] gmail [dot] com> wrote:



martin odersky wrote:


On Wed, Oct 26, 2011 at 3:57 PM, Ittay Dror <ittay [dot] dror [at] gmail [dot] com> wrote:



martin odersky wrote:
For a great counter-argument to the original post, see:

  http://www.youtube.com/watch?v=6RwrT6N43lY

(since we're on the debate list...)

You only show that there is a child that can understand Scala. For this to be a counter-argument, you need to show that there are more children that can understand Scala than those that get Java.

  Oh, I know lots more children (see recent Kojo story, and also people I know privately). But they don't have youtube videos :-).

I firmly believe that Scala is easier to learn than Java. For a starter: public static void main( String[] args) what?

I think you view this from the "spec" point of view. Has this definition of 'main' ever cause tricky bugs? Made code harder to write or change?

No, I mean if I have to teach hello world, compare

  object Hello extends App {
    println("hello world!")
  }

to its Java equivalent. How much do you have to explain? Or can you get away with saying: these are incantations that you just need to write, not understand? What feeling does that give to a newbie?

Even if this initial snippet is easier, after a little while you need to explain how for comprehension works...

Note that the 11 year old kid had no problem with them in his talk! I think for comprehensions are far easier to use than the alternatives.

Don't get me wrong: Of course Scala has difficult parts, as has almost every programming language. But I can get a beginning user a long way without ever introducing these parts. In Java, accidental complexity bites you much sooner, that's why I think Scala is easier to teach for a total newcomer.

Cheers

 -- Martin

Re: Re: White Elefant

On 26/10/2011 17:31, martin odersky wrote:
CAENVNkZHc07un7hNkjjKhwjkiYV2xNC6e8A9aiwkWpGQvVeSGA [at] mail [dot] gmail [dot] com" type="cite">

On Wed, Oct 26, 2011 at 5:14 PM, Ittay Dror <ittay [dot] dror [at] gmail [dot] com" rel="nofollow">ittay [dot] dror [at] gmail [dot] com> wrote:


[..] Even if this initial snippet is easier, after a little while you need to explain how for comprehension works...

Note that the 11 year old kid had no problem with them in his talk! I think for comprehensions are far easier to use than the alternatives.

Don't get me wrong: Of course Scala has difficult parts, as has almost every programming language. But I can get a beginning user a long way without ever introducing these parts. In Java, accidental complexity bites you much sooner, that's why I think Scala is easier to teach for a total newcomer.


Supporting that: we just took in our company a total newbie in development. He has a little exposure to C++ (and suffer) and to Java (and well, there was a lot of strange things that he didn't understand and must be done "because don't ask"). I mean, he is really a newbie: he read some tutorial, started to try hello world, etc.

Then, we took him, and has we are a full Scala shop, we ask him to try Scala. In no time (counting in minutes, not even hours), he was able to solve Euler project games in the REPL - what he wasn't able to do after much more time in C++ or Java.

It's just the beginning, and so we will see how he can understand all the complicated part of Scala we use, but for now, I can say that for a total newbie, Scala is easier than Java or C++ (well, ok, C++ was not a real contender).

Cheers,
-- 
Francois ARMAND
http://fanf42.blogspot.com
http://www.normation.com

Re: White Elefant



On Wed, Oct 26, 2011 at 8:18 AM, Ittay Dror <ittay [dot] dror [at] gmail [dot] com> wrote:



Josh Suereth wrote:


On Wed, Oct 26, 2011 at 2:49 AM, Roland Tepp <luolong [at] gmail [dot] com> wrote:
Why, yes, in the essence.
Quantum model is much simpler than Newtonian, as it manages to use one mathematical model to explain more phenomenons than the ones it replaced...

On the other end though, conceptually, the Quantum theory is much more difficult to grok than Newtonian physics, as the interactions it concerns itself with may seem somewhat unintuitive at first...

(btw - I am no physics expert, so my understanding of the fine detils is limited)


Huh, that sounds just like Scala.   It uses *one* model (say pattern matching) to express something and then you use that in many places, vs. lots of diverse strange rules (Java).   I think the comparison to Scala holds well, IMHO.   Lots of simple concepts (that may be hard to grok initially) working together.

Let's face it. Scala is complex. If it weren't, we wouldn't have needed to debate so much about it.

About Java's diverse rules. It is true that Java has a lot of corner cases. The sort that makes the spec big and gives a lot of fodder for things like Java Puzzlers. But the thing is, they are rare corner cases. The sort you don't encounter every day, or ever. On the other hand, Scala's spec is very clean, and there are far less corner cases, but it is because the concepts are harder to digest (at least to those whose mind is already wired for C/C++/C#/Java). Sometimes it's like making everything a corner.

I love Scala, it's a great language. Once I got the concepts I am able to do things I'd never think about in Java. But we should not kid ourselves that there's no barrier.

Ittay



That's not what I was implying at all.   I was comparing the barrier to entry to Scala vs. Java like quantum theory vs. newtonian physics.  Simpler model that covers more things, but barrier to entry is higher.

Re: White Elefant

> Why, yes, in the essence.
> Quantum model is much simpler than Newtonian, as it manages to use one
> mathematical model to explain more phenomenons than the ones it replaced...
>
> On the other end though, conceptually, the Quantum theory is much more
> difficult to grok than Newtonian physics, as the interactions it concerns
> itself with may seem somewhat unintuitive at first...

I think I can safely say that nobody understands quantum mechanics -
Richard
Feynman, The Character of Physical Law.

Michael

Re: White Elefant

Can we please (please!) move this to scala-debate (if we're going to have the discussion at all)?
On 26 Oct 2011, at 07:49, Roland Tepp wrote:
Why, yes, in the essence.
Quantum model is much simpler than Newtonian, as it manages to use one mathematical model to explain more phenomenons than the ones it replaced...

On the other end though, conceptually, the Quantum theory is much more difficult to grok than Newtonian physics, as the interactions it concerns itself with may seem somewhat unintuitive at first...

(btw - I am no physics expert, so my understanding of the fine detils is limited)

kolmapäev, 26. oktoober 2011 3:25.45 UTC+3 kirjutas Michael Thorpe:
The quantum model is simpler than the Newtonian model?

On 26 Oct 2011, at 01:10, stuart gordon <stuart [dot] [dot] [dot] [at] hotmail [dot] co [dot] uk> wrote:

Hi,

I am a lot older that most of you out there and I have seen a lot of changes in computing in general. I was a Java programmer and trainer.
I am now looking at Scala and functional programming but I am now really doubting much that has been said about this language and the use of functional language.

Industry simplifies tools and process with time in all walks of life. It doesn't complicate them and doesn't lend to complicating the processes.
Copernicus  displaced the earth centric ideas; Quantum displaces or enhances Newtonian, Euclidean models. Every model is simpler.
Scala is the opposite. Now you are relying on very talented programmers who have to limit their semantics to make programs work.
The very power that leverage's Scala is its weakness, because to test it, is almost impossible and very difficult.
It relies on good programming practise  to write good programs. Even syntactically it is untidy.
This has not been the trend in software. The trend is to make it more simple, robust and hopefully more error free.
Scala with lazy evalution and psuedofuntional programming opens a minefield that will cost in production and in maintenance.
Even the code will have to take into account the behaviour of tail end recursion and optimising strategies. This should be done by the compiler, and run time virtual machines and with hooks into the OS.
Surely this should be transparent to any programming language.

OO simplifies the real domain model to the machine image. Scala does not.

I think most Scala will be unmaintainable and unpredictable.

The future will see programming languages change but Scala isn't going to be one of them. Compilers, virtual machines and therefore ultimately the OS will do some of the work to make programming easier with multi threading and multi core.
Think about parallel communication which is now replaced with a simple serial interface. Things get simpler not more elaborate.

Why is it popular. Because academics want to have an interesting time but are not really interested in real world problems. Every one thinks its going to be the paradigm shift like OO was to procedural; it  never will be.
Students think it cool or clever to do it. So is chess but for the most wont provide bread and butter on the table.  Its a dangerous fad that will produce horrible code like concrete did with architecture in the 1960´s.

Very, very sceptical.

Lunalobo


--
paul.butcher->msgCount++

Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?

http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: paul [at] paulbutcher [dot] com
AIM: paulrabutcher
Skype: paulrabutcher

Re: White Elefant

Regarding simple vs easier: :)
http://www.infoq.com/presentations/Simple-Made-Easy (Rich Hickey at Strange Loop).

On Wed, Oct 26, 2011 at 8:49 AM, Roland Tepp <luolong [at] gmail [dot] com> wrote:
Why, yes, in the essence.
Quantum model is much simpler than Newtonian, as it manages to use one mathematical model to explain more phenomenons than the ones it replaced...

Copyright © 2013 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland