On 8/25/10 08:55 , Kevin Wright wrote:
>
> http://michid.wordpress.com/2010/08/24/so-scala-is-too-complex/
>
> I'm curious, does anyone have an example of the same problem being
> solved in both Java and Scala, with Java offering the simplest
> solution?
>
Copying the response I posted to that blog:
If you used e.g. Lombok which auto-generates all the
getter/setter/toString plumbing code via annotations and e.g. lambdaj
that allows to use closure-like filtering on collections, the Java
listing would be just a bit longer than the Scala listing. Which
proves how often people asserting Scala being better than Java aren't
completely aware of all the possibilities that Java offers. :-)
- --
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
java.net/blog/fabriziogiudici - www.tidalwave.it/people
Fabrizio...@tidalwave.it
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkx0z1wACgkQeDweFqgUGxdA7ACgsWGCS+pU0lWGPCX/T+5DPk1o
8tAAniDG7uNVDSPYTKRSKjHdBMnjZ/2p
=DZB/
-----END PGP SIGNATURE-----
On 8/25/10 10:25 , Kevin Wright wrote:
> lombok hooks into the compiler, extending Java code to allow some
> code generation. So it's not unreasonable to consider Java+Lombok
> to be a distinct language from Java or even an extension/evolution
> of Java.
>
> Scala reuses Java syntax as much as possible, changing it where
> necessary to add functional constructs and type inference. So
> it's not unreasonable to consider Scala an extension/evolution of
> Java.
>
> So comparing Scala to JavaLombokLambdaJ (JLL) is emphatically
> *not* the same as comparing Scala to Java.
This is pretty much philosophy :-) while I think we're discussing how
to practically do things. My point is that Java is a *simple* language
with a reasonable set of extension points to tailor it to people's
needs (and these extension points have been designed purportedly, i.e.
Lombok is not playing any "trick", it's just using a feature -
annotations and compiler extensions - that has been put there for that
purpose). This means that different people can extend Java in
different ways, if they want. Scala has got everything out-of-the-box:
right, that's why I'm saying that it's more *complex*.
>
>
> However, if you do compare Scala to JLL, three things stand out: -
> JLL is driven by annotations, so it's not a seamless integration
> that looks like part of the language
As I said, annotations are a natural part of the language.
> - JLL does everything with reflection, adding a performance cost
> that could be critical in some domains
Lombok doesn't use annotations, but code generation at compile time.
lambdaj is using some reflection and has some performance hit. It's to
be seen how strong it is, in any case, and we can't just decide
without a case study. I'd also argue that complex list filtering that
are performance-critical are probably best to be done in the database,
rather than in the language (e.g. I don't think it's advisable in a
common scenario to load 1,000,000 of persons in memory to pick those
younger than 18). This is just a counter-example, of course.
> - You still don't have pattern matching, or type classes, or etc,
> etc...
Yes. Maybe I don't need them? :-P Seriously, I've said multiple times
that Scala is more powerful. It's to be said if all that
extra-complexity is really needed. I'm still on the side "Less is More".
- --
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
java.net/blog/fabriziogiudici - www.tidalwave.it/people
Fabrizio...@tidalwave.it
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkx02RoACgkQeDweFqgUGxf4wACfTQ6jUiAUH/nb6Ieu4ccvDg+6
AZsAn1uf0JzS9L7u5wpOb95WBSM7+Vrr
=j3kd
-----END PGP SIGNATURE-----
--You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
I'm suprised that nobody notice that this example is pretty much irrelevant (if not plain stupid).Basically, you can write this in a very small manner in Scala just because list object in Scala has a "partition" method). Most of the extra code in Java is just about code the partition method. If you remove the part regarding coding the partition method, the Java code pretty much look like the Scala code.
The code behind partition: http://lampsvn.epfl.ch/trac/scala/browser/scala/tags/R_2_8_0_final/src//library/scala/collection/TraversableLike.scala#L311
def partition(p: A => Boolean): (Repr, Repr) = {
val l, r = newBuilder
for (x <- this) (if (p(x)) l else r) += x
(l.result, r.result)
}
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
Sure, how about this:
var y = -1; // why the initialization?? so complicated
if(x > 5)
y = x;
else
y = 5;
versus
final int y; // ahh, definite assignment, so simple (*)
if (x > 5) {
y = x;
} else {
y = 5;
}
Then there's the security aspect.
private[yourscopehere] def getRootAccess() = {
// this better not be public
}
I'm sure there's more, but I'm also sure the rules are about to shift
in Scala's favor. Again.
With kind regards
Ben
(*) Generally I would list definite assignment as making Java more
complicated, but sine the code is more concise and closer to the
intent....
> mail/google talk: kev.lee.wri...@gmail.com
On 25 Aug., 08:55, Kevin Wright <kev.lee.wri...@gmail.com> wrote:
> http://michid.wordpress.com/2010/08/24/so-scala-is-too-complex/
>
> <http://michid.wordpress.com/2010/08/24/so-scala-is-too-complex/>I'm
> curious, does anyone have an example of the same problem being solved in
> both Java and Scala, with Java offering the simplest solution?
>
> --
> Kevin Wright
>
> wave: kev.lee.wri...@googlewave.com
> skype: kev.lee.wright
> twitter: @thecoda
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
Oh my god, it was an example and supposed to illustrate the hypocrisy
of the argument. I even added a footnote.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
http://michid.wordpress.com/2010/08/24/so-scala-is-too-complex/
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
I think the idea is that where code in java is equal to or not much
longer than its scala equivalent, the java version wins because java
is simpler to understand.
There also some pragmatic concerns, for
example, interopping java 1.1-targeted library code with code written
against java 1.6 isn't all that difficult, whereas writing scala 2.8
and using a library written in scala 1.0 is not going to work very
well.
On Aug 25, 8:55 am, Kevin Wright <kev.lee.wri...@gmail.com> wrote:> mail/google talk: kev.lee.wri...@gmail.com
> http://michid.wordpress.com/2010/08/24/so-scala-is-too-complex/
>
> <http://michid.wordpress.com/2010/08/24/so-scala-is-too-complex/>I'm
> curious, does anyone have an example of the same problem being solved in
> both Java and Scala, with Java offering the simplest solution?
>
> --
> Kevin Wright
>
> wave: kev.lee.wri...@googlewave.com
> skype: kev.lee.wright
> twitter: @thecoda
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
Shows pretty much exactly what's wrong with scala, doesn't it? Short,
yes. Complicated? You bet. This partition method is absolutely
horrible. Let's dissect it. Note that I renamed l and r to left and
right for clarity, l looks like a pipe. Also, using 'l' as a variable
name shows someone has taken 'shorter code is better' FAR too
literally. Only a minor nit in this case, as with methods that are
this short, confusion about variable names isn't going to be a big
issue.
> val left, right = newBuilder
Hmm, this is really weird. In java, this would mean "left" is
unassigned and cannot be used until it has been. Apparently in scala
this is short for val l = newBuilder, r = newBuilder. It is NOT
equivalent to val l, r; l = r = newBuilder; either, because clearly l
and r do not end up with the same object reference, but two separate
ones. This is highly confusing to me (read: Not at all what I expected
would happen, I'm only deducing it by starting with the assumption
that this code works). If this is how scala ends up with shorter code,
I don't want it.
> (if p(x) left else right) += x;
In java there's a more or less long-standing hatred of using
assignments, which are legally expressions, as anything but a
statement. i.e. folks frown on this kind of thing: int x = 5 + y = 10;
even though it is technically legit java code. This feels similar,
using the result of an if expression as the target of an assignment.
For example, while its a few characters longer, I find this much more
readable:
if (p(x)) l += x;
else r += x;
Using ifs as expression is a nice gimmick that tends to lead, IMO, to
hard to read code.
Just like assignment-as-expression. Yet again, a
source of making your code smaller which only hurts readability (i.e.
nice for code golfing, but a bad idea otherwise). This form of if
statement is of course perfectly legal in java code. The += part of it
is not, but, that's up next:
list += x;
This is where scala shows how complex does equal complicated. In java,
such a statement means either (A) string concatenation, (B) floating
point arithmetic addition, or (C) integer arithmetic addition. I find
the idea that it could mean string concatenation unelegant, but B and
C work together nicely: It's all arithmetic addition. I'd love for
java to add a feature that you can use the + symbol to add up two
BigIntegers or two BigDecimals, as, yet again, its arithmetic
addition. Scala allows operator overloading and started with the best
of intentions (this way the authors of BigInteger and BigDecimal can
fix it themselves!) and screwed it up by now apparently letting "+="
mean list appending. What a silly notion. How the heck does this
improve readability? It only detracts. And you save exactly 3
characters compared to .add(x). Big whoop. This is EXACTLY why some
people think operator overloading causes more trouble than its worth.
For the third time in a row: If this is how scala leads to shorter
code, count me out.
At the same time there are some legitimately nice features here. "val"
is nice, and could easily be added to java, with "final" taking its
role: "final x = 10;" would then be legal and infer 'int' as x's type.
Also, returning tuples is borderline nice, though it does lead to a
suspicious lack of named types. Not that convinced personally about
'last expression is return statement', but that's clearly a purely
stylistic concern.
It is, however, worth noting that sticking a return
in front of that really doesn't hurt readability, it might even
improve it, though this is again the shortest possible way you could
go. i.e. Martin Odersky is in love with code golfing, and equating
code golfing to elegant language design seems misguided to me.
Conclusion: Scala will never be the next big thing, because along with
the nice syntactical cleanups, it's falling into the academia trap:
It's been so focused on making such trivial little code snippets look
good at a casual glance, it completely forgot that in practice, code
reading is about trying to make sense of 500kloc filled with obscure
bug fixes, domain specific knowledge, and the occasional WTF code.
And
that's not fixable by peddling the old "just hire really good
programmers" spiel. I fully agree with that, but even the biggest
genius has off days. That must be true because even I sometimes look
back at code I wrote a few months ago and get the sudden urge to punch
myself for being such an idiot :P
A language that cleans up a few things without falling into that trap
might fare better but I fear the difference won't be convincing enough
to make folks switch. Crappy catch 22 situation, that.
NB: Also worth considering: No language EVER has become truly gigantic
by offering nice syntax. Instead, the languages that won tended to
offer really crappy syntax but provided something else, not related to
syntax, that caused mass conversion. C did not attempt to abstract
away the bare metal too much but did offer standardization across
platforms. Java brought the garbage collector, very nice (at the time,
at any rate) portable multithreading, and seamless freedom of moving
to different hardware, "seamless" defined as relative to your options
before it came out, all WITHOUT a radical new syntax.
This is why I firmly believe the next big programming language has yet
to be invented, and will involve a similarly crappy syntax, but offers
language-level module systems, language evolvability, AST-based
editing, compiler plugin based DSL enabling, extensive static
analysis, and other such features that aren't intricately involved
with Martin Odersky managing to remove another character from the
partition method.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
Tuple assignment works brilliantly in Python and seems to in Scala as
well. Tuple assignment solves so many problems that lead to clumsy,
often unreadable and incomprehensible code in those languages that do
not support it. You may not want it, but I do.
> > (if p(x) left else right) += x;
>
> In java there's a more or less long-standing hatred of using
> assignments, which are legally expressions, as anything but a
> statement. i.e. folks frown on this kind of thing: int x = 5 + y = 10;
> even though it is technically legit java code. This feels similar,
> using the result of an if expression as the target of an assignment.
> For example, while its a few characters longer, I find this much more
> readable:
>
> if (p(x)) l += x;
> else r += x;
You may do so but I do not, I think it looks truly archaic. And where
has this "hatred of using assignments. . .[as expressions]" in Java come
from, I don't see it, exactly the opposite, there is an increasing use
of expression-based and value-based working.
> Using ifs as expression is a nice gimmick that tends to lead, IMO, to
> hard to read code. Just like assignment-as-expression. Yet again, a
Exactly, in your opinion. In my opinion you are looking back fondly to
the days of assembly language programming. There is a crucial
difference between simplicity of expression and expressivity.
Simplicity of expression is important for readability -- there are
experiments happening to show this, it's not research by expounding
opinion. Similarly there is experimentation to show that having the
simple expression express high-level algorithmic things rather than
low-level algorithmic things leads to faster code writing and easier
maintainability. Again there is experiment, this is not just attempting
to create facts by writing opinion often enough that people think it's
fact. The keywords to search for are "psychology of programming",
"program comprehension", etc., etc.
[ . . . ]
> characters compared to .add(x). Big whoop. This is EXACTLY why some
> people think operator overloading causes more trouble than its worth.
> For the third time in a row: If this is how scala leads to shorter
> code, count me out.
"Some people think": so this could be a very small minority. Just
because Java eschewed operator overloading doesn't make it right.
OK so after a count of three you are counted out. Fine. Let the rest
of us move on and become better programmers by using more modern and
appropriate techniques than you think is good for us.
[ . . . ]
> go. i.e. Martin Odersky is in love with code golfing, and equating
> code golfing to elegant language design seems misguided to me.
Presenting you opinion as though it were fact or even the majority
opinion seems misguided to me. As is attributing opinions to other
people.
> Conclusion: Scala will never be the next big thing, because along with
> the nice syntactical cleanups, it's falling into the academia trap:
So academic is now a synonym for bad. This is what really riles me up,
the implicit view that a language that comes out of academic is of less
value than a language developed in a company.
Programming languages can be developed in companies (C, Java, Go) or in
academia (Lisp, Scheme, Scala) or a mix of both (Fortran, C++, Cobol,
Smalltalk, Self). The important point is that whatever their genesis, a
language has a supportive community and is maintained professionally.
Academics generally have the freedom to be more experimental, certainly
there are more new languages emanating from academia, most of which
rapidly fall by the wayside, but where one catches on, as long as it
performs the transition from academic experiment, to professionally
maintained product that is good and fine. Afterall technology transfer
of ideas from academia into industry and commerce is what most venture
funding is all about.
So can we have less of "academic == bad".
> It's been so focused on making such trivial little code snippets look
> good at a casual glance, it completely forgot that in practice, code
> reading is about trying to make sense of 500kloc filled with obscure
> bug fixes, domain specific knowledge, and the occasional WTF code. And
> that's not fixable by peddling the old "just hire really good
> programmers" spiel. I fully agree with that, but even the biggest
> genius has off days. That must be true because even I sometimes look
> back at code I wrote a few months ago and get the sudden urge to punch
> myself for being such an idiot :P
To be honest you just made the argument for Scala and against Java.
> A language that cleans up a few things without falling into that trap
> might fare better but I fear the difference won't be convincing enough
> to make folks switch. Crappy catch 22 situation, that.
In your opinion. Many other people have a very different opinion. If I
can write what takes 500kloc of Java in 100kloc of Scala, then it is
far more likely that the latter will be more comprehensible and
therefore more maintainable. If it takes 50kloc of Python it is
probably even better.
> NB: Also worth considering: No language EVER has become truly gigantic
> by offering nice syntax. Instead, the languages that won tended to
> offer really crappy syntax but provided something else, not related to
> syntax, that caused mass conversion. C did not attempt to abstract
> away the bare metal too much but did offer standardization across
> platforms. Java brought the garbage collector, very nice (at the time,
> at any rate) portable multithreading, and seamless freedom of moving
> to different hardware, "seamless" defined as relative to your options
> before it came out, all WITHOUT a radical new syntax.
I think you should re-evaluate your knowledge of programming history:
Machine code
Assembly language
Fortran / Cobol / Lisp
Pascal
C
C++ / Smalltalk / Perl
Java / Python
A lot of syntax going on there. Almost all of it related to making a
simple looking statement carry a very large amount of meaning.
> This is why I firmly believe the next big programming language has yet
> to be invented, and will involve a similarly crappy syntax, but offers
> language-level module systems, language evolvability, AST-based
> editing, compiler plugin based DSL enabling, extensive static
> analysis, and other such features that aren't intricately involved
> with Martin Odersky managing to remove another character from the
> partition method.
Point 1, you owe Martin Odersky an apology for the slurs on his
character you have made in this posting.
Point 2, you are describing Scala, Groovy, JRuby on the JVM and Python,
Ruby, D, Go, etc. off it. Well except for the static analysis in Groovy
JRuby, Python, and Ruby. You are making the assumption that statically
compiled programming languages are of more merit than dynamic ones.
This may be your opinion, but I bet the majority of people have a
different one, more along the lines of statically types and dynamically
typed languages both have their place in developing a system.
AST-based editing is a completely different issue. There were systems
doing this available in 1985, but they were not deemed to be appropriate
enough for proper software development environments, everything had to
be files based. So the whole IDE industry rejected exactly that which
was available and they are now having to reconstruct ASTs based on plain
text files. Bizarre.
I had thought of trying to write a shorter reply, but it is too early in
the morning.
--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel...@ekiga.net
41 Buckmaster Road m: +44 7770 465 077 xmpp: rus...@russel.org.uk
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
So, val l, r = newBuilder works because newBuilder is a method, and
this method returns a tuple?
Good lord. I rest my case!
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
will involve a similarly crappy syntax
offers language-level module systems
language evolvability
AST-based editing
compiler plugin based DSL enabling
extensive static analysis
and other such features that aren't intricately involved with Martin Odersky managing to remove another character from the
partition method.
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
val left, right = newBuilder
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
Gosh .. I am sorry but are you saying that Scala is for the experts and Java for regular people like me???Do you think that is the good way to promote Scala??? I hope you are wrong otherwise the futureof Scala looks very grim.And of course a language can give you ALOT MORE than syntax sugar. Just read Reinier's emailNow I have been trying to avoid Scala vs Java argument for a while but same people keep looking for samearguments over and over (its getting really annoyed). So let me ask you ... why on earth do you people think you need to trashJava in order to promote Scala????? Scala runs on JVM damn it so even Scala does things betterdoes not mean Java cannot do it. Boiler plate is not much of a problem when you use something like lombok toremove most of them. I am learning Scala at home and at work I use Java and Erlang. I never feel using one languageover another can give me that much of an advantage, though the abundance of Java libraries and tools does make difference.I heard people saying Java is the next cobol or is dead, to me those are just fanboy talks and no offense but I hate any kind of fanboy.As far as I see Java is still dominating the dev world and will not be changed in the foreseeable future.By the way, before you think Scala will take over the world someone please fix the tools first. They suck badand please dont tell me tools dont matter unless you want to go back to the stone age.Sorry Josh, the last paragraph is not targeted you
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
Hell, I didn't receive updates from this thread for a couple of days...
I'd like to comment this point from Kevin:
"I refuse to accept any philosophy that is fundamentally based on the
premise that people are stupid"
There's a serious flaw in this statement, and it's the use of the
"stupid" word. It might be intentional or not, but that statement
seems to put the counterpart in an unease position. Indeed, in a
general discussion I would have no problems in replying "well, Kevin,
people are stupid indeed and you're not realistic" :-) but the
discussion would drift off and not converge in any way, because we
can't measure stupidity being a subjective point.
So, I instead re-write the statement to more precisely describe my
philosophy as a Scala skeptic:
"I refuse to accept any philosophy that is fundamentally based on the
premise that people are unexperienced".
Now, experience can be measured and I can safely assert that indeed
most of developers are unexperienced. This is because most of school /
universities don't prepare them, and mostly because corporates don't
spend enough on continuous learning. Developers are the first ones to
agree with this position, expressing their frustration for being
forced to face with problems that they weren't prepared to solve. This
is a fact and if you don't agree, well you're lucky and live in a very
privileged niche of the world.
I think that the very big problem of the Scala community is
evangelism. Independently from the technical merit or demerits of the
language, I'm constantly seeing every try to promote the language
being contextualized in an unrealistic world. It's a sort of reality
distortion field � la Jobs. No big surprise that most people who're in
charge of making decisions in a corporate quit any interest in Scala
after a few minutes of discussion (for instance, this has been my
personal experience a couple of years ago - I don't recall whether it
was JavaOne or Devoxx - after a few of those people that I knew were
attending with me a speech by Odersky). This is confirmed by the
typical evangelism by Odersky, when I read things such as the ones
posted in the blog that Mario referred to. Re: that, I'm just copying
a comment that I posted to Mario's points at Dzone (see below). Until
the Scala community doesn't change the evangelism style they're
following, Scala will stay confined where it is.
I think that Odersky arguments are blatantly biased, as usual. Take
the smartphone example. In the world the choice is not restricted to
the two extrema, a morse equipment and a smartphone. There are many
intermediate phones in the middle, such as those only with a set of
fundamental set of features and a decluttered user interface.
Now, what's a phone for? To call people and speak. Compare two
persons, one enjoying his smartphone and one enjoying his normal
phone, and see them calling a friend. I don't see but marginal
differences in how they place the call; after that, what matters is
what they have to say to their friends (a metaphor for good
architecture and design practices).
Of course, smart users will enjoy the many things that a smartphone
offers. No doubt on that. But they are just a minority. Average users
will instead be confused by the more complex user interface. My
parents - and a lot of other people I know - find it very hard - if
not impossible - to place a call with a smartphone.
Not to say that a big deal of people are buying a smartphone for
fashion, and don't use but a fraction of the features it offers - a
waste of complexity.
So, the smartphone example is perfect for my point: Scala is more
powerful and fit for a minority of experienced programmers that can
handle its complexity; Java is simpler, less powerful and fit for the
average programmer.
- --
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
java.net/blog/fabriziogiudici - www.tidalwave.it/people
Fabrizio...@tidalwave.it
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkx3i7cACgkQeDweFqgUGxctlwCdGxdmtGvlXb6JHuXsUVjbpOPH
rSoAoICxnD15u1ELKEi169wCAg/mHROU
=3WMh
-----END PGP SIGNATURE-----
Myself, and the rest of the Scala evangelists on this list are going
to great pains to point out that: no, actually, Scala is for everyone.
I don't think that anyone here disagrees about how nasty SAM's are :)
On Fri, Aug 27, 2010 at 6:23 PM, Reinier Zwitserloot <rein...@gmail.com> wrote:
> I think virtually everybody disagrees with you; SAMs aren't nasty.
> Whatever makes you think they are?
>
> On Aug 27, 9:03 pm, Kevin Wright <kev.lee.wri...@gmail.com> wrote:
>> What really gets my goat though... It's the pro-java/anti-scala crowd
>> who are pushing the claim that "Scala is only for smart people".
>>
>> Myself, and the rest of the Scala evangelists on this list are going
>> to great pains to point out that: no, actually, Scala is for everyone.
>>
>> I don't think that anyone here disagrees about how nasty SAM's are :)
--
R. Mark Volkmann
Object Computing, Inc.
> ...
>
> read more »
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
Myself, and the rest of the Scala evangelists on this list are going
to great pains to point out that: no, actually, Scala is for everyone.
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
*delete as appropriateI once considered [weight lifting at the gym/learning functional programming]*but, as I'm a [fairly skinny guy/pure OO programmer]*I decided that I didn't have any [muscles to build up in the first place/need for pure functions]*and so it wasn't suitable for meIn fact, I've come to the conclusion that [FP/the gym]* is of limited use, and really wouldn't benefit everyoneAnd it really is so very difficult, especially for some of my less-capable colleagues!
----On 28 August 2010 14:55, Josh Berry <tae...@gmail.com> wrote:
2010/8/27 Cédric Beust ♔ <ced...@beust.com>On Fri, Aug 27, 2010 at 12:03 PM, Kevin Wright <kev.lee...@gmail.com> wrote:
Myself, and the rest of the Scala evangelists on this list are going
to great pains to point out that: no, actually, Scala is for everyone.Of course you realize that for the claim "Scala is for everyone" to be true, everybody needs to say so. And so far, only Scala evangelists do...
How do you feel about this statement, in light of the learning tool Kojo and grade schoolers using it to learn programming?--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
Kevin Wright
mail/google talk: kev.lee...@gmail.com
wave: kev.lee...@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
final List<Integer> myList = ImmutableList.of(1,2,3);final Function<Integer, Integer> f = new Function<Integer, Integer> {public Integer apply(Integer from) {return from * 2;}}final List<Integer> result = Lists.transform(myList, f);So yes, SAM types are nasty when compared to the alternative...
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
surely you mean "without taking away all the extra baggage that Scala removes"?
Having tried Pascal, C, C++, Scheme, Miranda, Java, Groovy and Python as
introductory programming languages over the years, I can say that of the
languages today for today's audiences Groovy and Python win hands down.
As a second language though C++, D, and Scala are strong contenders.
Python and C/C++/Cython are a very natural combination;
Groovy/Scala/Clojure/Java are a very natural combination.
--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel...@ekiga.net
41 Buckmaster Road m: +44 7770 465 077 xmpp: rus...@russel.org.uk
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
How do you feel about this statement, in light of the learning tool Kojo and grade schoolers using it to learn programming?
Well, let's ask them: how do these grade schoolers feel about Scala compared to Java?
This wasn't really the intent of my question. I was simply curious if you still feel that Scala "isn't for everyone." Where the implication seems to be that "not everyone can understand Scala."
Cédric
I don't see how your observation is relevant to this question because Kojo (which looks awesome, by the way) is basically a reimplementation of Logo in Scala. At the end of a Kojo class, the students still have no idea how to program in Scala.
--
"No idea" eh? I think that's exaggerated. They at least know enough Scala to use the Kojo library. Granted this is probably a very small subset of Scala, but still Scala nonetheless.
--
Cédric
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
Go on then... create the DSL in Javait must be possible to write the following fragment, in a .java file, so that it compiles and is checked by the compiler and continues to look like native syntax:repeat(4) {forward(100);right(90);}as a concession, I don't expect you to make it work without semicolons, as the Scala version does.
--
Cédric
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
I believe that response is an example of what psychiatrists term "deflection"
The point is that the kids programming in Kojo *are* using Scala. It maybe a subset, a DSL, call it what you will, but the type-checking, function composition, parsing, etc. rules are all pure Scala.It's then totally possible (and a very natural progression) for the more advanced students to then break out and use a wider range of built-in scala constructs and libraries.
--
Cédric
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
Yes, it does teach Scala, for a given value of "teach"
But they are starting points, and we all began somewhere!
So in this sense, programming Kojo really *is* programming Scala, and it's doing so in a manner that Java cannot duplicate.
Saying that Kojo teaches you Scala is like saying that programming in Java teaches you C++ because the JVM is written in C++.Excepting that they can actually use Scala. Kojo is essentially a magnificently done Scala REPL with some imports, no? (Maybe I'm entirely off on this.)
--
Cédric
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
Of course it can, write the interpreter in Java and give it to the students, they won't be able to tell the difference with the version implemented in Scala.
I understand you really like the fact that Kojo is implemented as a Scala DSL but you need to step back and realize that it doesn't give Kojo users any insight into Scala (Scala is actually only mentioned on one page of the forty-four page documentation and the references simply point the reader to http://scala-lang.org if they want to learn about Scala).
--
Cédric
no, No, NOKojo is absolutely NOT an interpreterYou can use full power of Scala's syntax and libraries within Kojo, it's an internal DSLTHAT is the *entire* point!