9 Replies - 3904 Views - Last Post: 25 March 2011 - 09:16 AM

#1 EarthShaker  Icon User is offline

  • D.I.C Head

Reputation: 55
  • View blog
  • Posts: 186
  • Joined: 16-March 11

An interesting interview with Steve Yegge and James Duncan about Java

Post icon  Posted 20 March 2011 - 10:02 PM

Well I was sniffing around looking for a piece of text to read and I came across a short but interesting interview with Steve Yegge, I feel he got many points in his statements. What do you think?

What is your experience with Java?
I was a card-carrying member of the Java community from late 1996 through mid-2003. I used Java to build a cool, multiplayer, user-extensible online game. Java got me really far, and I loved it for seven years.

Why did you start looking at other languages?
I simply hit a productivity wall. As my code base grew, my innovation slowed, until finally, tasks were taking me an order of magnitude longer than I felt they should. I stopped development for six months and did a deep-dive investigation to figure out what the heck was going wrong. It wasn't what I expected. The problem was Java. I was pretty unhappy about this. I'd invested an awful lot in Java. AOP helped a little (albeit at a high entry cost), but nowhere near enough. Nothing else helped at all. What I needed was a new language.

How does Java hold you back?
First, Java offers an impoverished set of abstractions. No first-class functions, no reference parameters, no keyword or default params, no destructuring bind or even parallel assignment, no way to return multiple values efficiently, no continuations, no user-defined operators, no generators, no closures, no tuples...the list just goes on. Java's about 25 teeth shy of a full mouth.

Second, Java is entirely nonextensible. It can't grow. There's no metaprogramming, no macros, no templates, nothing that gives you syntactic abstraction. So, Java's incompressible. Java code is always filled with stuff that looks like copy and paste, but you can't factor it out. Java code and APIs always wind up bloated (and yet oddly impressive looking).

Third, Java can express code, but not data. You're stuck using property files, XML, and other means of defining data. But the line between code and data is blurrythink about configuration, for example. So, the Java folks are piling on framework after framework, creating this huge pipeline of transformations that can't be expressed in Java.

Fourth, Java's static type system sucks. Actually, all static type systems suck, but Java's is worse than most. It gives you only narrow avenues along which you're permitted to think. Java programmers must painstakingly learn to pound star-shaped pegs into square holes; this is what design patterns are mostly about.

Fifth, Java has far too much nonessential complexity. For instance, it now has four kinds of types: primitives, classes, arrays, and enums. All the type types have their own syntax and semantics, which you must learn and then handle in your APIs. It's not just types, either. Java's entire syntax is large and bureaucratic. Java's syntax is complex for no good reason.


A brief bio about Steve Yegge:

Quote

