Max Lybbert
Posts: 314
Nickname: mlybbert
Registered: Apr, 2005
|
|
Re: Verbosity in language design
|
Posted: Aug 24, 2006 12:04 PM
|
|
Sorry I didn't get a chance to reply earlier.
/* First of all the 32 to 3 figure is obviously nonsense because the 32 count includes the map() implementation and the 3 does not. */
I'll concede the point here, but I still believe that Java encourages unnecessary verbosity (see below).
/* (me) So, yes, to me, the fact that Java requires not just more code, but ten times the LOC is pertinent to me.
(response) I didn't say it wasn't pertinent. */
My response was to the line
/* That it takes more code is not pertinent nor is it interesting. */
And my response can be boiled down to "that it takes more code *is* pertinent to me." I didn't want to wade into any question outside of Java's verbosity. Which is why I relabeled my post.
Java has been held up for years as the poster child of good language design. And the big part of that "good design" is "Java *is* OOP" (compared to "Java *supports* OOP"). Java was advertised as great because you couldn't ever have anything that wasn't an object. No free-standing functions, no macros, nothing but objects. But what if you want a free-standing function? Well, you can forget about the "free-standing" part, but you can make it a class static method, which is pretty much the same thing. Although instead of writing int add_three(int x) , you need to write something like:
class Fugger
{
static int add_three(int x) { ... }
};
What use is class Fugger ? Absolutely no use at all. How about static ? Well, it just means that the useless class Fugger that we wrote doesn't have to actually be instantiated to use add_three . But we still have to write Fugger.add_three instead of simply add_three .
Whew. IOW, Java requires us to make an class to hold what could be a free-standing function, if only Java trusted us with one. And we have to always refer to that class if we ever want to use our method. At least Java doesn't require us to instantiate an object for add_three , but that's only because we asked Java nicely to let us use the method without making an object first.
These kinds of language issues are what I consider spinning my wheels, and why I believe Java is too verbose. http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html .
|
|