Wednesday January 09, 2008 Thanks Zed; Syntax matters; no more dumping stuff in Java; Quit pimple pimping Ruby; Scala warning
(Warning: This blog is a personal diary... not a magazine...)
![[image]](http://mowser.com/img?url=http%3A%2F%2Fwww.jroller.com%2Fresources%2Fr%2FRickHigh%2Fricksmallbw.png)
Thank you Zed.
Thanks to Zed, Ruby related posts on jroller are at an all time low. Zed has accomplished what social pressure could not. We tried to drive them out with torches, but they just wouldn't leave.
Sun please drop JRuby support. It is a waste of time. Take that money and spend it on Groovy which has a compatible syntax to Java. Do the language evolution there and quit abusing Java syntax. Give us some decent Groovy IDE tools. Quit messing with Java so frequently.
Does Ruby and Rails have good ideas? Yes. Borrow them and move on.
When the band wagon hype was roaring, I investigated Ruby and Rails. If RoR took the development world by storm like the true believers were espousing, I wanted to be prepared. After buying several books, and reading as much as I could stomach; I gave up. I just did not like it. My thought process was if it takes off and Java starts to die off (like the Ruby televangelists were espousing), then I would reevaluate, but my initial impression and that of most of my peer group was revulsion. Perhaps the issue was that the books did not do Ruby and Rails justice like Zed had alluded to in his blog.
Syntax matters
Scala is no better. After reading the Scala docs, my thought is: while the language features sound great, the syntax makes me want to hurl. Why do things differently just for the sake of it? Scala makes Groovy look so much more appetizing than before. Not only do you have the nice new language features to contend with but just for the sake of it, Scala ignores all prior art an invents a new syntax for mundane things like passing arguments to a method for example.
Hate is a such a strong word. I hate Scala syntax. Please don't promote the use of this syntax either. (NOTE: After the comments, and rereading the getting started guide to Scala, I was a bit harsh.)
C# 3.0 has a lot of the features that Scala has and they are much more palatable than the way Scala implements them. Evolution always seems to win out over revolution when it comes to technology. Why come up with a non-mainstream syntax for existing feature?
Does Scala have good ideas? Yes. Borrow them and move on.
Follow the example of Larry Wall, James Gosling and Bjarne Stroustrup and you can change the world. Some language purists will hate you but at least you will write a language that developers will actually use.
In short: Scala seems like the next over-hyped language. Just add the juicy bits of Scala to Groovy and throw that god awful syntax to the curb. Good ideas; whacked syntax. My favorite feature of Scala is inferred types, and strong typing. C# 3.0 has this too. (No I don't use C#, but that does mean I don't like some of its features.)
Evolution should be very slow in Java; Evolution wins over Revolution
Although I first disagreed with Bruce Eckel about changes to Java, the more I thought about it, the more I agreed, but not all the way mind you. (Clarification: I use Java 5 and would not go back to Java 1.4. I like Generics, Enums, etc. Annotations are poorly implemented IMO but I use them as well.)
Doesn't it make more sense to beef up Groovy and add new language features to it before they go into to Java. Tweak it, make it perfect in the Groovy sandbox and then one day add it to Java.
Quit dumping stuff in Java. Don't try to keep up with C# 3, C# 3000, C##++ 3500, etc.
Can we just get some decent support for Groovy? No instead Sun invests in Ruby via JRuby. DOH! Groovy looks a lot like Java. It is much easier to get started with it. The syntax does not make developers want to hurl. Why is Sun investing so much money in JRuby?
The investment should be in Groovy. Developers who know Java can learn Groovy quickly and are more likely to do so if the tools support it. Ruby is a non-starter.
Java is popular because it is like C++ and C. C++ is popular because it is like C. C# is popular because it is like Java. See a pattern. Follow Gosling's lead, and add some decent support for Groovy (code completion, re-factoring, etc.) When/if, the new language feature becomes main stream, then add it to Java (or not if it does not make sense).
Hey Sun, look at this:
![[image]](http://mowser.com/img?url=http%3A%2F%2Fwww.indeed.com%2Ftrendgraph%2Fjobgraph.png%3Fq%3Djava%252C%2Bruby%252C%2Bvb.net%252C%2Bc%252B%252B%252C%2BC%2523%252C%2BPerl%252C%2BPython)
Here is another reason not to invest heavily in Ruby. For the color blind: RUBY COMES IN DEAD LAST!
Ruby comes in dead last. If there was going to be a revolution, it would have happened already. Ruby is a little long in the tooth to finish this poorly. Don't you think?
BTW JAVA IS THE ONE ON TOP! Let's use that syntax. Let's build on that base. Let's add tools for that branch not the one on the bottom. Groovy yes. JRuby no. New language features in Java; slow. New language features in Groovy; fast.
Syntax matters. Python would have done so much better if they allowed blocks ({}) instead of just white space. If you don't think syntax matters, you can be the next obscure language with good ideas that no one uses. Scala that is your fate (again a bit too harsh, although probably true). You will never make it. Stop the presses. Good ideas. Puke syntax. (Harsh, harsh and harsh.) (After rereading the getting started guide to Scala... it kind of grows on you.)
Other than the white-space mess, Python is about as concise and beautiful as you can get. The code you can write in a short amount of time, and it is a work of art. However, IDE support (like Eclipse, IntelliJ, NetBeans) zaps the difference in productivity for most apps, and adds re-factoring tools (and other tools) galore to boot.
Syntax matters. The white-space business was Python's fatal flaw. Now Python will have to suffice itself in the knowledge that although it will never be mainstream (although if it was... this developer would do a happy dance), it still kicks the snot out Ruby even without all of the pimple, pimping evangelists.
Like Zed loved Ruby, I love Python, but couldn't make any money doing it. I lived in a small developer market and had to go with the mainstream stuff. I went with Java (since 1996-7 ish).
Syntax matters. Take the tip from Ecmascript, the newer versions look more like Java and much less like JavaScript of yore. Flex + Java is picking up steam and dwarfs anything (in terms of adoption) from Ruby of course Flex evagelists get snazzy banner adds ("Thinking in Flex").
Thoughts? This is my opinion. If you are offended, I am sure you are in the minority (vocal minority).
Final words:
I declare the "Ruby will rule the world" fallacy officially over.
Remember: Quit pimple pimping Ruby on JRoller!
Scala devotees (both of you). Don't even start!
RANDOM THOUGHTS
P.S. Python 3K fixes a lot of the not so beautiful parts of Python. It gets rid of some legacy syntax.
P.S. I am mostly jesting. If you want to post about Groovy vs. JRuby vs. Scala vs. Jython or whatever go ahead. Just no more of the "Java sucks, Ruby rocks" pimple logic. I have actually learned to like Obie's blog. There I said it.
P.S. Now I did look into Ruby a while back (1998) long before the hype; hated it (mostly because at the time I was a hard core Python bigot). (I looked into Python before Ruby and just fell in love with the syntax.)
P.S. That said... Rails had a positive influence on SW development as a whole even if you never used it. Few people I know well who used Rails on a big, complex project was happy with it despite the Ruby hype machine (this is one of the many reasons I opted to focus attention elsewhere).
P.S. It is not a matter of hatred of Ruby or Rails; just complete lack of interest. Ruby devotees just post your love fest for Ruby on rubyroller not jroller.
P.S. Side note: Python 3000 is shaping up nicely.
P.S. I have a few friends who have started thinking in Flex, and I am much more likely to "think in Flex" than "think in anything remotely related to Ruby".
Comments that I could not add:
RE: "You guys are on crack, Java syntax, the C syntax in general, just sucks. "
Crack you say? I think you mean Crank.
RE: "It's verbose and inflexible and full of accidental complexities that have nothing to do with the problem you're actually trying to solve. "
I don't agree. What do you program in? I am sure it is a winner.
Some times, the majority is right.
RE: "Hell I think Ruby sucks, but it's light years ahead of Java, the Java crowd is stuck in the past and still arguing over essentials like closures, sad, very sad."
I agree with the first part, and not the second. Again, what language do you program in.
I have been paid to program in:
8088 Assembly, C, Turbo Basic, Turbo Pascal, C++, Visual Basic, Java, C#, Perl, Python, XSLT, Drools, and a few more that I have forgot. I prefer Java 5. I have done some functional programming.
--Rick Hightower
Email: rhightower AT arc DASH mind DOT com
Run more. Lift more. Play more. Play hard. Procrastinate less. Don't waste time. Time is short. Be bold. Be nice. ![[image]](http://mowser.com/img?url=http%3A%2F%2Fjroller.com%2Fresources%2Fr%2FRickHigh%2Frickmadsmall.png)
If you leave a comment and it gets marked as SPAM. Don't worry. I will unmark it as SPAM. Unless of course it is SPAM, then I will melt your car.
Jan 09 2008, 11:10:48 PM MST PermalinkGroovy has cool Eclipse IDE tools and there is a Grails alpha IDE plugin as well..
Posted by Fred Grott on January 10, 2008 at 09:05 AM MST #
How is the code completion? The last time I tried an Eclipse plugin for Groovy I was appalled. The tools have to be as good as Java or at least close.
Posted by Rick Hightower on January 10, 2008 at 09:21 AM MST #
Yes, I'm sick of too many damned frameworks for Java. Then again, I'm also sick of too many hack languages sucking up brain bandwidth for no particular gain.
Let the business drive the technology - that is what technology is there for. Ruby/Rails/Scala/JRuby - even Python - feel more like technology for the sake of technology. The 'not invented here' syndrome that drives these new twists on old ideas has no place in business technology (which of course pays the bills). Leave it in academia.
Posted by Chris Mathias on January 10, 2008 at 11:04 AM MST #
Don't feel bad: I once thought that OS/2 was going to rule the world.
Please... others... come forward. You know you are out there. I know a few of you.
Posted by Rick Hightower on January 10, 2008 at 12:22 PM MST #
Good Groovy and Grails tools are coming soon to the NetBeans IDE: http://martin.adamek.sk/?p=13
Posted by Gregg Sporar on January 10, 2008 at 08:50 PM MST #
I agree syntax matters. I have been reading more code than ever lately, and wondering how in bloody hell anyone gets by on big projects not doing it. Java is no doubt about it, the most readable of heavy-duty general purpose languages ever. D looks like the only thing that could challenge it, but per my couple posts, D dazzles, and disappoints (get it? I mean, the d's..?) Ruby's syntax is like taking a time machine back to the 80s when there were moron knuckledraggers moping around telling people to just use the 4 letter versions of the SQL predicates in dBase to save typing time. Dude, Ruby makes me want to go take another pass at Modula-2.
The juiciest part of Zed's rant was the fact that the Ruby community is peopled with little hackers who don't know shineola about software dev. I was so surprised to hear that! Let's face the facts, if you have never implemented a design pattern, don't know what an association class is, or how to navigate a tree using a stack, then Java is a waste of time.
Posted by Ramon on January 10, 2008 at 10:31 PM MST #
Also, it is called "Ruby on Rails", hence the abbreviation RoR. It is not called "Ruby and Rails" because Ruby itself doesn't care what RoR does, insofar that RoR is just a specific project with a tight mindset, whereas Ruby can be used for anything.
Zed also flamed the Ruby community as a whole in his rants, and I am glad he left simply because he cannot or does not want to differ at all. Hopefully he goes to python where he will meet only nice and friendly people and embrace them all in love for eternity without flaming anyone *chuckle*
Posted by 80.108.103.172 on January 10, 2008 at 10:58 PM MST #
Also, it is called "Ruby on Rails", hence the abbreviation RoR. It is not called "Ruby and Rails" because Ruby itself doesn't care what RoR does, insofar that RoR is just a specific project with a tight mindset, whereas Ruby can be used for anything.
Zed also flamed the Ruby community as a whole in his rants, and I am glad he left simply because he cannot or does not want to differ at all. Hopefully he goes to python where he will meet only nice and friendly people and embrace them all in love for eternity without flaming anyone *chuckle*
Posted by she on January 10, 2008 at 10:59 PM MST #
Also, it is called "Ruby on Rails", hence the abbreviation RoR. It is not called "Ruby and Rails" because Ruby itself doesn't care what RoR does, insofar that RoR is just a specific project with a tight mindset, whereas Ruby can be used for anything.
Zed also flamed the Ruby community as a whole in his rants, and I am glad he left simply because he cannot or does not want to differ at all. Hopefully he goes to python where he will meet only nice and friendly people and embrace them all in love for eternity without flaming anyone *chuckle*
Scala syntax doesn't exist like that "for the sake of it". I implore you to explore some of the advanced features (which you likely have never seen before, since they do not exist in any of the other languages you mention), before drawing foolish conclusions, if not for the sake of the truth, at least for the sake of not making yourself look silly (I assume you don't intend to do that right?). Really, I'm not trying to be insulting or denigrating, but such a foolish and ignorant remark has no other explanation.
Programming Language Theory has very little to do with Ruby/Java or any of that other gunk.
Posted by Tony Morris on January 10, 2008 at 11:23 PM MST #
Posted by whatever on January 11, 2008 at 12:28 AM MST #
Now I'm just guessing, but when you say that "Scala invents a new syntax for mundane things like passing arguments to a method," I think you are referring to stuff like currying. That's actually a pretty advanced feature when using higher level functions, and allows you to decouple and reuse your code a lot.
You sound like a guy who's only coded in a couple of mainstream imperative languages, and it makes you sound pretty ignorant.
Posted by Ulrik Rasmussen on January 11, 2008 at 04:35 AM MST #
I believe that we should have choice, so asking jruby to cease the development for me just not fair. don't get me wrong, I still don't like jruby, and right now I use groovy, but let jruby and scala alive, choice is good.
You said you like Python. Wouldn't it be great if the revitalized Jython project became another player in the arena? Wouldn't it be cool to deploy Django in Glassfish?
No, that's business, and inertia wins there. Bolting features and kludges onto an existing language doesn't make it any better, in the same way putting $500 rims and a spoiler on a Ford Pinto makes it a sweeter car. These frameworks, these ideas, they probably work for that language because they take advantage of what it gives the programmer. Something elegant in one language will probably look like a lot of shit in another.
"Why come up with a non-mainstream syntax for existing feature?"
This might be a shocking conclusion but, perhaps it is because mainstream syntax sucks? Just a thought.
I'm not trying to antagonize, just point out that maybe you should give some of these non-mainstreamers a serious, hard look before you come to such insane conclusions. And I mean a *real* one.
Posted by Austin Seipp on January 11, 2008 at 08:46 AM MST #
Rick: The syntax is not 'just made up', it's borrowed from the literature on type systems, where 'var :: Type' is used rather than 'Type var', using the single colon is just one fewer keystrokes.
Posted by David Hogarty on January 11, 2008 at 09:04 AM MST #
Honestly, until we saw your graph of language popularity, we had no idea that Java was so far ahead of everything else. We assumed Ruby was as popular as Java at indeed.com, which is why we've spent some much time on it lately.
Thanks again, Rick. Sun without thinkers like you would be like Java without generics!
Posted by Jonathan Schwartz on January 11, 2008 at 09:59 AM MST #
I use Java 5 and would not want to go back to Java 1.4. I agree with you. But, I think BE has a point. I'd like to see the language features of Java slow. And, I'd like the features that they added to be flushed out. Java 5 was a major change. Let's do the next set of major changes in Groovy and let Java changes be more reflexive than reactive.
That said, unlike BE, I want to see Java grow and evolve and think it should. I think the "death of Java" has been greatly exagerated.
For the rest, I don't think you are being fair to what I wrote. Groovy, Python and C# 3.0 have many of the features (but not all) that Scala has and are much more palatable to the bulk of developers. In fact some of the points that were made in the comments (against me) are exactly what I was trying to say in the first place. Either my communication style is lacking or the commenters comprehension skills, either way, I am work now so won't be able to clarify until later.
My background: I have programmed in C, C++, Python, Perl, Delphi, VB and Java. I don't claim to be an expert in functional programming. I did quite a bit of functional programming with Python and it made the code I wrote unreadable by everyone in the organization I was working for (yet terse and beautiful).
And yes, I may be "ignorant and stupid" about your pet project, but wrt to a language becoming main stream I am right. Scala will never make it.
I am okay with Sun investing in JRuby and Groovy. (I don't own Sun so they can invest in anything they like). It just seems odd that they would invest in a syntax (Ruby) that the bulk of there target market and community do not use while letting Groovy rot on the vine. Groovy needs some love and some tool support. Groovy seems like a better investment. Groovy is Java syntax++ additional feature BTW.
Posted by Rick Hightower on January 11, 2008 at 10:03 AM MST #
Name the feature. Be specific. Perhaps there is a reason the syntax is so different. I don't think so. It is hard to make an argument with hand waving and generalizations.
While I am waiting for this list of features that had to implemented in a non-mainstream syntax... I have used Python and Groovy and they both add many advanced language features but do it in a way that is natural for someone with a C, C++, Java, C# background. C# 3 has quite a few of Scala features and its syntax seems pretty natural for mainstream developers to use.
I find that Scala has advanced features, but some of its even more mundane features are implmented in such a way that is very foriegn to the mainstream. I propose that this will be enough for Scala to be ignored by the majority of developers. Perhaps the features will ported to other langagues.
Posted by Rick Hightower on January 11, 2008 at 10:22 AM MST #
Choice is great. But it cost money to add tool support and such for a language. The money they spend on JRuby and JScala and JAnotherLanguageNoOneWillEverUse takes away from the money they could spend on Groovy.
What is the ROI for spending a boat load of money on JRuby? The revolution never happened. Look at the poll results. Ruby lost. Move on.
Posted by Rick Hightower on January 11, 2008 at 10:25 AM MST #
Personal attacks always convince people that your choice is great.
I have been paid to programed in
8088 assembly, C, Turbo Basic, C++, Visual Basic, Delphi, Java, C#, Pyhton, XSLT, Drools, Blaze, and probably quite a few I am forgetting.
I personally represent the silent majority. A bunch of attacks from alternative language devotees will not silence me. :o) Go read Rickards article on Psychopaths.
Posted by Rick Hightower on January 11, 2008 at 10:30 AM MST #
Crack you say? I think you mean Crank.
"It's verbose and inflexible and full of accidental complexities that have nothing to do with the problem you're actually trying to solve. "
I don't agree. What do you program in? I am sure it is a winner.
Some times, the majority is right.
"Hell I think Ruby sucks, but it's light years ahead of Java, the Java crowd is stuck in the past and still arguing over essentials like closures, sad, very sad."
I agree with the first part, and not the second.
Posted by Rick Hightower on January 11, 2008 at 10:35 AM MST #
In an industry that mostly rely on its people's intelligence, I'd say the "mainstream" is setting the bar too low. What if some medical techniques are "not mainstream enough" for "mainstream doctors" to apply? We'd probably still get stuck without antibiotics, without coronoary bypass, etc.
The difference? The barrier of entry is not high enough for someone to become a software developer. If all the CS programmes take hints from the Med schools on when to accept and when to reject applications, we'd live in a way better world.
In short, don't blame on the language feature. Blame on the "mainstream" not being smart enough.
Posted by Michael Lam on January 11, 2008 at 11:44 AM MST #
"In an industry that mostly rely on its people's intelligence, I'd say the "mainstream" is setting the bar too low."
Which is exactly my point.... Why not add these great new language features in a common syntax so the unwashed masses (me) can enjoy your perls of wisdom? Pick a syntax that people actually like. If you only preach the sermon in Latin no one will undersand. :o)
Grooy and Java are not academic curiosities. Java actually gets used in industry.
Why is that every alternative language bigot immediatly questions your IQ when you disagree with them? My point that the syntax is mainstream and for very good reasons people will not adopt it.
My IQ is very high. If you don't think so, just ask my mom. :o)
You have address none of my points, namely, Python and C# 3 have a very natural syntax and many, many of the features of Scala. No. Instead you attack my IQ. Read Rickards article on pyschopaths and then come back and respond with something useful.
Posted by Rick Hightower on January 11, 2008 at 12:27 PM MST #
Rick, I totally freaking agree with your refined version of your JRuby argument. As you know, I have made the argument a million times that Sun is so stupid at figuring out how to spend their resources, it's no wonder the only way to move their stock to 20 was a reverse four way. Creator was the dumbest waste of time on earth. while JSF 1.2 has been in the birth canal longer than a litter of elephants (despite the fact that is feature load is minimal). Unfortunately, Sun is the classic American company: some really freaking smart people did some great work on their own monkeying around and the minute it drew some attention, other types moved in to corporatize the growth and the ONLY good thing we have gotten since is Java 5 (probably because it was not on their radar). EJB, Creator, WS*, all disasters.
However, please don't deny that we work with "less bright" individual every day, no matter how bright you think your collegues are. And why?
While communicating with the mainstream IS important, maybe the mainstream contains too many people to begin with? Would this issue even exist or as severe as you think if the barrier of entry is higher?
You said it best yourself: "I did quite a bit of functional programming with Python and it made the code I wrote unreadable by everyone in the organization I was working for (yet terse and beautiful)." Emphasis on "EVERYONE IN THE ORGANIZATION". Either you're really, really, really, really smart, or the rest of your organization is "just mainstream". I tend to believe the latter is the case, and I blame the mainstream giving too much slack when it allows people to enter.
Posted by Michael Lam on January 11, 2008 at 01:38 PM MST #
I figured you had no idea what the features were, since if you did, you wouldn't have made such a remark.
Here are some to consider that affect the syntax immensely:
* Forward type inferencing - this has a massive impact
* Higher-ranked types (as a side note, the lack of this one feature alone in mainstream, is the reason for the existence of Ruby et. al.)
* Lazy function arguments - there is a need to distinguish the type for thunk to A over just 'lazy A', which is assignable to any A (in which case, evaluation is forced).
Ultimately, Scala has syntax very much like the mainstream Blub languages and this is to appeal to programmers who are only familiar with only very poor languages and poor discipline (not pointing any fingers yet ;)). If you want to see a perfect syntax that is nothing like Java et. al., take a look at Haskell.
I reiterate my conclusion; please refrain from passing under-qualified comment. Investigate the full story first. It will only make you look silly (though personally, I'm more interested in correct mistakes than belittling people).
Posted by Tony Morris on January 11, 2008 at 01:52 PM MST #
Since you claim to belong to the "unwashed masses" and you think my attack on the mainstream is an attack on your IQ, it seems to me that you think yourself belong to the mainstream.
Yet, when you say you wrote code that nobody in your organization understood, in my definition you don't belong to the mainstream - where do you believe you belong?
If you belong to the mainstream, since the mainstream contains you and also those who don't understand you code one bit, it implies the mainstream is too varied w.r.t. intelligence.
If you're not in the mainstream but merely a mainstream-sympathizer, which I think you are because you're smart - may I know why you're not blaming the system - i.e. the continuous lowering of the bar that lets people who can merely pay for the tuition have a degree?
PS I dev professionally in Java, Perl and C++. I use the functional bits in Perl and C++ where I think they are convenient, and I don't think Java is outdated, or whatever the Java-hater believes. I only believes that the mainstream is too large and want to chip in my point in this discussion, stir some responses and thoughts, or troll if you think I'm.
Peace.
Posted by Michael Lam on January 11, 2008 at 01:55 PM MST #
Let me reiterate : it ACTUALLY MAKES SENSE. Now, how many times have you wandered : why must I put a ; after a do{...}while(...) and not just after every control structure / block in C/Java et co?
Posted by horia314 on January 11, 2008 at 02:09 PM MST #
Posted by Rick Hightower on January 11, 2008 at 03:04 PM MST #
From my functional background, I actually find Python to be very limiting. Laziness, purity, currying, first-class functions, and other high-level features eventually start to look very clumsy in the "traditional" syntax.
Seriously, try cramming the features of Haskell into a Java-style syntax, and it gets very weird. Alternate syntaxes are not evil -- don't be inflexible, it's not that hard to get used to multiple languages! The decisions are made for reasons that are not readily apparent until one reaches master level with a language.
The best example, I think, is the parentheses in LISP. People hate them until they *really* begin to grok macros. All of a sudden, the earth shakes, the clouds part, rays of light shine down from above, and angels begin singing -- and you understand the beauty of the crazy syntax.
If you don't like it, and don't want to learn to like it -- don't use it. Your post is full of vitriol that is not helpful in advancing the debate.
-Jephthai-
Posted by Jephthai on January 11, 2008 at 03:22 PM MST #
The best example, I think, is the parentheses in LISP. People hate them until they *really* begin to grok macros. All of a sudden, the earth shakes, the clouds part, rays of light shine down from above, and angels begin singing -- and you understand the beauty of the crazy syntax."
I don't doubt this. Well said btw. Thanks. I tried to pick up eLisp back when I worked with emacs a lot. I never fully grokked it. Like I said, I am not a functional programming expert by any means. I like the limited support C#, Python, and Groovy provides for functional programming. I'd like to see FP become more mainstream.
Perhaps one day I will be the FP judo master. I might take a second look at Scala.
Posted by Rick Hightower on January 11, 2008 at 03:45 PM MST #
> things like passing arguments to a method.
Let's see...
C++: foo.doSomethingWith(bar, baz)
C#: foo.doSomethingWith(bar, baz)
Javascript: foo.doSomethingWith(bar, baz)
Groovy: foo.doSomethingWith(bar, baz)
Java: foo.doSomethingWith(bar, baz)
And Scala's version?
Scala: foo.doSomethingWith(bar, baz)
The rest of the rant is about as clueless.
Okay, I shouldn't have said that. I just get irritated by superficial assessments, especially when they're false. Let me approach the problem from a different direction.
The main guy behind Scala is Martin Odersky. If you Google him you'll see he has a deep history with Java. I mean, this guys GETS the language - he wrote the reference compiler for 1.5.
He invented a couple of extensions to Java, Pizza and GJ. So he has experience with molding the syntax.
One of his design goals for Scala was to maintain seamless Java interoperability. He knew that if he could achieve that then the language would naturally attract Java programmers. So, no matter what you might think, he also tried to make the language syntax somewhat Java-like.
I know you don't believe me, but bear with me.
There are a lot of functional languages out there. 3 that stick out are Scheme, Haskell, and ML. If you were to hold a printout of some code in Scala, Java, Haskell, Scheme, and ML at arms length the Scala code is likely to syntactically look a bit more like Java than the other 3 (although semantically it can look like any of the above).
But there are differences. Those differences were done for very good reasons. Here's a quote from the eBook explaining one of those differences:
The major deviation from Java concerns the syntax for type annotations—it’s
“variable: Type” instead of “Type variable” in Java. Scala’s postfix type syntax resembles
Pascal, Modula-2, or Eiffel. The main reason for this deviation has to do with type
inference, which often lets you omit the type of a variable or the return type of a method.
Using the “variable: Type” syntax this is easy—just leave out the colon and the type. But
in C-style “Type variable” syntax you cannot simply leave off the type—there would be no
marker to start the definition anymore. You’d need some alternative keyword to be a placeholder
for a missing type (C# 3.0, which does some type inference, uses var for this purpose).
Such an alternative keyword feels more ad-hoc and less regular than Scala’s approach.
> pretty ignorant."
> Personal attacks always convince people that your choice is great.
> I have been paid to programed in
> 8088 assembly, C, Turbo Basic, C++, Visual Basic, Delphi, Java, C#, Pyhton, XSLT, Drools, Blaze, and probably
> quite a few I am forgetting.
> I personally represent the silent majority. A bunch of attacks from alternative language devotees will not
> silence me. :o) Go read Rickards article on Psychopaths.
I don't know if you notice the irony here yourself. But are you basically calling me a psychopath for pointing out that your arguments sound ignorant? I am in no way trying to silence you. I'm just saying that your argumentation is thin, and that it makes you _SOUND_ like you've never coded in anything but mainstream imperative languages, and are scared of anything new. Pardon me if that's not the case, but then you could've backed your viewpoint up with more solid arguments.
Posted by Ulrik Rasmussen on January 11, 2008 at 08:16 PM MST #
re: The main guy behind Scala is Martin Odersky. If you Google him you'll see he has a deep history with Java. I mean, this guys GETS the language - he wrote the reference compiler for 1.5.
RE: He invented a couple of extensions to Java, Pizza and GJ. So he has experience with molding the syntax.
re: One of his design goals for Scala was to maintain seamless Java interoperability. He knew that if he could achieve that then the language would naturally attract Java programmers. So, no matter what you might think, he also tried to make the language syntax somewhat Java-like.
I remember Pizza. No I did not know that... Thanks btw. This was a well though out comment. I read the getting started guide for Scala and no further. My opinion was based on that. Java interop != Java syntax like.
My analysis was superficial. I will take another look at Scala when I get some more time. Nothing in the comments convinced me make it a priorty.
Why should one look in Scala vs. Jython, JRuby and/or Groovy?
It quite possible I missed something.
Posted by Rick Hightower on January 11, 2008 at 08:36 PM MST #
re: The main guy behind Scala is Martin Odersky. If you Google him you'll see he has a deep history with Java. I mean, this guys GETS the language - he wrote the reference compiler for 1.5.
RE: He invented a couple of extensions to Java, Pizza and GJ. So he has experience with molding the syntax.
re: One of his design goals for Scala was to maintain seamless Java interoperability. He knew that if he could achieve that then the language would naturally attract Java programmers. So, no matter what you might think, he also tried to make the language syntax somewhat Java-like.
I remember Pizza. No I did not know that... Thanks btw. This was a well though out comment. I read the getting started guide for Scala and no further. My opinion was based on that. Java interop != Java syntax like.
My analysis was superficial. I will take another look at Scala when I get some more time. Nothing in the comments convinced me make it a priorty.
Why should one look in Scala vs. Jython, JRuby and/or Groovy?
It quite possible I missed something.
> One of his design goals for Scala was to maintain seamless Java interoperability. He knew that if he could achieve that then the language would naturally attract Java programmers. So, no matter what you might think, he also tried to make the language syntax somewhat Java-like.
James,
Regarding....
> I know you don't believe me, but bear with me.
> There are a lot of functional languages out there. 3 that stick out are Scheme, Haskell, and ML. If you were to hold a printout of some code in Scala, Java, Haskell, Scheme, and ML at arms length the Scala code is likely to syntactically look a bit more like Java than the other 3 (although semantically it can look like any of the above).
> But there are differences. Those differences were done for very good reasons. Here's a quote from the eBook explaining one of those differences:
Thanks. I will take another look. Thanks for the background info.
Posted by Ricky High on January 11, 2008 at 09:29 PM MST #
Ulrik I was not trying to call you a psychopath per se... just merely stating when you start throwing out terms like "ignorant", one my construe that as name calling and we want to be careful. I left most comments in.
In a way, I am ignorant of FP. I have use FP with Python to great effect, but have never used FP in a FP centric language like LISP or Haskell. I like to see FP feature make their way into Java one day. I enjoyed what FP support Python had. It made sense to me almost immediately. C# 3, Groovy and Python have limited FP support. I don't currently use any of them.
Posted by Rick Hightower on January 11, 2008 at 11:24 PM MST #
Before I answer, I should mention that those 3 languages have a strength that Scala does not have. Specifically, all 3 (plus Smalltalk and Common Lisp and others) support meta programming via meta objects. Scala's doesn't have much to say in regards to meta-programming beyond Java's reflection libraries, although implicit conversions can do some of the things you might use meta-programming for. So by all means learn at least 1 of those languages!
Now, why Scala?
typeful programming - higher kinded types, path dependent types, implicits, explicit self types. It's very hard to describe how typeful programming affects your programming until you do it. Think of how much stronger generics made Java's type system. Now add even more power to the type system. But add in type inference so you don't have to redundantly repeat yourself redundantly quite so much.
functional programming - lexically scoped closures without Java's strange limitations, partial function application, lambdas, tuples, pattern matching, optional laziness, tail recursion optimization (though not full tail call elimination), "for" comprehensions (a generalization of list comprehensions).
object oriented programming - Mixins to supply something like multiple inheritance without the diamond inheritance problem, singleton objects instead of statics. Like Ruby and Smalltalk, but unlike Java, Groovy, and Python, Scala is VERY object oriented. Just about everything, even "primitives," is an object. There aren't very many "operators" in Scala, instead most operators are methods. Just work with Java's BigInteger for 5 minutes then look at Scala's BigInt to see why this is huge. For primitives, the compiler is smart enough to use unboxed primitives and byte code math when it can.
A feature list as long as my arm probably isn't enough to convince anybody. Instead, I'll point you to the lift web framework.
http://www.bayfp.org/blog/2007/11/09/david-pollak-on-lift-videos-slides/
http://liftweb.net/index.php/Main_Page
I'm pointing you there not because I think you should necessarily switch to using lift. lift is still in the early stages and it's probably premature to recommend it for most people. Instead I think its worth looking at how its implemented, how it's used, etc. lift depends heavily on some of the advanced features in Scala and shows them to good effect.
The lead, David Pollack, is both smart and very pragmatic - he's not some academic who enjoys obscure concepts for their own sake nor some gadfly drawn to the latest shiny thing. When he says Scala cuts down his LOC count and improves his productivity when compared to Ruby its worth paying attention.
Before I answer, I should mention that those 3 languages have a strength that Scala does not have. Specifically, all 3 (plus Smalltalk and Common Lisp and others) support meta programming via meta objects. Scala's doesn't have much to say in regards to meta-programming beyond Java's reflection libraries, although implicit conversions can do some of the things you might use meta-programming for. So by all means learn at least 1 of those languages!
Now, why Scala?
typeful programming - higher kinded types, path dependent types, implicits, explicit self types. It's very hard to describe how typeful programming affects your programming until you do it. Think of how much stronger generics made Java's type system. Now add even more power to the type system. But add in type inference so you don't have to redundantly repeat yourself redundantly quite so much.
functional programming - lexically scoped closures without Java's strange limitations, partial function application, lambdas, tuples, pattern matching, optional laziness, tail recursion optimization (though not full tail call elimination), "for" comprehensions (a generalization of list comprehensions).
object oriented programming - Mixins to supply something like multiple inheritance without the diamond inheritance problem, singleton objects instead of statics. Like Ruby and Smalltalk, but unlike Java, Groovy, and Python, Scala is VERY object oriented. Just about everything, even "primitives," is an object. There aren't very many "operators" in Scala, instead most operators are methods. Just work with Java's BigInteger for 5 minutes then look at Scala's BigInt to see why this is huge. For primitives, the compiler is smart enough to use unboxed primitives and byte code math when it can.
A feature list as long as my arm probably isn't enough to convince anybody. Instead, I'll point you to the lift web framework.
http://www.bayfp.org/blog/2007/11/09/david-pollak-on-lift-videos-slides/
http://liftweb.net/index.php/Main_Page
I'm pointing you there not because I think you should necessarily switch to using lift. lift is still in the early stages and it's probably premature to recommend it for most people. Instead I think its worth looking at how its implemented, how it's used, etc. lift depends heavily on some of the advanced features in Scala and shows them to good effect.
The lead, David Pollack, is both smart and very pragmatic - he's not some academic who enjoys obscure concepts for their own sake nor some gadfly drawn to the latest shiny thing. When he says Scala cuts down his LOC count and improves his productivity when compared to Ruby its worth paying attention.
While at first blush it may appear that C# and other more mainstream languages have the "same" features as Scala and more functional languages, the distinctions are sometimes subtle and very powerful.
From my functional background, I actually find Python to be very limiting. Laziness, purity, currying, first-class functions, and other high-level features eventually start to look very clumsy in the "traditional" syntax.
Seriously, try cramming the features of Haskell into a Java-style syntax, and it gets very weird. Alternate syntaxes are not evil -- don't be inflexible, it's not that hard to get used to multiple languages! The decisions are made for reasons that are not readily apparent until one reaches master level with a language.
The best example, I think, is the parentheses in LISP. People hate them until they *really* begin to grok macros. All of a sudden, the earth shakes, the clouds part, rays of light shine down from above, and angels begin singing -- and you understand the beauty of the crazy syntax.
If you don't like it, and don't want to learn to like it -- don't use it. Your post is full of vitriol that is not helpful in advancing the debate.
"""
I am kind of greedy. I want to use some of these features in a langauge that I am allowed to use at work. What is the use of having a great language feature if people are not allowed to use your language becuase it is not the "company standard"?
I work with a company in San Diego who started using Groovy. B/c it was similar to Java and provided support for XYZ.... (It was there idea not mine. But I liked it.)
See... I like to get paid to write code. I like to learn languages I can actually use during normal business hours. I don't work in acadamia. I am not a student.
Groovy adoption is coming along nicely. It did not take over the world, but 1.0 has not been out that long. I hope it does well. It is probably the only way I will get to do FP during business hours.
Scala, Haskell, Skij, Scheme, Lisp are probably all great but how does that help me.
BTW When I say things like I "hate" Scala syntax, it does not need evidence. I have a preference. My preference is for C style syntax. Perhaps this is due to almost 20 years of programming in C style syntax. I prefer Python, Java, and Groovy. I looked into Ruby and did not like it. It did not float my boat.
I said this before, but let me say it again. I was a bit harsh on Scala. I reread the docs and it was not as repulsive the second time around. It actually grew on me a bit.
I remember reading the Python getting started guide back in 1997 or so. I thought to myself. WOW!
I remember reading the Groovy getting started guide. I thought to myself. This is pretty cool.
I did not have that reaction to Scala. My thoughts were along the lines of.... why?
So why would someone pick Scala over Groovy or Python? Why do we need yet another language?
Jython is the number one alternative language for the JVM. And it has been around a while. Groovy has gained a lot of ground on Jython considering Jython is quite a bit older.
Why Scala?
Posted by Rick Hightower on January 11, 2008 at 11:43 PM MST #
Posted by cag on January 12, 2008 at 12:21 AM MST #
Posted by cag on January 12, 2008 at 12:35 AM MST #
Zed has a job already. I am sure Zed could always get a job, just not the one he loved. Those w/o family obligations have the freedom to be starving artists.
Zed hates Java more than Ruby... I am sure.
I responded to James last post above here:
http://www.javalobby.org/java/forums/t105687.html
Posted by Rick Hightower on January 12, 2008 at 01:21 AM MST #
Posted by Michael Lam on January 12, 2008 at 01:37 AM MST #
Posted by Rick Hightower on January 12, 2008 at 01:42 AM MST #
I actually perceive less difference between Ruby and Python then you do - perhaps the Rails community and hype has tainted your view of Ruby a bit.
I do think Rails has promoted (not necessarily invented) some worthwhile ideas such as convention over configuration. There were times when I was writing as much XML configuration code as actual business logic. I prefer a platform that lets the team focus as much as possible on the implementing business cases - the rest is necessary but unfortunate noise.
Anyway I haven't seen this much constructive (and non-constructive) debate going on in our industry for quite a while - which ain't all bad. I think it is sparking both a revolution and evolution and promoting competition that will ultimately leave us with improved familiar tools and new tools to choose from.
Posted by cag on January 12, 2008 at 02:00 AM MST #
Rick Hightower has kicked off an interesting discussion thread, which
can be found over on JavaLobby:
Thanks Zed, Java evolution, Ruby and Scala Pimple Pimping...tend to agree with about 90% of the sentiments that Rick expresses
in this posting. However, I do have a different opinion than him
regarding a potential role for Groovy, which I posted to that
JavaLobby thread, but will reproduce here:
Posted by Java posse on January 12, 2008 at 10:58 AM MST #
http://groups.google.com/group/javaposse/browse_thread/thread/65dcf7b4b738e356#e184d6c11e162c0b
Posted by RogerV on January 12, 2008 at 11:57 AM MST #
Your whole argument in a nut shell boils down to your preference of static typed languages over dynamic typed languages. Do you think all the work being done on type inference is just a waste of time? If so, work on speech recognition and optical character recognition is surely doomed as well. Amazingly humans use written and oral communication without defining every noun before they say or write it - yes sometimes we ask for clarification, but it works pretty well overall and would be very tedious to do otherwise.
Perhaps some people will continue the goal of making the human / computer interface more seamless - isn't that the real goal? Isn't that a good goal - if not we would certainly still be punching 0's and 1's into little cards.
I'm not going to bet my house on the fall of dynamic based languages just yet. I will continue to follow the TIOBE index that has for several months shown dynamic language usage is growing and static language usage is shrinking. When that trend inevitably reverses you will be able to tell everyone "I told you so". It will also be very sad as it will signal that we can advance the science no further.
How much do you actually know about SOA middleware? It is a very volatile world right now, but I think it still follows the MVC pattern. The model is still either in the database or better an ORM layer, the view is still separately rendered via HTML, XML, JSON, or Flex, and the controllers are the web services themselves - which by definition are on a web server. I suppose you could purposely try to mangle all this stuff together to make it harder to maintain and less flexible but how is that a good thing?
Posted by cag on January 12, 2008 at 12:22 PM MST #
Nice! Very open minded community.
Posted by cag on January 12, 2008 at 12:24 PM MST #
It helps you because it makes you a better programmer, regardless of language. Functional programming in particular will raise your level of abstraction quite a few notches, and even if you have to program in a comparatively low level language like Java at work, you'll still be able to use the "higher thoughts" to map out the solution in your head, before translating it down into whatever language you're using. FP will also make you an expert on writing nice modular code, avoiding side effects (crucial for concurrency/parallelism), things like recursion etc. And no, I don't think using the odd borrowed feature in Python or C# 3.0 will have anywhere near the same effect.
Also, when you do get some "diet" version of these features in the language you use at work, you can actually understand its significance right away, and use it much more effectively than if you had to learn it by using the diluted form from the start (if you're saturated in lambdas and monads then you'll understand them quicker -- when to use them, when not to -- than if you only see them in a language where they are of marginal importance). Witness, for example, how many Java programmers simply don't understand the power of recursion (no, it's not just for trees) - they haven't learnt it properly because most of the time they don't use it, so when a problem comes up where the the imperative solution is tricky, error-prone and indecipherable, they don't even see that the recursive solution is three lines of trivial code (as is quite often the case). A functional programmer would probably think of it in terms of recursion *first* and then "compile" it down to the lower level imperative form.
Learning lots of lanugaes, *especially* if you have the kind of reactions that you voice in this post, is great because it makes you a better programmer. If something "makes sense" right away, and feels familiar and similar to what you already know, *then* it's reasonable to ask "what good does this do me?". Why learn something that doesn't teach you anything new, aside from some marginally exciting curiosities (e.g. like going from Java to Python)?
Learn Haskell. You'll hate the syntax (because it's very unfamiliar - it's actually brilliant), and it'll be painful to learn a *totally* different way of thinking, but if you stick with it (and I'm not kidding, it's difficult to do with an imperative mindset) and really try to learn it I'm almost certain that you will be a better programmer for it, and what's more you'll have a much better perspective on Java etc.
Posted by Sebastian on January 12, 2008 at 07:43 PM MST #
Anyway... thanks for your comments...
Posted by Rick Hightower on January 12, 2008 at 10:10 PM MST #
How could you read my blog entry and come to this conlusion? Um... I like Groovy and Python. They are dynamic languages (last time I checked).
Posted by Rick Hightower on January 12, 2008 at 10:19 PM MST #
If you can master either language you will be a far better programmer for the experience. In fact, if you truly master Scala you will have learned a great deal that Haskell has to offer and vice versa.
But there's a difference. With Scala it's quite easy to keep "writing Java" with a slightly different syntax. Scala doesn't force you out of the object oriented/imperative mind set. There's much, much more available in the language but you are free to ignore it.
With Haskell, on the other hand, anything much more complicated than "hello world" absolutely requires you to grapple with functional combinators, monads, laziness, and host of other FP concepts. Haskell is so different from any languages you know that, by comparison, Python and Java are nearly the same language.
Only you know yourself well enough to know which one is the right path for you. With Scala there's a risk that you'll never push yourself into the unfamiliar territory so it won't serve the goal of stretching your mind. With Haskell there's the risk that things will be so unfamiliar so fast that you'll give up in frustration. It's not that Haskell is harder than Scala - it's actually a simpler language - it's just that the mental models you've internalized don't work in Haskell.
My recommendation is that if you primarily want to grow as a programmer and if you're capable of momentarily "unlearning" then pretend you don't know anything at all about programming, open your mind to a childlike state of curiosity, and dive into the deep end of Haskell. If, on the other hand, you need a feeling of accomplishment and productivity early to maintain interest then go with Scala first.
Whichever one you go with first, the other one will still have more to teach you.
Posted by Manuel Palacio on January 16, 2008 at 02:14 PM MST #
Posted by Fred Flatline on January 22, 2008 at 09:58 AM MST #
Groovy does show up ahead of JRuby in the JVM world. The JVM world is the world I live in.
Posted by Rick Hightower on January 22, 2008 at 11:54 PM MST #
LANGUAGE WARS, I *LOVE* THEM! Brace fetishists I *hate* them! :)
I do not care much about syntax except:
- When overdone (inner classes, Java generics)
- Tries to be too clever (shells, Perl)
- Thinks tradition is better than clarity (static, volatile, protected, transient, ?:)
- Thinks that tooling solves all problems (C bastardy operator precedence, right recursive mindsets ...)
...
Hey, nobody knows the future! But we can all learn from the past:
You know that javac 1.3 (before 2000) already had generics? Check it out. Guess who put them there? ... Now think about why they did not resurface until 2004 in Java 5, and in the warped shape we all *LOVE*
You owe to yourself to check Scala, if only to see how it deals with types and functional constructs in an statically typed OO language (like Java).
See what any of the guys that REALLY know about language design and implementation what they think of Scala ... Like some of the ones involved with nurturing Java all these years: Steele, Bloch, Bracha, Gafter, ...
But none of these has anything to do with what will have success in the market ...
But just a couple of code samples:
What is this?
function send(msg: like Msg0): void {
msg.id = sendToServer(JSON.encode(msg))
database[msg.id] = copyMsg(msg)
}
And this?
def sort(a: List[Int]): List[Int] = {
if (a.length < 2)
a
else {
val pivot = a(a.length / 2)
sort(a.filter(_ < pivot)) :::
a.filter(_ == pivot) :::
sort(a.filter(_ > pivot))
}
}
Posted by Javier on January 30, 2008 at 02:28 PM MST #
LANGUAGE WARS, I *LOVE* THEM! Brace fetishists I *hate* them! :)
I do not care much about syntax except:
- When overdone (inner classes, Java generics)
- Tries to be too clever (shells, Perl)
- Thinks tradition is better than clarity (static, volatile, protected, transient, ?:)
- Thinks that tooling solves all problems (C bastardy operator precedence, right recursive mindsets ...)
...
Hey, nobody knows the future! But we can all learn from the past:
You know that javac 1.3 (before 2000) already had generics? Check it out. Guess who put them there? ... Now think about why they did not resurface until 2004 in Java 5, and in the warped shape we all *LOVE*
You owe to yourself to check Scala, if only to see how it deals with types and functional constructs in an statically typed OO language (like Java).
See what any of the guys that REALLY know about language design and implementation what they think of Scala ... Like some of the ones involved with nurturing Java all these years: Steele, Bloch, Bracha, Gafter, ...
But none of these has anything to do with what will have success in the market ...
But just a couple of code samples:
What is this?
function send(msg: like Msg0): void {
msg.id = sendToServer(JSON.encode(msg))
database[msg.id] = copyMsg(msg)
}
And this?
def sort(a: List[Int]): List[Int] = {
if (a.length < 2)
a
else {
val pivot = a(a.length / 2)
sort(a.filter(_ < pivot)) :::
a.filter(_ == pivot) :::
sort(a.filter(_ > pivot))
}
}
Posted by Javier on January 30, 2008 at 02:30 PM MST #
Comments are closed for this entry.

Feel free to contact me at rhightower AT arc DASH mind DOT com
Rick's bio
Rick Hightower serves as chief technology officer for ArcMind Inc., a training and consulting firm focusing on JEE, Spring, JPA and JSF. He is coauthor of the popular book Java Tools for Extreme Programming, about applying extreme programming to J2EE development, as well as co-author of Professional Struts and Struts Live (which can be downloaded from TSS). Rick, a frequent IBM developerWorks contributor, was an early advocate of JSF, Spring and Hibernate and wrote a series of articles for IBM developerWorks to dispel common JSF FUD. In addition to consulting and programming daily, Rick has written several courses on Ajax, JSF, Struts, Spring, Spring MVC, JPA and more. Rick is also the founding developer on the Crank project which is an JSF/Facelets, Ajax, CRUD framework for idiomatically developing GUIs. Rick has 26 software development certifications, 17 years development experience and has been director of development at three different software development firms as well as CTO of two different consulting/training companies before founding ArcMind Inc. in 2004.



