- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Is Scala the Next C++
I have recently seen a number of discussions around issues like "is
Scala too complex, "is Scala too hard to learn," "Thinking in a
language vs. thinking into a language." etc.
I find these discussions fascinating as I often find myself on both
sides of the fence. At times I find coding in Scala increasingly
seductive and satisfying, at other times I try to read some of the
advanced code and concepts I see people discussing and I feel like a
moron who has no hope to ever grok what they mean, let alone simply
understand it. Often I just have to be satisfied that I get the gist
of it.
This sort of reminds me of my experience with C++. I started trying
the language as soon as there were competent compilers available and
enjoyed the new learning experience, trying to sample as many new
language features as I could and was generally able to master most of
them. However, after a while I was not writing code as often and ever
time I tried to start some new little project I found the start-up
cost of having to relearn C++ too high and switched back to C as much
as possible. My experience was that unless I used C++ continuously,
the overhead of coding was too high.
Eventually I took a class from Scott Meyers. My takeaway point from
that class was that there were programmers and there were type
designers. Type designers had to be very very good at type design. On
the other hand, with well designed type libraries and APIs, being a C+
+ programmers was not so bad after all.
After a while I did not do much C++ because I moved on to Objective-C
because I drank of the NeXT Cool-Aid. I really took to Objective-C
because it was was so much more simple to think in that language than C
++, and the NeXT types and APIs were awesome.
Eventually I moved on to Java and almost immediately became addicted
to the simplicity (over C++) and power (close to C++), but mostly to
the garbage collection. There was a reason I used to love writing code
in LISP.
Eventually I had a job where I had to look at some C++ code again, but
by then it was Microsoft C++ with ATL/COM. My first reaction was WTF?
How did this language get so messed up? Fortunately I was senior
enough I could just say "no way I am touching that!"
Eventually Java became my de facto language and I became increasingly
proficient with it. Then I started looking at Groovy and really liked
how much more expressive Groovy was, with minimal added complexity. I
found it hard to do much with Groovy because I could not convince my
colleagues of its value. Then I found Scala and tried to learn it but
had to bail because it was too confusing. But Scala is seductive!
Eventually I found my way back and became relatively proficient with
it. Yes, I can even write in a functional style and comprehend the
value of it. But I still cannot convince my colleagues of its value
either.
Martin Odersky's Levels http://www.scala-lang.org/node/8610 reminds me
very much of what I learned from Scott Meyers - that you do not need
to grok all of Scala to be proficient and productive in using it. I
personally hope to be able to transition some day from Java to Scala
as my main working language, but at the same time I am mindful of what
became of C++ because the geniuses who came up with ATL and COM.
What I am hoping we might debate is: what is to prevent Scala from
going the route of C++ (and maybe other trials and tribulations of
learning and using Scala). What are the barriers to adopting Scala,
and what compelling advantages does Scala offer to seduce us past
those barriers. Every week I see more barriers coming down because the
keepers of Scala work hard to remove them, but almost as often I see
people pointing out new barriers. Has Scala reached critical mass, or
are we still waiting for it?
Cheers, Eric