Steve Yegge, a graduate of the University of Washington, spent five years as an Assembly-language programmer at Geoworks and more than six years as a software development manager at Amazon.com. Steve somehow managed to find time to design, implement, and maintain a massive multiplayer game called Wyvern (http://www.cabochon.com/), with a half-million lines of Java and Python code.

This post has been edited by EarthShaker: 20 March 2011 - 10:50 PM


Is This A Good Question/Topic? 2
  • +

Replies To: An interesting interview with Steve Yegge and James Duncan about Java

#2 MaverickDavidian  Icon User is offline

  • D.I.C Head

Reputation: 23
  • View blog
  • Posts: 67
  • Joined: 15-April 09

Re: An interesting interview with Steve Yegge and James Duncan about Java

Posted 20 March 2011 - 10:13 PM

This is why we have multiple languages. I'm no Java zombie by any means, but it has its domains--small-medium scale projects where you need a lot of portability, e.g., smartphone apps. This is why most major game companies ask for strong C++ skills, and usually don't give a damn about your Java skills.
Was This Post Helpful? 0
  • +
  • -

#3 macosxnerd101  Icon User is online

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12115
  • View blog
  • Posts: 45,061
  • Joined: 27-December 08

Re: An interesting interview with Steve Yegge and James Duncan about Java

Posted 20 March 2011 - 10:20 PM

Quote

There's no metaprogramming

Completely untrue. Metaprogramming isn't great in Java, but it is feasible with reflection.

Quote

no way to return multiple values efficiently

This is a bad thing? I think it encourages developers to look at how they can better organize their data.

Quote

no user-defined operators

Again, not a bad thing. It adds clarity to the code not have this. Why would we compare two arrays using the < or > operators? It doesn't make sense.

Quote

no templates

The Java equivelant of C++ templates is generics.

Quote

Java's syntax is complex for no good reason.

In certain cases, I agree. Threading and File I/O are two good examples of this. It takes more code to work with Threads and Files in Java than most other languages.
Was This Post Helpful? 0
  • +
  • -

#4 EarthShaker  Icon User is offline

  • D.I.C Head

Reputation: 55
  • View blog
  • Posts: 186
  • Joined: 16-March 11

Re: An interesting interview with Steve Yegge and James Duncan about Java

Posted 20 March 2011 - 10:23 PM

To extend this discussion, Here is another interesting interview with James Duncan Davidson, The inventor of Ant and Tomcat.

What do you like best about Java?
At the time, it seemed like a really good idea. Mostly, for what Java was designed for, they got it right. Of course, it's a strongly typed language, which for some purposes is great, and other purposes not.

Why do you think it's so successful?
I think it comes down to the fact that server-side programming in Perl and the like was inefficient, and server-side programming in C and C++ was hard. Java, and servlets in particular, busted open a door for Java where it could really take root.
I may be biased because of my involvement with servlets, but Java without the server side wasn't that interesting. It still isn't. Sure, J2ME is on bazillions of mobile devices, but there aren't that many apps thereand the APIs there are limited unless you actually make the cell phone.


What don't you like?
Strong typing. Reliance on APIs rather than frameworks. That's a subtle but important distinction. The increasing complexity of even basic APIs. For example, you can't just write a servlet anymore, you have to write a servlet, then edit an XML file. They're killing off the approachability that helped servlets get off the ground. With it, the rest of the server stack gets more and more difficult to work with.
And reliance on tools to make it easy is a cop-out.
As well, I don't like the massive monolithic approach to "Editions." Most people don't need J2EE. They need a web container. End of story.
I also don't like the incredible jump to complexity that Java seems to engender in people. No other platform has grown as fast and as elephantine as Java. Other platforms are as capable, but are 5% of the size. There's an architectural reason for that. And, really, Java the language isn't at fault. Java the class libraries are. They encourage massively inefficient design. Ever see a stack trace come out of a JSP/servlet/J2EE container? The 44 pages of stack call should be a hint.


How does Java hold you back?
It doesn't. I don't use Java much anymore. I use other languages like Python, Ruby, and ObjC.
And I wish that more tools would just remember the lessons of Unix: small pieces loosely joined. There is no one übersolution, and at the end of the day, if you can take two tools and pipe stuff between them, you have a more powerful and flexible solution than any monolithic beast. And one in which users can discover uses far more powerful than you can imagine.


What emerging alternatives make sense to you, if any?
Ruby on Rails has picked up an amazing amount of traction for server-side stuff. If you need to slush around mass amounts of content, there are content databases (like MarkLogic) that are interesting that use XQuery to work with the stuff inside. On the GUI front, well, Java wasn't a contender, so everything is already an alternative.

What would prompt (or did prompt) you to move away from Java, or .NET?
I shifted focus into the GUI application space. Java and GUIs don't mix. Friends don't let friends Swing.

I hope you enjoy these two interviews as much as I do.

This post has been edited by EarthShaker: 20 March 2011 - 10:36 PM

Was This Post Helpful? 0
  • +
  • -

#5 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 614
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: An interesting interview with Steve Yegge and James Duncan about Java

Posted 21 March 2011 - 09:02 AM

View PostMaverickDavidian, on 21 March 2011 - 05:13 AM, said:

This is why we have multiple languages. I'm no Java zombie by any means, but it has its domains--small-medium scale projects where you need a lot of portability, e.g., smartphone apps. This is why most major game companies ask for strong C++ skills, and usually don't give a damn about your Java skills.


But that's mostly applicable to the JVM as a hole and not just to Java. I can write Android apps in Scala and Clojure if I want to. Java isn't the only game in town on the JVM, and thus Java being served by the JVM's portability doesn't make it any more desirable.

View Postmacosxnerd101, on 21 March 2011 - 05:20 AM, said:

Quote

There's no metaprogramming

Completely untrue. Metaprogramming isn't great in Java, but it is feasible with reflection.


But it isn't great. It isn't even good. Steve Yegge is a Lisp guy. If you've used a Lisp, you automatically have a strong opinion on what metaprogramming should look like, and this is far from it.

View Postmacosxnerd101, on 21 March 2011 - 05:20 AM, said:

Quote

no way to return multiple values efficiently

This is a bad thing? I think it encourages developers to look at how they can better organize their data.

Quote

no user-defined operators

Again, not a bad thing. It adds clarity to the code not have this. Why would we compare two arrays using the < or > operators? It doesn't make sense.


Methinks both of these are cases advocating that languages should purposely limit features that are useful when used properly just because some people make use them improperly. In some cases, it can be a good idea, but not in all of them. In the specific case of not allowing user-defined operators, you have to look at the number of languages that actually do. For example, Haskell math operators such as +, -, /, and * are all just normal functions with infix rules. You can define your own functions with operatorish names like these with their own infix rules as well. In Lisp languages, thanks to macros, you can add these sorts of features to the language itself, and thus you're only limited by naming conventions. The big divide here is that Java has a concept of 'operator' and the other languages don't. </sleepdeprivationdrivenrant>
Was This Post Helpful? 0
  • +
  • -

#6 macosxnerd101  Icon User is online

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12115
  • View blog
  • Posts: 45,061
  • Joined: 27-December 08

Re: An interesting interview with Steve Yegge and James Duncan about Java

Posted 21 March 2011 - 02:39 PM

Java is an OO language. If you're looking at returning multiple values, then you should be looking at how to better structure and organize the data as Objects. Returning multiple values defeats this purpose. Even if we look at mathematical operations, we would return a solution set, not all the values individually.
Was This Post Helpful? 0
  • +
  • -

#7 dorknexus  Icon User is offline

  • or something bad...real bad.
  • member icon

Reputation: 1272
  • View blog
  • Posts: 4,625
  • Joined: 02-May 04

Re: An interesting interview with Steve Yegge and James Duncan about Java

Posted 21 March 2011 - 06:56 PM

Wait. What part of the OO paradigm says you can/should only return a single element from a function call?

I think the real reason for single element return is because most processors only define a single register for preserving return values.

There are plenty of OO languages which are probably more pure than Java from an OO stance that allow the return of multiple elements.

This post has been edited by Dark_Nexus: 21 March 2011 - 06:57 PM

Was This Post Helpful? 2
  • +
  • -

#8 macosxnerd101  Icon User is online

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12115
  • View blog
  • Posts: 45,061
  • Joined: 27-December 08

Re: An interesting interview with Steve Yegge and James Duncan about Java

Posted 21 March 2011 - 07:01 PM

Imo, it's better design to organize the return data. It just seems sloppy to return multiple values from a function. I believe a stronger design and organization of the data will allow for cleaner, more organized code in general. More of a personal preference, I guess.
Was This Post Helpful? 0
  • +
  • -

#9 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 2383
  • View blog
  • Posts: 4,983
  • Joined: 11-December 07

Re: An interesting interview with Steve Yegge and James Duncan about Java

Posted 25 March 2011 - 08:55 AM

Sometimes two return values really is what you want. I really hate writing functions to find max and min values in Java. Specifically, I hate writing routines that find both.

Java seems to make me want to write separate methods for the max and min. But then I have to loop through my collection twice. That's obviously stupid.

Well, I could use in-out parameters instead... except Java doesn't really support that. I could hack it by wrapping the values in an array, or maybe I could write a mutable wrapper class that I can pass an instance of. Hold on, if I'm writing classes why not just write a class to encapsulate the concept "extremities of a range" and return that!

In a sane world I could write this code.
// What I want to be able to write
public int, int getMinAndMax(int[] arr) {
  int min = arr[0], max = arr[0];
  // some code here, probably involving a loop.
  return min, max;
}


This is what Java wants me to write. :(
public int, int getMinAndMax(int[] arr) {
  int min = arr[0], max = arr[0];
  // some code here, probably involving a loop.
  return new ExtremitiesOfARange(min, max);
}

/**
 * A mostly useless class to encapsulate the concept of extreme values.
 */
public final class ExtremitiesOfARange {
  private final int min, max;
  
  public ExtremitiesOfARange(int min, int max) {
    this.min = min;
    this.max = max;
  }

  public final int getMin() {return min;}
  public final int getMax() {return max;}
}

Was This Post Helpful? 0
  • +
  • -

#10 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 2383
  • View blog
  • Posts: 4,983
  • Joined: 11-December 07

Re: An interesting interview with Steve Yegge and James Duncan about Java

Posted 25 March 2011 - 09:16 AM

So let's keep going down the track of "cleaner, more organized code" and see where it takes us. As it stands, our extremities class is an anaemic data class. That min-max function could easily be incorporated as a static method. We would never have to write that min-max method again!


public final class ExtremitiesOfARange {
  private final int min, max;
  
  public ExtremitiesOfARange(int min, int max) {
    this.min = min;
    this.max = max;
  }

  public final int getMin() {return min;}
  public final int getMax() {return max;}

  public static ExtremitiesOfARange getMinAndMax(int[] arr) {
    int min = arr[0], max = arr[0];
    // some code here, probably involving a loop.
    return new ExtremitiesOfARange(min, max);
  }
}


That method is actually looking rather like a constructor so let's move the code there. It allows us to remove the static method which is great because static methods are bad OO practice. While we are at it, let's make the constructor private and provide a static factory method because static factory methods are good OO practice.

public final class ExtremitiesOfARange {
  private final int min, max;
  
  private ExtremitiesOfARange(int[] arr) {
    int min = arr[0], max = arr[0];
    // some code here, probably involving a loop.
    this.min = min;
    this.max = max;
  }

  public final int getMin() {return min;}
  public final int getMax() {return max;}

  public static ExtremitiesOfARange instantiateExtremitiesOfARangeFromAnArray(int[] arr) {
    return new ExtremitiesOfARange(arr);
  }
}



All this, and guess how anyone would use it:

ExtremitiesOfARange temp = ExtremitiesOfARange.instantiateExtremitiesOfARangeFromAnArray(arr);
int min = temp.getMin();
int max = temp.getMax();


Sometimes you really do just want two numbers.

This post has been edited by cfoley: 25 March 2011 - 09:17 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1