Re: Re: Is Scala the Next C++
Possibly not the best example, since I know that a pretty large
proportion of people working in the quant and hf trading spaces have a
pretty decent (ie significantly better than average) knowledge of
functional programming concepts, in addition to specialist trading
knowledge (I know of hedge funds who use nothing but OCaml or Haskell,
for example). I think that generally trading tends to lend itself to
people who are keen on both the problem domain and the tools
themselves (certainly in my experience, at least), and there are more
than a few people around who are using scala (and scalaz) in
production on high frequency trading platforms.
I think the music analogy holds rather well when we only talk about
classical music. Someone with a decent grasp of the theory can move
quite easily from a cello (c++) to a violin (java) but might well
struggle with moving straight to a piano(haskell) without practice.
Someone who has only ever played guitar by strumming along to music on
the radio might well be able to play the songs he knows perfectly, but
is going to struggle if he has to play a new song, or a known song on
a mandolin... I guess the true genius is the guy who can play
something truly beautiful on any instrument, whether it be the cello,
violin, piano, or possibly even the tuba (assembly?) or theramin
(prolog!).
(instruments selected largely at random. I'm not trying to imply
anything in particular here...)
On Sun, Sep 11, 2011 at 2:10 AM, Josh Berry wrote:
> Similarly, I fully
> expect those working on high frequency trading have a stronger grasp
> on trading concepts than most of the people working on the latest
> programming ideas here...
Re: Re: Is Scala the Next C++
On 2011-09-09 6:36 AM, Josh Berry wrote:
> First, apologies for sending this direct... I thought I hit undo fast
> enough, evidently not. :(
>
> On Fri, Sep 9, 2011 at 9:16 AM, Stefan Langer
> wrote:
>> And it is those programmers that produce lots of problems in big teams
>> but now I'm just ranting along
> I was going to chime in on this topic. I'll pick up here. I think it
> is somewhat misleading to think that everyone must learn the theory
> behind programming to learn their tools better. My analogy of choice
> is to music. There are some very talented guitarist out there that
> don't know music theory at all. They got really good with their
> instrument. Likely they discovered some of the underlying things that
> you would understand from theory, but they did not have to go the
> theory route.
>
> I liken this to patterns. Patterns are just recognizing some common
> elements seen throughout varied programs. The "theory" grounded
> topics explain why certain things work. (Similarly, the theory can
> help explain why some tempting anti-patterns do not work.)
>
> So, it is not necessary to have people become fluent in other topics
> than the language they are using. Just don't expect them to do things
> that are not "in the language" easily. Specifically, do not try and
> force abstractions on them that are not easily expressed in the
> language. (I personally think this is what makes some stuff difficult
> to understand from Scala. There is no easy equivalent in Java. There
> are often approximations, but those often cause as much harm as they
> solve.)
I like your analogy Josh. I struggled to learn to play guitar as a
child, but I am tone deaf and could not even tune my own guitar. I
cannot carry a tune to save my life. Most of my life I felt I had no
musical gifts, but before my father died he said "to be able to
appreciate music is also a gift." Now I am a DJ once a week an my fans
love my playlists.
We all have different gifts, and while some gifts are not a 'cool' as
others, we can still be productive.
Sigh - I will never get to enjoy the groupies the way the Scala
rock-stars will ;-)
Cheers, Eric
Re: Re: Is Scala the Next C++
On 9 September 2011 14:36, Josh Berry <taeric [at] gmail [dot] com> wrote:
Music is a much better analogy than you might have first thought. Imagine only learning music in C-major on a non-polyphonic electric keyboard, with all the black keys removed for the sake of simplicity, and because they're not all that necessary in C-major.
Sure, you can play other scales by transposing. The only difference between C-major and A-minor is what note you start on (useful tidbit there for anyone who wondered why we start at C - We don't! minor scales were more common when the system came about). But that assumes you know the existence of other scales in the first place, and transposing requires more technical ability than just playing directly in C-minor to start with.
Even then, it doesn't sound quite right. Pianos and keyboards are a so-called "tempered" instrument, which means that transposing won't shift the frequency of the scale evenly. Composers use this property of different keys to subtly shift the feel of a piece, above and beyond the more obvious major/minor distinction.
I won't even get into the subject of modes :)
For polyphonic music, it gets even harder. You *need* those black keys when playing chord sequences.
Key:black keys = FP constructspolyphony = concurrency"My First Keyboard"(tm) = java
note: A good musician will tell you that c-sharp (for example) is ever so slightly lower in pitch than d-flat. Violinists know this, as do really good woodwind players. Tempering is when you force them to be the same.
--
Kevin Wright
mail: kevin [dot] wright [at] scalatechnology [dot] com
gtalk / msn : kev [dot] lee [dot] wright [at] gmail [dot] com quora: http://www.quora.com/Kevin-Wrightgoogle+: http://gplus.to/thecoda
kev [dot] lee [dot] wright [at] gmail [dot] com twitter: @thecoda
vibe / skype: kev.lee.wrightsteam: kev_lee_wright
"My point today is that, if we wish to count lines of code, we should not regard them as "lines produced" but as "lines spent": the current conventional wisdom is so foolish as to book that count on the wrong side of the ledger" ~ Dijkstra
Re: Re: Is Scala the Next C++
jiri
On Fri, Sep 9, 2011 at 3:56 PM, Kevin Wright <kev [dot] lee [dot] wright [at] gmail [dot] com> wrote:
--
web: http://www.dredwerkz.czblog: http://dr3dwerkz.blogspot.com/
code: https://github.com/g0dd4rd
group: http://groups.google.com/group/dr3dwerkz
music: http://profile.ultimate-guitar.com/g0dd4rd/
twitter: http://twitter.com/#!/g0dd4rd
profile: http://www.google.com/profiles/g0dd4rd
icq: 218 659 431
Re: Re: Is Scala the Next C++
Dam - Kevin is going to get both the music groupies and the Scala groupies too!
</envy>
Re: Re: Is Scala the Next C++
On Fri, Sep 9, 2011 at 9:56 AM, Kevin Wright wrote:
> Music is a much better analogy than you might have first thought. Imagine
> only learning music in C-major on a non-polyphonic electric keyboard, with
> all the black keys removed for the sake of simplicity, and because they're
> not all that necessary in C-major.
You are still hitting the theory, though. Go more basic. Imagine
learning to play on a Ukulele without any training in music theory at
all. It can probably be done. I bet there are some folks that make
really good music that way.
Now, the question I have comes down to this. Which would allow these
people to make better music. Investing in a more capable
tool/language, or deepening their understanding of what they are
doing? My gut guess is it will depend largely on the individual, with
the learning of "what they are doing" having an edge. And,
eventually, they will hit the limitations of the tools they are
currently using, of course.
This is akin to my current skepticism of IDEs helping make people more
productive. I think learning what you are trying to do helps more.
(I had a subthread about this on Cedric's blog recently.)
Re: Re: Is Scala the Next C++
Absolutely. I think a more accurate analogy would be learning the guitar with tabs only and no music sheet, ever. You can go very far this way. You have access to the entire spectrum of possibilities and you will most likely reinvent existing concepts along the way. I wouldn't consider such a guitar player any less of a musician than someone who knows music theory inside and out. At the end of the day, you are both producing music and you could probably learn from each other.
-- Cédric
Re: Re: Is Scala the Next C++
On Sep 9, 2011 5:23 PM, "Cédric Beust ♔" <cedric [at] beust [dot] com> wrote:
>
> On Fri, Sep 9, 2011 at 7:06 AM, Josh Berry <taeric [at] gmail [dot] com> wrote:
>>
>> On Fri, Sep 9, 2011 at 9:56 AM, Kevin Wright <kev [dot] lee [dot] wright [at] gmail [dot] com> wrote:
>> > Music is a much better analogy than you might have first thought. Imagine
>> > only learning music in C-major on a non-polyphonic electric keyboard, with
>> > all the black keys removed for the sake of simplicity, and because they're
>> > not all that necessary in C-major.
>>
>>
>> You are still hitting the theory, though. Go more basic. Imagine
>> learning to play on a Ukulele without any training in music theory at
>> all. It can probably be done. I bet there are some folks that make
>> really good music that way.
>
>
> Absolutely. I think a more accurate analogy would be learning the guitar with tabs only and no music sheet, ever. You can go very far this way. You have access to the entire spectrum of possibilities and you will most likely reinvent existing concepts along the way. I wouldn't consider such a guitar player any less of a musician than someone who knows music theory inside and out. At the end of the day, you are both producing music and you could probably learn from each other.
>
> --
> Cédric
>
Exactly, though it cuts both ways. Programming is as much about composition as it is about performance.
The tab-trained player would struggle to write for any other instrument. Their notation is limited and not suited to e.g. pedal indications for a piano. They may even be unaware of the concept through lack of exposure, and would be unable to take the vast majority of music ever written to adapt it for the ukelele.
Whilst our hypothetical player may well be a virtuoso on their chosen instrument, it's even possible that their entire mental model of music would be shaped, and restricted, by that notation.
However you cut it... the very same person, if schooled in "standard" notation, would find themselves a better musician. With more options available, and a greater body of collective knowledge to draw upon.
Re: Re: Is Scala the Next C++
Agree with you up until this point.
I don't want to stretch this metaphor too far because it's bound to leak, but so far, it's holding well with our Scala/Java discussion so I'll keep with it.
I am a beginner guitar player with six years of classical piano (and heavy theory) behind it. I can't imagine a world in which this would make me a better musician than a guitar player who's been practicing a few hours every day for a few months and who knows nothing about music notation. This person will run rings around me playing any kind of music (as long as it's using tabs, of course. Which he will probably not even need since his fingers probably know most of the pieces by heart).
I'm just trying to warn against using this classification to say who is a better musician (or developer) than another. It just doesn't work that way. See my earlier note about awesome developers who have very little knowledge of FP and category theory.
-- Cédric
Re: Re: Is Scala the Next C++
On Sep 9, 2011 6:24 PM, "Cédric Beust ♔" <cedric [at] beust [dot] com> wrote:
>
> 2011/9/9 Kevin Wright <kev [dot] lee [dot] wright [at] gmail [dot] com>
>>
>> However you cut it... the very same person, if schooled in "standard" notation, would find themselves a better musician.
>
>
> Agree with you up until this point.
>
> I don't want to stretch this metaphor too far because it's bound to leak, but so far, it's holding well with our Scala/Java discussion so I'll keep with it.
>
> I am a beginner guitar player with six years of classical piano (and heavy theory) behind it. I can't imagine a world in which this would make me a better musician than a guitar player who's been practicing a few hours every day for a few months and who knows nothing about music notation. This person will run rings around me playing any kind of music (as long as it's using tabs, of course. Which he will probably not even need since his fingers probably know most of the pieces by heart).
>
> I'm just trying to warn against using this classification to say who is a better musician (or developer) than another. It just doesn't work that way. See my earlier note about awesome developers who have very little knowledge of FP and category theory.
>
> --
> Cédric
>
Oh, totally. But, *all other things being equal*, the guy with the better theory, and experience with the more general-purpose notation, will be at an advantage. The analogy could be extended here to cover a developer who knows a wider range of abstractions and paradigms with which to construct software.
Of course... If you shirk practice, however well-reasoned your justification, then you'll suck. No matter how well you know the theory. This goes for music and programming alike.
The point of an opportunity-cost in spending time on pure theory is a valid one :)
Re: Re: Is Scala the Next C++
On Fri, Sep 9, 2011 at 1:23 PM, Cédric Beust ♔ wrote:
> I am a beginner guitar player with six years of classical piano (and heavy
> theory) behind it. I can't imagine a world in which this would make me a
> better musician than a guitar player who's been practicing a few hours every
> day for a few months and who knows nothing about music notation. This person
> will run rings around me playing any kind of music (as long as it's using
> tabs, of course. Which he will probably not even need since his fingers
> probably know most of the pieces by heart).
This is why I stated what I did about these players likely learning
some theory without naming it. They would likely even call the chord
progression they chose in a little improvisation as something they did
because it was patterned after something else they had seen that
worked. Now, the theory could tell them why and which other patterns
might also work. Any why.
So, the question comes in, which gives more bang for buck? A new
tool, or a deeper understanding of the craft? Switching to Scala is
using a more capable tool than using Java. Just as switching to an
IDE gives you a more capable tool than using notepad. Does switching
editing tools help more than switching language targets? Do either
hit as hard as learning the craft?
The cut I made the other day was simply that learning whatever domain
you are working with may be the best bet most folks need to do. That
is, "learning to general program in Scala" likely won't help most
people writing webapps as much as simply learning the plumbing used by
the overall framework they are targeting.
Re: Is Scala the Next C++
On 09/09/2011 06:34, Raoul Duke wrote:
> On Thu, Sep 8, 2011 at 6:58 PM, Eric Kolotyluk wrote:
>> have given several presentations on Scala to my peers - and they still ask -
>> why do we need another language?
>
> heck, i love programming languages, but to some degree these folks do
> have a valid point!
Yes and no...
Why do we need hybrid cars, we have already fossil fuel ones.
Why do we need smartphones, dumb phones already work well.
Why make metallic rawplugs, the plastic ones were working well enough.
So, basically, why make innovations, the old ways are good enough...
Now, I reckon than, among other things, the flurry of new programmings languages (in JVM
and outside (Go, Rusty...)) is dizzying!
And the reason Scala was harder to learn than to learn Java is that we learn not only a
new syntax, but also (for lot of us), new paradigms.
Likewise, even after learning several (imperative) programming languages, I found hard to
learn C++, even if the syntax was familiar (I coded lot of C), because I struggled to get
the OOP paradigm, vocabulary, concepts, way of thinking. Idem, now, for functional
programming, and using immutability. Currently, I take baby steps, not thinking too hard
how to make all my variables immutable[1], although being aware of the challenges, and
going on with my Scala discovery. I know that with experience, it will feel more natural.
[1] If you search var in the Scala sources, you will still find a number of occurrences,
like, unsurprisingly, in iterators. Sometime, performance wins over purity... :-)
Re: Is Scala the Next C++
On 2011-09-07 5:20 AM, Cédric Beust ♔ wrote:
Yes, I am very clear Scala is more powerful and fun to work with than C++. There is substantially more experience and breakthroughs in language design that have gone into Scala than were available to the C++ language designers.
And yes, Scala is to Java what C++ is to C. The design of Scala is exceedingly more progressive compared to the exceedingly conservative approach to Java language evolution. I do not fault the Java language designers, and I praise them for making sure my old Java code continues to run correctly as the language evolves.
In the end, things did not go well for C++. I am wondering what we can learn from that and how we can use it to avoid similar misadventures with Scala.
There will always be side discussions like "is Scala too complex?" but the reason I started this debate was to challenge people to think of reasons this will or won't happen to Scala, and to propose ways for Scala to avoid the same difficulties C++ ran into.
Cheers, Eric
Re: Is Scala the Next C++
2011/9/7 Eric Kolotyluk <eric [dot] kolotyluk [at] gmail [dot] com>
I wonder what are your arguments to say that "things did not go well for C++". Every CS community has its load of bashing C++, but it is still a VERY successful language, from self-taught geeks, through academic researchers, to the biggest companies. You might want to check that, but I'd say it's probably the second most-used language after Java. And yet it was here long before Java, and had its own reign before Java. It's therefore weird to say that things did not go well for C++. C++ did not run into difficulties, a lot of C++ *programmers* ran into difficulties (but in favor of cognitive dissonance, decided they would live with them and still swear only by C++ for a little more time).
--
Alex REPAIN
ENSEIRB-MATMECA - student
TECHNICOLOR R&D - intern
BORDEAUX I - master's student
SCALA - enthusiast
RE: Is Scala the Next C++
Well, since it’s C++ bashing season… can someone enlighten me about what was so fundamentally willy-nilly or wrong with “C with Classes” and what are these difficulties that it ran into?
As far as I can tell, the reasons for Java’s success was abundance of cheap developers that could master (some say) the dumbed down Pascal flavor. Technically, the best thing about Java was the JVM/JAR and garbage collection, not the language itself. I do not recall any studies to show the efficiency of all these developers but that is irrelevant, because what it did is enable the networking effect and led to a massive growth and you now have tons of libraries and frameworks that do pretty much everything.
But the language of Java itself now seems to have taken on mythical powers and is compared with Scala and C++ ??? Are you kidding me? Until recently I could not even have a basic typed container, like List<Student>!
Last I looked at Tiobe, C++ is number 3 and C is number 2… What are these problems that C++ ran into? The fact that it didn’t evolve fast enough? Yes… what else? Lack of marketing? Yes… what else?
When thinking about C++, I think that simply, the time for new paradigms had come and a syntax build 20 years ago should not be coerced any further. Should we all stand in awe at the longevity and universality of say the intel assembly language?
The time had simply come, the knowledge had grown significantly, techniques and paradigms evolved and tested, new needs growing, JVM good enough and Martin had enough spare time… J
From: scala-debate [at] googlegroups [dot] com [mailto:scala-debate [at] googlegroups [dot] com] On Behalf Of Eric Kolotyluk
Sent: September-07-11 9:41 AM
To: Cédric Beust ♔
Cc: scala-debate
Subject: Re: [scala-debate] Is Scala the Next C++
On 2011-09-07 5:20 AM, Cédric Beust ♔ wrote:
On Tue, Sep 6, 2011 at 1:45 PM, Eric Kolotyluk <eric [dot] kolotyluk [at] gmail [dot] com> wrote:
This sort of reminds me of my experience with C++.
I have the same feeling.
First of all, let it be clear that in terms of design, Scala is much more powerful and pleasant to work with than C++ ever was.
Having said that, a lot of things about Scala do remind me about C++ in the sense that "Scala is to Java what C++ is to C": a language more powerful but that also comes with costs.
I don't expect anyone who hasn't written thousands of lines of C++ in the 90's to understand the connection, though.
--
Cédric
Yes, I am very clear Scala is more powerful and fun to work with than C++. There is substantially more experience and breakthroughs in language design that have gone into Scala than were available to the C++ language designers.
And yes, Scala is to Java what C++ is to C. The design of Scala is exceedingly more progressive compared to the exceedingly conservative approach to Java language evolution. I do not fault the Java language designers, and I praise them for making sure my old Java code continues to run correctly as the language evolves.
In the end, things did not go well for C++. I am wondering what we can learn from that and how we can use it to avoid similar misadventures with Scala.
There will always be side discussions like "is Scala too complex?" but the reason I started this debate was to challenge people to think of reasons this will or won't happen to Scala, and to propose ways for Scala to avoid the same difficulties C++ ran into.
Cheers, Eric
(offtopic) Re: Is Scala the Next C++
Razvan Cojocaru wrote:
Nothing, but C++ had problems beyond that:
1. It was just a standard. Each unix system had its own implementation, which usually only partially implemented the spec and each having its own set of bugs. And since name mangling was not speced, it meant that if you wanted to link with another library you had to use the same compiler it used. Usually with the same flags.
2. Memory related errors were hard to detect. If you accidently called 'delete' on an object, you could continue to use it until creating another object in the same memory, then all hell broke loose, but of course it was long after that accidental delete.
3. Template errors were very hard to follow. Especially with STL, which is a wonderful library except for the allocators bit which made a mess of everything.
4. Slow compilation
5. Separation of source and headers which meant you had to change two files for any API change.
6. No abstraction over differences in operating systems and filesystems.
7. Templates were generated at call site which caused code bloat.
There were of course things that were better: better control over memory, explicit destructors, which allows easy ARM, probably more.
Ittay
Re: Is Scala the Next C++
On 7 Sep 2011, at 15:23, Razvan Cojocaru wrote:
> Last I looked at Tiobe, C++ is number 3 and C is number 2
On the subject of the Tiobe index, it's interesting to note that a "modern" functional language has just entered the top 20 for the first time last month.
Not Scala, Clojure, Haskell or Erlang, but... F#
Microsoft clearly still carries considerable weight among (some) developers.
--
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: Is Scala the Next C++
On Wed, Sep 7, 2011 at 10:55 AM, Paul Butcher wrote:
> On the subject of the Tiobe index, it's interesting to note that a "modern" functional language has just entered the top 20 for the first time last month.
>
> Not Scala, Clojure, Haskell or Erlang, but... F#
>
> Microsoft clearly still carries considerable weight among (some) developers.
The TIOBE index is junk and its well-known-ness is an unfortunate
historical accident.
We can't wish TIOBE out of existence, but a good start would be to
stop citing or mentioning it and use more reliable sources instead,
e.g.
http://lang-index.sourceforge.net/
http://www.indeed.com/jobtrends?q=scala%2C+clojure%2C+groovy%2C+f%23&l=
Re: Is Scala the Next C++
On 2011-09-07 9:51 AM, Seth Tisue wrote:
> On Wed, Sep 7, 2011 at 10:55 AM, Paul Butcher wrote:
>> On the subject of the Tiobe index, it's interesting to note that a "modern" functional language has just entered the top 20 for the first time last month.
>>
>> Not Scala, Clojure, Haskell or Erlang, but... F#
>>
>> Microsoft clearly still carries considerable weight among (some) developers.
> The TIOBE index is junk and its well-known-ness is an unfortunate
> historical accident.
>
> We can't wish TIOBE out of existence, but a good start would be to
> stop citing or mentioning it and use more reliable sources instead,
> e.g.
> http://lang-index.sourceforge.net/
> http://www.indeed.com/jobtrends?q=scala%2C+clojure%2C+groovy%2C+f%23&l=
Nonetheless - I would still welcome seeing Scala rate higher on the
TIOBE index :-)
What other indexes are out there that are possibly meaningful?
Cheers, Eric
Re: Is Scala the Next C++
http://delphi.org/2008/10/delphi-keeps-climbing/
On 7 September 2011 21:51, Eric Kolotyluk <eric [dot] kolotyluk [at] gmail [dot] com> wrote:
Re: Is Scala the Next C++
On Wed, Sep 7, 2011 at 9:51 AM, Seth Tisue <seth [at] tisue [dot] net> wrote:
I find this claim a bit odd considering that you're using "indeed.com", which I had never heard of before it started being passed around in the Scala community (dice and monster seem to be more established references for jobs), and which hasn't updated its numbers since January. At any rate, like I pointed out earlier, even indeed.com still places Scala at 0.02% (zero point zero two percent!) of the jobs posted on its board, so not a shining endorsement either (and certainly not any more glowing than TIOBE's).
My earlier statement still applies:
-- Cédric
Re: Is Scala the Next C++
2011/9/7 Cédric Beust ♔ :
> On Wed, Sep 7, 2011 at 9:51 AM, Seth Tisue wrote:
>> The TIOBE index is junk and its well-known-ness is an unfortunate
>> historical accident.
>
> I find this claim a bit odd considering that you're using "indeed.com",
> which I had never heard of before it started being passed around in the
> Scala community (dice and monster seem to be more established references for
> jobs),
Indeed aggregates job listings from a variety of sources including Dice.
If there's a way to go to Dice or Monster and see trend data like
Indeed offers, I don't see it.
> and which hasn't updated its numbers since January.
Huh? No. Their numbers are up to date. Look again. There is data after
the tick mark labeled "Jan. 11".
Re: Is Scala the Next C++
2011/9/7 Cédric Beust ♔ <cedric [at] beust [dot] com>
You have to factor in that indeed.com is for all sorts of jobs, not just software, or tech jobs in general. So Java jobs also have only a 3% mindshare there.
By comparison, jobs for Scala are a bit less than 1% of all Java jobs in US. In some other markets (i.e. city of London) that number is now over 2%. Other job sites confirm the trend.
These numbers are still low, but it's also clear that they are growing rapidly.
Cheers
Re: Is Scala the Next C++
The title was intended to be provocative so people might read the discussion, but people are reading more into the title than I intended (my bad).
Razvan, you say "dumbed down Pascal flavor" like that is bad thing. One of the reasons I like Java is that exact reason, it is really easy to approach Java as a new language whether you are a "cheap developer" or a seasoned one.
The reason I was successful at approaching Scala the second time was I had a better book with a better introduction. Scala, with the right introduction can be approachable, maybe even for some "cheap developers" ;-)
On the other hand, for a newcomer to Scala, the wrong introduction to the language can be a disaster, as I found on my first introduction to it - and believe me I am not a cheap developer.
The point that C++ is number 3 on Tiobe largely reflects how much legacy code there is still out there, and how much legacy investment organizations have made in training and tooling. This is also part of why Java is number 1. C is a special case, however, as I personally view C the same way I view assembly language, except I try to resort to C before assembly language. After all, the JVM is written in C.
My point about contemporary C++, especially with ATL/COM, is the code is unreadable and unmaintainable. It is far too easy to inadvertently create defects and it is painfully expensive to find and fix those defects. I personally do not believe C++ is a cost effective way to develop software.
My hope for Scala is that people can learn to write readable, maintainable code with few defects, and that defects won't be hard to find an correct - even for the "cheap developers."
Cheers, Eric
On 2011-09-07 7:23 AM, Razvan Cojocaru wrote:
RE: Is Scala the Next C++
Sorry – I didn’t mean “cheap” as a bad thing, I was thinking “off the shelf and readily available for hire in large supply”.
This statement and other like it is what I cannot comprehend:
Razvan, you say "dumbed down Pascal flavor" like that is bad thing. One of the reasons I like Java is that exact reason, it is really easy to approach Java as a new language whether you are a "cheap developer" or a seasoned one.
We’ve all been through years of CS theory where we learned about all available paradigms. We have passed these courses, since we have diplomas. We thus must all be able to pick up pretty much any language fairly fast. I’m not talking about college dropouts, former WallMart employees with a 6 month programming course, but engineers.
Lower pay, abundant or not, I cannot understand why the speed of picking up a new language is a determining factor in using that language for a career or a decade…
I am afraid that this approach is what’s behind these “scala is too complex” statements, when what truly matters is how living with that language every day for the next decade will be like, not how fast you pick up the syntax.
And yes, that Java is a dumbed down Pascal is a very bad thing. I was stuck with it for a decade. What happens (brain researchers will tell you) is that hard-aquired skill atrophies if not used. Java is so simple and devoid of paradigms that I fear I have significantly damaged the abstract part of my brain. These past 3-4 years of doing scala on a side it’s like a workout and recovery and I must tell you, it’s not been easy.
As Tony will tell you, programming is complex, scala is not.
My name is Razvan and I’m a scalaholic.
From: Eric Kolotyluk [mailto:eric [dot] kolotyluk [at] gmail [dot] com]
Sent: September-07-11 10:45 AM
To: Razvan Cojocaru
Cc: 'Cédric Beust ♔'; 'scala-debate'
Subject: Re: [scala-debate] Is Scala the Next C++
OK, OK - I may not have chosen the best title for this discussion :-)
The title was intended to be provocative so people might read the discussion, but people are reading more into the title than I intended (my bad).
Razvan, you say "dumbed down Pascal flavor" like that is bad thing. One of the reasons I like Java is that exact reason, it is really easy to approach Java as a new language whether you are a "cheap developer" or a seasoned one.
The reason I was successful at approaching Scala the second time was I had a better book with a better introduction. Scala, with the right introduction can be approachable, maybe even for some "cheap developers" ;-)
On the other hand, for a newcomer to Scala, the wrong introduction to the language can be a disaster, as I found on my first introduction to it - and believe me I am not a cheap developer.
The point that C++ is number 3 on Tiobe largely reflects how much legacy code there is still out there, and how much legacy investment organizations have made in training and tooling. This is also part of why Java is number 1. C is a special case, however, as I personally view C the same way I view assembly language, except I try to resort to C before assembly language. After all, the JVM is written in C.
My point about contemporary C++, especially with ATL/COM, is the code is unreadable and unmaintainable. It is far too easy to inadvertently create defects and it is painfully expensive to find and fix those defects. I personally do not believe C++ is a cost effective way to develop software.
My hope for Scala is that people can learn to write readable, maintainable code with few defects, and that defects won't be hard to find an correct - even for the "cheap developers."
Cheers, Eric
On 2011-09-07 7:23 AM, Razvan Cojocaru wrote:
Well, since it’s C++ bashing season… can someone enlighten me about what was so fundamentally willy-nilly or wrong with “C with Classes” and what are these difficulties that it ran into?
As far as I can tell, the reasons for Java’s success was abundance of cheap developers that could master (some say) the dumbed down Pascal flavor. Technically, the best thing about Java was the JVM/JAR and garbage collection, not the language itself. I do not recall any studies to show the efficiency of all these developers but that is irrelevant, because what it did is enable the networking effect and led to a massive growth and you now have tons of libraries and frameworks that do pretty much everything.
But the language of Java itself now seems to have taken on mythical powers and is compared with Scala and C++ ??? Are you kidding me? Until recently I could not even have a basic typed container, like List<Student>!
Last I looked at Tiobe, C++ is number 3 and C is number 2… What are these problems that C++ ran into? The fact that it didn’t evolve fast enough? Yes… what else? Lack of marketing? Yes… what else?
When thinking about C++, I think that simply, the time for new paradigms had come and a syntax build 20 years ago should not be coerced any further. Should we all stand in awe at the longevity and universality of say the intel assembly language?
The time had simply come, the knowledge had grown significantly, techniques and paradigms evolved and tested, new needs growing, JVM good enough and Martin had enough spare time… J
From: scala-debate [at] googlegroups [dot] com [scala-debate [at] googlegroups [dot] com (mailto:scala-debate [at] googlegroups [dot] com)] On Behalf Of Eric Kolotyluk
Sent: September-07-11 9:41 AM
To: Cédric Beust ♔
Cc: scala-debate
Subject: Re: [scala-debate] Is Scala the Next C++
On 2011-09-07 5:20 AM, Cédric Beust ♔ wrote:
On Tue, Sep 6, 2011 at 1:45 PM, Eric Kolotyluk <eric [dot] kolotyluk [at] gmail [dot] com> wrote:
This sort of reminds me of my experience with C++.
I have the same feeling.
First of all, let it be clear that in terms of design, Scala is much more powerful and pleasant to work with than C++ ever was.
Having said that, a lot of things about Scala do remind me about C++ in the sense that "Scala is to Java what C++ is to C": a language more powerful but that also comes with costs.
I don't expect anyone who hasn't written thousands of lines of C++ in the 90's to understand the connection, though.
--
Cédric
Yes, I am very clear Scala is more powerful and fun to work with than C++. There is substantially more experience and breakthroughs in language design that have gone into Scala than were available to the C++ language designers.
And yes, Scala is to Java what C++ is to C. The design of Scala is exceedingly more progressive compared to the exceedingly conservative approach to Java language evolution. I do not fault the Java language designers, and I praise them for making sure my old Java code continues to run correctly as the language evolves.
In the end, things did not go well for C++. I am wondering what we can learn from that and how we can use it to avoid similar misadventures with Scala.
There will always be side discussions like "is Scala too complex?" but the reason I started this debate was to challenge people to think of reasons this will or won't happen to Scala, and to propose ways for Scala to avoid the same difficulties C++ ran into.
Cheers, Eric
Re: Is Scala the Next C++
I have used over 30 different programming languages in my day, and I can pick up most rather quickly, but I don't like having to do it. I would rather be an expert at a few than mediocre across many.
Java was one of the few languages where I could more easily focus on the problem to be solved than the language to be learned. That is a really good principle. These days however I tier of the boilerplate needed in Java, but I tolerate it because Java is still exceedingly useful and I am expert at it.
Scala is very seductive because it addresses many of the shortcomings I now find in Java, yet it is not too strange from Java. I have been using Java for over 15 years and I do not think it has caused my brain to atrophy. Sure Java has not always challenged my thinking, but what I am finding with Scala is that it incorporates so many leading edge ideas and practices that anyone who has not stayed academically and intellectually active needs time to reacquire those skills.
The major trend I have seen in computer languages lately, that I like, is the emphasis on expressiveness without sacrificing readability. APL is very expressive but hardly readable. Scala is also very expressive, but can suffer from readability in the wrong hands. Also, there is Scala code I have seen that I am sure is very good code, but I cannot easily read it because I am not at L3.
Cheers, Eric
On 2011-09-07 8:13 AM, Razvan Cojocaru wrote:
Re: Is Scala the Next C++
Eric Kolotyluk wrote: I feel quite the opposite. E.g., in Java, when I need to design an API that accepts a callback, I need to invent an interface. Client code then needs to create an (anonymous) class implementing it. In Scala, I use a function. This lets me focus on the problem, and not some interface that does not contribute anything. Reading the code is also clearer.
A maybe poor analogy is this: I can calculate 23 * 4 by: 23 + 23 + 23 + 23. Or, I can learn long multipication (I hope this is the right term). The first way is easier to pick up, but you end up with "boilerplate" and a complex solution. The second way means you need to learn something new (it is more "complex"). Once you learn it though, you're more productive
Ittay
Re: Is Scala the Next C++
On 2011-09-07 10:27 AM, Ittay Dror wrote: I totally agree. Scala is significantly better at reducing boilerplate. If I could use Scala in my everyday code I would - but I can't (yet). The point I am making is that I prefer Java over languages like C++ where I am required to know too many intimated details of the language before I can even begin to express a solution to my problem.
I totally agree Scala was designed to better focus on the problem than the language. However, for those L3 people, they do need to focus on the language so rest of us don't. And if those L3 people make a mistake, the rest of us may have to become more intimate with Scala than we are comfortable at the moment.
Re: Is Scala the Next C++
C++ has a stigma, so comparing Scala to C++ can be seen as a negative thing. Personally, I think the comparison is *true* and also a good thing.
However, the comparison ends somewhere around here. Scala has GC, Scala has the JVM, Scala doesn't make you worry over the memory usage in *every* line of code. Scala doesn't cause huge coorporate software meltdowns from missing a *. Operator overloading is not the danger it is in C++ (Go look up/remember the problems with operators in C++ and then try to tell me that holds true in Scala. If you convince me, I'll buy you beer).
So let's be clear: Scala is like C++ in a few ways. These comparisons are healthy reminders. Let's continue to avoid C++'s pitfalls as best as possible.
- Josh
2011/9/7 Eric Kolotyluk <eric [dot] kolotyluk [at] gmail [dot] com>
Re: Is Scala the Next C++
2011/9/7 Cédric Beust ♔ <cedric [at] beust [dot] com>
Scala is to Java what Java is to PHP, or even what Blub is to COBOL[1].
It's more powerful, it's far more type-safe, and you'll see many users of the latter bemoaning aspects of the former (e.g. on stackoverflow) that they haven't yet grokked.
It's an old, old debate, don't worry about it, just use the most powerful language you can[2] that fits your requirements, and be happy.
[1] Capitalisation of Boilerplate Oriented Language [2] I refused to be drawn into any discussion on what it means to state that you "can" use a given language, there are too many variables.
--
Kevin Wright
mail: kevin [dot] wright [at] scalatechnology [dot] com
gtalk / msn : kev [dot] lee [dot] wright [at] gmail [dot] com quora: http://www.quora.com/Kevin-Wrightgoogle+: http://gplus.to/thecoda
kev [dot] lee [dot] wright [at] gmail [dot] com twitter: @thecoda
vibe / skype: kev.lee.wrightsteam: kev_lee_wright
"My point today is that, if we wish to count lines of code, we should not regard them as "lines produced" but as "lines spent": the current conventional wisdom is so foolish as to book that count on the wrong side of the ledger" ~ Dijkstra
Re: Is Scala the Next C++
I would say the opposite. Use the least powerful language you can that fits your requirements, and be happy.
Why struggle with a turing machine when a finite-state machine will do?
BR,
John
Re: Is Scala the Next C++
On 9 September 2011 22:41, John Nilsson <john [at] milsson [dot] nu> wrote:
Why struggle with raw machine code, when Scala can do the job?
--
Kevin Wright
mail: kevin [dot] wright [at] scalatechnology [dot] com
gtalk / msn : kev [dot] lee [dot] wright [at] gmail [dot] comquora: http://www.quora.com/Kevin-Wright google+: http://gplus.to/thecoda
kev [dot] lee [dot] wright [at] gmail [dot] comtwitter: @thecoda
vibe / skype: kev.lee.wright steam: kev_lee_wright
"My point today is that, if we wish to count lines of code, we should not regard them as "lines produced" but as "lines spent": the current conventional wisdom is so foolish as to book that count on the wrong side of the ledger" ~ Dijkstra
Re: Is Scala the Next C++
What I meant is that it is not uncommon for me to discover heaps of very hard to analyse programs that could very succinctly, and more importantly, easier to reason about be expressed as regular expressions or simple SQL-queries.
Of course Scala makes it easy to construct DSLs that resembles such powerless laguages but you are still left with a turing complete illusion.
Take pureness as an example. It is often stated that an effect system is required to fully track pure code. But that is kind of the wrong way to look at it no? Given a subset of the language that didn't have impure features there would be no need to "track" it.
BR,
John
Re: Is Scala the Next C++
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Anyone who tells you that Scala is too complex and is like C++
understands neither Scala, C++ and programming in general. I absolutely
guarantee you this, and I happy to demonstrate it to you.
If my motives are not clear, I am happy to demonstrate this to you
because I wish to convince you of this universally applicable attribute
so that there is one less person questioning statements that are so
significantly departed from reality and so we can move on. Win win.
On 07/09/11 06:45, Eric Kolotyluk wrote:
> I have recently seen a number of discussions around issues like "is
> Scala too complex, "is Scala too hard to learn," "Thinking in a
> language vs. thinking into a language." etc.
>
> I find these discussions fascinating as I often find myself on both
> sides of the fence. At times I find coding in Scala increasingly
> seductive and satisfying, at other times I try to read some of the
> advanced code and concepts I see people discussing and I feel like a
> moron who has no hope to ever grok what they mean, let alone simply
> understand it. Often I just have to be satisfied that I get the gist
> of it.
>
> This sort of reminds me of my experience with C++. I started trying
> the language as soon as there were competent compilers available and
> enjoyed the new learning experience, trying to sample as many new
> language features as I could and was generally able to master most of
> them. However, after a while I was not writing code as often and ever
> time I tried to start some new little project I found the start-up
> cost of having to relearn C++ too high and switched back to C as much
> as possible. My experience was that unless I used C++ continuously,
> the overhead of coding was too high.
>
> Eventually I took a class from Scott Meyers. My takeaway point from
> that class was that there were programmers and there were type
> designers. Type designers had to be very very good at type design. On
> the other hand, with well designed type libraries and APIs, being a C+
> + programmers was not so bad after all.
>
> After a while I did not do much C++ because I moved on to Objective-C
> because I drank of the NeXT Cool-Aid. I really took to Objective-C
> because it was was so much more simple to think in that language than C
> ++, and the NeXT types and APIs were awesome.
>
> Eventually I moved on to Java and almost immediately became addicted
> to the simplicity (over C++) and power (close to C++), but mostly to
> the garbage collection. There was a reason I used to love writing code
> in LISP.
>
> Eventually I had a job where I had to look at some C++ code again, but
> by then it was Microsoft C++ with ATL/COM. My first reaction was WTF?
> How did this language get so messed up? Fortunately I was senior
> enough I could just say "no way I am touching that!"
>
> Eventually Java became my de facto language and I became increasingly
> proficient with it. Then I started looking at Groovy and really liked
> how much more expressive Groovy was, with minimal added complexity. I
> found it hard to do much with Groovy because I could not convince my
> colleagues of its value. Then I found Scala and tried to learn it but
> had to bail because it was too confusing. But Scala is seductive!
> Eventually I found my way back and became relatively proficient with
> it. Yes, I can even write in a functional style and comprehend the
> value of it. But I still cannot convince my colleagues of its value
> either.
>
> Martin Odersky's Levels http://www.scala-lang.org/node/8610 reminds me
> very much of what I learned from Scott Meyers - that you do not need
> to grok all of Scala to be proficient and productive in using it. I
> personally hope to be able to transition some day from Java to Scala
> as my main working language, but at the same time I am mindful of what
> became of C++ because the geniuses who came up with ATL and COM.
>
> What I am hoping we might debate is: what is to prevent Scala from
> going the route of C++ (and maybe other trials and tribulations of
> learning and using Scala). What are the barriers to adopting Scala,
> and what compelling advantages does Scala offer to seduce us past
> those barriers. Every week I see more barriers coming down because the
> keepers of Scala work hard to remove them, but almost as often I see
> people pointing out new barriers. Has Scala reached critical mass, or
> are we still waiting for it?
>
> Cheers, Eric
RE: Is Scala the Next C++
X is like Y /== X is exactly the same as YX is like Y /== in every conceivable aspect, X is like Y
Chris
> Date: Wed, 7 Sep 2011 08:40:52 +1000
> From: tonymorris [at] gmail [dot] com
> To: scala-debate [at] googlegroups [dot] com
> Subject: Re: [scala-debate] Is Scala the Next C++
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Anyone who tells you that Scala is too complex and is like C++
> understands neither Scala, C++ and programming in general. I absolutely
> guarantee you this, and I happy to demonstrate it to you.
>
> If my motives are not clear, I am happy to demonstrate this to you
> because I wish to convince you of this universally applicable attribute
> so that there is one less person questioning statements that are so
> significantly departed from reality and so we can move on. Win win.
>
> On 07/09/11 06:45, Eric Kolotyluk wrote:
> > I have recently seen a number of discussions around issues like "is
> > Scala too complex, "is Scala too hard to learn," "Thinking in a
> > language vs. thinking into a language." etc.
> >
> > I find these discussions fascinating as I often find myself on both
> > sides of the fence. At times I find coding in Scala increasingly
> > seductive and satisfying, at other times I try to read some of the
> > advanced code and concepts I see people discussing and I feel like a
> > moron who has no hope to ever grok what they mean, let alone simply
> > understand it. Often I just have to be satisfied that I get the gist
> > of it.
> >
> > This sort of reminds me of my experience with C++. I started trying
> > the language as soon as there were competent compilers available and
> > enjoyed the new learning experience, trying to sample as many new
> > language features as I could and was generally able to master most of
> > them. However, after a while I was not writing code as often and ever
> > time I tried to start some new little project I found the start-up
> > cost of having to relearn C++ too high and switched back to C as much
> > as possible. My experience was that unless I used C++ continuously,
> > the overhead of coding was too high.
> >
> > Eventually I took a class from Scott Meyers. My takeaway point from
> > that class was that there were programmers and there were type
> > designers. Type designers had to be very very good at type design. On
> > the other hand, with well designed type libraries and APIs, being a C+
> > + programmers was not so bad after all.
> >
> > After a while I did not do much C++ because I moved on to Objective-C
> > because I drank of the NeXT Cool-Aid. I really took to Objective-C
> > because it was was so much more simple to think in that language than C
> > ++, and the NeXT types and APIs were awesome.
> >
> > Eventually I moved on to Java and almost immediately became addicted
> > to the simplicity (over C++) and power (close to C++), but mostly to
> > the garbage collection. There was a reason I used to love writing code
> > in LISP.
> >
> > Eventually I had a job where I had to look at some C++ code again, but
> > by then it was Microsoft C++ with ATL/COM. My first reaction was WTF?
> > How did this language get so messed up? Fortunately I was senior
> > enough I could just say "no way I am touching that!"
> >
> > Eventually Java became my de facto language and I became increasingly
> > proficient with it. Then I started looking at Groovy and really liked
> > how much more expressive Groovy was, with minimal added complexity. I
> > found it hard to do much with Groovy because I could not convince my
> > colleagues of its value. Then I found Scala and tried to learn it but
> > had to bail because it was too confusing. But Scala is seductive!
> > Eventually I found my way back and became relatively proficient with
> > it. Yes, I can even write in a functional style and comprehend the
> > value of it. But I still cannot convince my colleagues of its value
> > either.
> >
> > Martin Odersky's Levels http://www.scala-lang.org/node/8610 reminds me
> > very much of what I learned from Scott Meyers - that you do not need
> > to grok all of Scala to be proficient and productive in using it. I
> > personally hope to be able to transition some day from Java to Scala
> > as my main working language, but at the same time I am mindful of what
> > became of C++ because the geniuses who came up with ATL and COM.
> >
> > What I am hoping we might debate is: what is to prevent Scala from
> > going the route of C++ (and maybe other trials and tribulations of
> > learning and using Scala). What are the barriers to adopting Scala,
> > and what compelling advantages does Scala offer to seduce us past
> > those barriers. Every week I see more barriers coming down because the
> > keepers of Scala work hard to remove them, but almost as often I see
> > people pointing out new barriers. Has Scala reached critical mass, or
> > are we still waiting for it?
> >
> > Cheers, Eric
>
>
> - --
> Tony Morris
> http://tmorris.net/
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQEcBAEBAgAGBQJOZqF0AAoJEPxHMY3rBz0PPDQIALj1wwdbmZMTR/ttnk2QTxj1
> XDQMqzunboy8PlXwiaLrEF2kO7FsH9ocWzTOELeB+gECHt3+vj5BbpeENuHOqJBi
> kwq6pSAJE0qltoM7+noijFYzTbSJbQVn60Lc1iqP/msbO3M77c8h7ck8wgIPyFPi
> dKmIj1uXguoQl3JwsLTS0TvJcXD+ppUVZyu16nKtYRBREROtvsw0cXaU4FqmBa9y
> e8dj08MtXa1o6rDNliklgbxF/gOKsxjUFd/s+1JcLsehQ7KLQ9dXtsFzXPVvhw6K
> voHPEqg5Q5ciZK01Am+l1bN2wc54Km57WE5lgoZPdINtcQyP5FtahX2vaot7UK0=
> =U+4x
> -----END PGP SIGNATURE-----
Re: Is Scala the Next C++
I don't doubt you, Tony, but I'm curious about how you can demonstrate such a claim. Please don't keep us in suspense any longer!
About all I recall about C++ is "for (i = 0; i < n; i++)", and I hope to finish my life without ever encountering that little gem again in actual code.
--Russ P.
--
Find out about the Amazing Potential of Thorium: http://RussP.us/thorium.htm
Re: Is Scala the Next C++
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 07/09/11 15:07, Russ Paielli wrote:
> On Tue, Sep 6, 2011 at 3:40 PM, Tony Morris wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Anyone who tells you that Scala is too complex and is like C++
>> understands neither Scala, C++ and programming in general. I absolutely
>> guarantee you this, and I happy to demonstrate it to you.
>>
>
>
> I don't doubt you, Tony, but I'm curious about how you can demonstrate such
> a claim. Please don't keep us in suspense any longer!
>
> About all I recall about C++ is "for (i = 0; i < n; i++)", and I hope to
> finish my life without ever encountering that little gem again in actual
> code.
>
> --Russ P.
>
Scala and C++ are so wildly distinct and to hand-wave about proclaiming
that they are "complex" in "similar ways" unequivocally implies a
misunderstanding of all topics involved. One one point alone, Scala
includes (mostly) necessary complexity, while C++ does not.
Programming is complex, not Scala. Now let's stop being a bunch of
princesses and learn some stuff, instead of making shitty excuses about
being too "complex", especially when it is not.
Find me a list of languages that admit up-front the complexity of
programming itself, then goes out of its way to help the user/programmer
overcome that complexity and I can assure you scala appears somewhere
near the top, while C++ appears to be "competing against Java" as if it
is some virtuous goal.
It's no secret that many serious C++ programmers discover that templates
are turing-complete, writes programs in that system, then says, "surely
there is a better way" -- where do you think a lot of those Haskell/ML
programmers came from?
RE: Is Scala the Next C++
Scala is complex and smells like C++ !
One of my overview points in my first scala introduction, years ago, was
"C++ is back... mean as ever!"
... and then it went on to say
"Multiple inheritance, operator overloading, true generics, pass functions
around, simple syntax" ... I mean... c'mon, you have to see it!
For OO procedural people that have not experienced many languages, C++ was
the pinnacle of CS, the one multi-paradigm language. So many paradigms
there, I didn't get tired of it in over a decade, but had to move to Java
for another decade, which sucked. Now I have all of it back and so much
more. The syntax doesn't matter too much, the paradigms and clarity do.
Scala smells like C++ but it's so much more.
Interestingly, the same slide concluded with "Not for the faint of heart!".
I met a lot of developers that couldn't write *great* C++ code but were
decent coders when they managed to stay away from implicits, operators and
all that. I expect the exact same with scala - I think this is the reason
behind those "scala is too complex" debates, of which I just had one on
LinkedIn.
Mind you though, just as often I met people whose C++ code was just as bad
as their Java code, and their Java code is not one you want to debug and
maintain; many of their 'algorithms' often need re-writing and frequent
fixing... Again, the syntax doesn't matter, abstract problem solving
matters.
We will continue to have people saying scala is too complex, because they
will unknowingly try to use the wrong type bound in a covariant construct
and won't get to the end of it... or can't figure out how to get the value
out of an Option[Any] (hint: it's obviously some kind of container, you
could look for some get() methods, but you should really learn map()).
Scala is not a toy language - it's a serious one and it is complex. Is it
too complex? What does that question even mean?
-----Original Message-----
From: scala-debate [at] googlegroups [dot] com [mailto:scala-debate [at] googlegroups [dot] com]
On Behalf Of Tony Morris
Sent: September-06-11 6:41 PM
To: scala-debate [at] googlegroups [dot] com
Subject: Re: [scala-debate] Is Scala the Next C++
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Anyone who tells you that Scala is too complex and is like C++ understands
neither Scala, C++ and programming in general. I absolutely guarantee you
this, and I happy to demonstrate it to you.
If my motives are not clear, I am happy to demonstrate this to you because I
wish to convince you of this universally applicable attribute so that there
is one less person questioning statements that are so significantly departed
from reality and so we can move on. Win win.
On 07/09/11 06:45, Eric Kolotyluk wrote:
> I have recently seen a number of discussions around issues like "is
> Scala too complex, "is Scala too hard to learn," "Thinking in a
> language vs. thinking into a language." etc.
>
> I find these discussions fascinating as I often find myself on both
> sides of the fence. At times I find coding in Scala increasingly
> seductive and satisfying, at other times I try to read some of the
> advanced code and concepts I see people discussing and I feel like a
> moron who has no hope to ever grok what they mean, let alone simply
> understand it. Often I just have to be satisfied that I get the gist
> of it.
>
> This sort of reminds me of my experience with C++. I started trying
> the language as soon as there were competent compilers available and
> enjoyed the new learning experience, trying to sample as many new
> language features as I could and was generally able to master most of
> them. However, after a while I was not writing code as often and ever
> time I tried to start some new little project I found the start-up
> cost of having to relearn C++ too high and switched back to C as much
> as possible. My experience was that unless I used C++ continuously,
> the overhead of coding was too high.
>
> Eventually I took a class from Scott Meyers. My takeaway point from
> that class was that there were programmers and there were type
> designers. Type designers had to be very very good at type design. On
> the other hand, with well designed type libraries and APIs, being a C+
> + programmers was not so bad after all.
>
> After a while I did not do much C++ because I moved on to Objective-C
> because I drank of the NeXT Cool-Aid. I really took to Objective-C
> because it was was so much more simple to think in that language than
> C
> ++, and the NeXT types and APIs were awesome.
>
> Eventually I moved on to Java and almost immediately became addicted
> to the simplicity (over C++) and power (close to C++), but mostly to
> the garbage collection. There was a reason I used to love writing code
> in LISP.
>
> Eventually I had a job where I had to look at some C++ code again, but
> by then it was Microsoft C++ with ATL/COM. My first reaction was WTF?
> How did this language get so messed up? Fortunately I was senior
> enough I could just say "no way I am touching that!"
>
> Eventually Java became my de facto language and I became increasingly
> proficient with it. Then I started looking at Groovy and really liked
> how much more expressive Groovy was, with minimal added complexity. I
> found it hard to do much with Groovy because I could not convince my
> colleagues of its value. Then I found Scala and tried to learn it but
> had to bail because it was too confusing. But Scala is seductive!
> Eventually I found my way back and became relatively proficient with
> it. Yes, I can even write in a functional style and comprehend the
> value of it. But I still cannot convince my colleagues of its value
> either.
>
> Martin Odersky's Levels http://www.scala-lang.org/node/8610 reminds me
> very much of what I learned from Scott Meyers - that you do not need
> to grok all of Scala to be proficient and productive in using it. I
> personally hope to be able to transition some day from Java to Scala
> as my main working language, but at the same time I am mindful of what
> became of C++ because the geniuses who came up with ATL and COM.
>
> What I am hoping we might debate is: what is to prevent Scala from
> going the route of C++ (and maybe other trials and tribulations of
> learning and using Scala). What are the barriers to adopting Scala,
> and what compelling advantages does Scala offer to seduce us past
> those barriers. Every week I see more barriers coming down because the
> keepers of Scala work hard to remove them, but almost as often I see
> people pointing out new barriers. Has Scala reached critical mass, or
> are we still waiting for it?
>
> Cheers, Eric
- --
Tony Morris
http://tmorris.net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJOZqF0AAoJEPxHMY3rBz0PPDQIALj1wwdbmZMTR/ttnk2QTxj1
XDQMqzunboy8PlXwiaLrEF2kO7FsH9ocWzTOELeB+gECHt3+vj5BbpeENuHOqJBi
kwq6pSAJE0qltoM7+noijFYzTbSJbQVn60Lc1iqP/msbO3M77c8h7ck8wgIPyFPi
dKmIj1uXguoQl3JwsLTS0TvJcXD+ppUVZyu16nKtYRBREROtvsw0cXaU4FqmBa9y
e8dj08MtXa1o6rDNliklgbxF/gOKsxjUFd/s+1JcLsehQ7KLQ9dXtsFzXPVvhw6K
voHPEqg5Q5ciZK01Am+l1bN2wc54Km57WE5lgoZPdINtcQyP5FtahX2vaot7UK0=
=U+4x
-----END PGP SIGNATURE-----
Re: Is Scala the Next C++
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I have not yet seen the statement, "Scala is [too] complex" where the
statement is not merely an anti-intellectual sentiment euphemising a
significant lack of understanding and an adamant assertion that that
lack of understanding is immutable. Inviting the surprise of a
counter-example...
On 07/09/11 14:06, Razvan Cojocaru wrote:
> Scala is complex and smells like C++ !
>
> One of my overview points in my first scala introduction, years ago, was
> "C++ is back... mean as ever!"
>
> ... and then it went on to say
>
> "Multiple inheritance, operator overloading, true generics, pass functions
> around, simple syntax" ... I mean... c'mon, you have to see it!
>
> For OO procedural people that have not experienced many languages, C++ was
> the pinnacle of CS, the one multi-paradigm language. So many paradigms
> there, I didn't get tired of it in over a decade, but had to move to Java
> for another decade, which sucked. Now I have all of it back and so much
> more. The syntax doesn't matter too much, the paradigms and clarity do.
>
> Scala smells like C++ but it's so much more.
>
> Interestingly, the same slide concluded with "Not for the faint of heart!".
> I met a lot of developers that couldn't write *great* C++ code but were
> decent coders when they managed to stay away from implicits, operators and
> all that. I expect the exact same with scala - I think this is the reason
> behind those "scala is too complex" debates, of which I just had one on
> LinkedIn.
>
> Mind you though, just as often I met people whose C++ code was just as bad
> as their Java code, and their Java code is not one you want to debug and
> maintain; many of their 'algorithms' often need re-writing and frequent
> fixing... Again, the syntax doesn't matter, abstract problem solving
> matters.
>
> We will continue to have people saying scala is too complex, because they
> will unknowingly try to use the wrong type bound in a covariant construct
> and won't get to the end of it... or can't figure out how to get the value
> out of an Option[Any] (hint: it's obviously some kind of container, you
> could look for some get() methods, but you should really learn map()).
>
> Scala is not a toy language - it's a serious one and it is complex. Is it
> too complex? What does that question even mean?
>
> -----Original Message-----
> From: scala-debate [at] googlegroups [dot] com [mailto:scala-debate [at] googlegroups [dot] com]
> On Behalf Of Tony Morris
> Sent: September-06-11 6:41 PM
> To: scala-debate [at] googlegroups [dot] com
> Subject: Re: [scala-debate] Is Scala the Next C++
>
> Anyone who tells you that Scala is too complex and is like C++ understands
> neither Scala, C++ and programming in general. I absolutely guarantee you
> this, and I happy to demonstrate it to you.
>
> If my motives are not clear, I am happy to demonstrate this to you because I
> wish to convince you of this universally applicable attribute so that there
> is one less person questioning statements that are so significantly departed
> from reality and so we can move on. Win win.
>
> On 07/09/11 06:45, Eric Kolotyluk wrote:
>> I have recently seen a number of discussions around issues like "is
>> Scala too complex, "is Scala too hard to learn," "Thinking in a
>> language vs. thinking into a language." etc.
>
>> I find these discussions fascinating as I often find myself on both
>> sides of the fence. At times I find coding in Scala increasingly
>> seductive and satisfying, at other times I try to read some of the
>> advanced code and concepts I see people discussing and I feel like a
>> moron who has no hope to ever grok what they mean, let alone simply
>> understand it. Often I just have to be satisfied that I get the gist
>> of it.
>
>> This sort of reminds me of my experience with C++. I started trying
>> the language as soon as there were competent compilers available and
>> enjoyed the new learning experience, trying to sample as many new
>> language features as I could and was generally able to master most of
>> them. However, after a while I was not writing code as often and ever
>> time I tried to start some new little project I found the start-up
>> cost of having to relearn C++ too high and switched back to C as much
>> as possible. My experience was that unless I used C++ continuously,
>> the overhead of coding was too high.
>
>> Eventually I took a class from Scott Meyers. My takeaway point from
>> that class was that there were programmers and there were type
>> designers. Type designers had to be very very good at type design. On
>> the other hand, with well designed type libraries and APIs, being a C+
>> + programmers was not so bad after all.
>
>> After a while I did not do much C++ because I moved on to Objective-C
>> because I drank of the NeXT Cool-Aid. I really took to Objective-C
>> because it was was so much more simple to think in that language than
>> C
>> ++, and the NeXT types and APIs were awesome.
>
>> Eventually I moved on to Java and almost immediately became addicted
>> to the simplicity (over C++) and power (close to C++), but mostly to
>> the garbage collection. There was a reason I used to love writing code
>> in LISP.
>
>> Eventually I had a job where I had to look at some C++ code again, but
>> by then it was Microsoft C++ with ATL/COM. My first reaction was WTF?
>> How did this language get so messed up? Fortunately I was senior
>> enough I could just say "no way I am touching that!"
>
>> Eventually Java became my de facto language and I became increasingly
>> proficient with it. Then I started looking at Groovy and really liked
>> how much more expressive Groovy was, with minimal added complexity. I
>> found it hard to do much with Groovy because I could not convince my
>> colleagues of its value. Then I found Scala and tried to learn it but
>> had to bail because it was too confusing. But Scala is seductive!
>> Eventually I found my way back and became relatively proficient with
>> it. Yes, I can even write in a functional style and comprehend the
>> value of it. But I still cannot convince my colleagues of its value
>> either.
>
>> Martin Odersky's Levels http://www.scala-lang.org/node/8610 reminds me
>> very much of what I learned from Scott Meyers - that you do not need
>> to grok all of Scala to be proficient and productive in using it. I
>> personally hope to be able to transition some day from Java to Scala
>> as my main working language, but at the same time I am mindful of what
>> became of C++ because the geniuses who came up with ATL and COM.
>
>> What I am hoping we might debate is: what is to prevent Scala from
>> going the route of C++ (and maybe other trials and tribulations of
>> learning and using Scala). What are the barriers to adopting Scala,
>> and what compelling advantages does Scala offer to seduce us past
>> those barriers. Every week I see more barriers coming down because the
>> keepers of Scala work hard to remove them, but almost as often I see
>> people pointing out new barriers. Has Scala reached critical mass, or
>> are we still waiting for it?
>
>> Cheers, Eric
>
>
Re: Is Scala the Next C++
If you are unhappy with the dialog then I recommend you go somewhere where you can be happy with the dialog. This type of comment is not welcome.
Sincerely, Eric
On Tue, Sep 6, 2011 at 3:40 PM, Tony Morris <tonymorris [at] gmail [dot] com> wrote:
Re: Is Scala the Next C++
It was a promise.
On 07/09/2011 9:23 AM, "Eric Kolotyluk" <eric [dot] kolotyluk [at] gmail [dot] com> wrote:> Was that intended to be information - or are you just trying to insult as
> many people as possible?
>
> If you are unhappy with the dialog then I recommend you go somewhere where
> you can be happy with the dialog. This type of comment is not welcome.
>
> Sincerely, Eric
>
> On Tue, Sep 6, 2011 at 3:40 PM, Tony Morris <tonymorris [at] gmail [dot] com> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Anyone who tells you that Scala is too complex and is like C++
>> understands neither Scala, C++ and programming in general. I absolutely
>> guarantee you this, and I happy to demonstrate it to you.
>>
>> If my motives are not clear, I am happy to demonstrate this to you
>> because I wish to convince you of this universally applicable attribute
>> so that there is one less person questioning statements that are so
>> significantly departed from reality and so we can move on. Win win.
>>
>> - --
>> Tony Morris
>> http://tmorris.net/
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.10 (GNU/Linux)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>>
>> iQEcBAEBAgAGBQJOZqF0AAoJEPxHMY3rBz0PPDQIALj1wwdbmZMTR/ttnk2QTxj1
>> XDQMqzunboy8PlXwiaLrEF2kO7FsH9ocWzTOELeB+gECHt3+vj5BbpeENuHOqJBi
>> kwq6pSAJE0qltoM7+noijFYzTbSJbQVn60Lc1iqP/msbO3M77c8h7ck8wgIPyFPi
>> dKmIj1uXguoQl3JwsLTS0TvJcXD+ppUVZyu16nKtYRBREROtvsw0cXaU4FqmBa9y
>> e8dj08MtXa1o6rDNliklgbxF/gOKsxjUFd/s+1JcLsehQ7KLQ9dXtsFzXPVvhw6K
>> voHPEqg5Q5ciZK01Am+l1bN2wc54Km57WE5lgoZPdINtcQyP5FtahX2vaot7UK0=
>> =U+4x
>> -----END PGP SIGNATURE-----
>>
Re: Is Scala the Next C++
On Tue, Sep 6, 2011 at 4:23 PM, Eric Kolotyluk wrote:
> Was that intended to be information - or are you just trying to insult as
> many people as possible?
i'll take the other tack and ask Tony to please, yes, describe the
core differentiating issue. :-)
sincerely.
Re: Is Scala the Next C++
On Tue, Sep 6, 2011 at 4:45 PM, Eric Kolotyluk wrote:
> What I am hoping we might debate is: what is to prevent Scala from
> going the route of C++
Good Scala code — and I mean good ordinary Scala code, not just the
cutting-edge stuff some people are experimenting with — is a joy to
read and write. Whereas even the best C++ code is... C++. As you say,
"Scala is seductive." C++ is not. I suggest you tune out the FUD and
trust in the pleasure you've experienced writing Scala.
Any resemblance between Scala and C++ is superficial. Scala isn't C++,
and besides, that was then, this is now. There isn't an older language
that's analogous to Scala except in limited respects. Not C++, and not
anything else. But somehow the human mind can't accept that, it wants
to find some X and think, "Scala is the new X". That's how we approach
something new, is by comparing it to our past experience. (My own mind
tends to make parallels between Scala and Common Lisp, the last
industrial-strength language I really enjoyed programming in.)
So I understand the thought path that leads people to draw analogies
between Scala and C++. But those analogies are, for the most part,
unhelpful. Scala isn't the new X. It's Scala. Have fun with it!
Re: Is Scala the Next C++
I am not trying draw a resemblance between C++ the language and Scala the language, but between advent and conclusions of these languages.
The trend I see in Computing Science is language design is like a pendulum swinging back and forth between features and simplicity. We keep adding more features until the language becomes to complicated - like Basic, Fortran, Cobol, PL/1, C++ etc, then we find more simple and elegant ways to design languages like C, Pascal, Java. Sometimes we can add more features without compromising simplicity and elegance, such as Groovy.
The point I am making is I don't exactly know where Scala is on this pendulum ride yet - and I am trying to understand that from the perspectives other people have.
I'm pretty sure C++ concluded badly. I have no idea how Scala will conclude.
Cheers, Eric
Re: Is Scala the Next C++
I disagree -- the pendulum is between features and *abstraction*. Features get added willy-nilly until languages get messy; then people step back, understand what's really going on, and pull things up a level of abstraction, which makes it all look simpler again. Scala's a good example here, one of a collection of newer languages that have attempted to raise the abstraction level; in practice, Scala does a better job than most.
The problem is that each of these abstraction changes requires changes in how you *think* about programs, and that's the source of much of the disconnect about whether Scala is "simple". Scala is definitely *elegant*. Whether it looks simple or not depends mostly on whether you've internalized the abstractions that you need for the level of the language that you're using...
Re: Is Scala the Next C++
OK, I can accept *abstraction* instead of simplicity, especially in the context of Scala - but there 'is' this pendulum I am talking about.
C++ brought more abstraction too, but somewhere along the way the "willy-nilly" part got the better of it. I'm not sure if Java created more abstraction over C++, but it really showed you could do more with less.
I would also agree that these new language designs require that we change how we think about programs - especially if we want to learn to write better, more elegant code.
Some of the problem of C++ were not exactly in the language itself, but how people used the language. For example, Hungarian Notation. This was no fault of the language designers, but IMHO a tragic fad many people adopted that added a enormous amount to noise to the code. Similarly, COM has nothing to do with the C++ language per se, but when you look at the massive amount of job postings years ago that required C++/COM experience, it is hard to separate the two.
So, one concern of mine is what possible things out there could affect Scala in a similar way? How can we avoid or minimize such misadventures?
The one thing I have learned about using Scala is I personally needed to evolve my thinking about how to write code if I wanted to write better code. To be sure, Scala makes it easy to write code exactly the way you would in Java, and slightly nicer, but the real benefits only come by leveraging the higher layers of abstraction.
However, Scala is exceedingly feature rich, with many nuances. Similar to my C++ experience is that you don't write code on a regular basis you can forget how the nuances work. What can we learn from this experience?
These days I genuinely cannot read contemporary C++/COM code - my mind freezes up. Fortunately there are fewer reasons to have to read such code. let alone write it.
However, there is also a lot of Scala code that causes my mind to freeze up. Not necessarily because it is bad code, rather that I have not learned yet to think sophisticatedly enough to grok it. On the other had because I do not understand it, I cannot ever say if it is good or bad code.
Cheers, Eric
Re: Is Scala the Next C++
That's an odd take, and I don't think hungarian notation has much to do with what happened to C++. I wrote hundreds of thousand of lines of C++ between 1985 and 1995 and hardly any of it contained any hungarian notation because most of that code was running on UNIX, not Windows.
The main problem with C++ is that it had to remain source compatible with C, and this constrained the language in ways that slowly led it to be what it is today.
Just like C++, Scala is trying to be a multi-paradigm language that maintains binary (not source, as opposed to C++) compatibility with Java, and this is taking a toll on its syntax and semantic in many ways.
-- Cédric
Re: Is Scala the Next C++
On 2011-09-07 5:51 AM, Cédric Beust ♔ wrote:
Yes, it is an odd take. When I had to look at some legacy C++ code it was rife with Hungarian notation and I have since formed a strong connection between the two. More importantly, the parallel I drew from the experience was that C++ and Hungarian Notation are indicative of the senseless increase in complexity in coding of the era, even those they are both completely separate things.
I have seen many bitter arguments that Java's biggest fault was that it try to remain similar to C, and I can appreciate that point of view. However, this similarity to C is pragmatically what made it easy for people to adopt Java. However, Java is not source compatible with C and avoided that particular problem C++ has.
And, Scala is similar to Java, but not source compatible. The Scala language designers have done a good job of balancing pragmatism with innovation, but it indeed has come at some cost of some trouble in syntax and semantics. My hope is that with enough sugaring we don't have to see those troubles too often, but I wonder what other problems may lurk under the surface of all the sugar.
Cheers, Eric
Re: Is Scala the Next C++
2011/9/7 Eric Kolotyluk :
> And, Scala is similar to Java, but not source compatible.
This can't be emphasized enough. Scala takes on a certain amount of
baggage from Java, but it's hardly comparable to the baggage C++ took
on by remaining source compatible with C.
Re: Is Scala the Next C++
* : recursive love.
2011/9/7 Justin du coeur <jducoeur [at] gmail [dot] com>
--
Alex REPAIN
ENSEIRB-MATMECA - student
TECHNICOLOR R&D - intern
BORDEAUX I - master's student
SCALA - enthusiast