>> "The second half of the book is how to apply the principles to Java code. Which is horrendous! Not the book. If you should be so unfortunate to be stuck trying to write good code in Java, the book is a great, lucid description of how to do so. Yet in Java, it’s hard to get anything shorter than ten or twenty lines of code. See some code duplication, and by the time you’ve written the classes and interfaces and methods you need to write to remove the duplication, the code is just as long as it was before."
Yeah you're doing something wrong there. I know it's fashionable to bash Java and say how lame and verbose it is, but it does wear a bit thin. I actually enjoy writing Java. Perhaps due to me having grown up programming assembly - I don't mind verbosity. Java is an extremely solid fast language.
Right - Java as a word is heavily overloaded ;). For me, that's the bit that matters - the JVM. Java is just something I use because it's easier than writing bytecode :/
Java as a language, the syntax, is for me sane. It gets a lot of things right, and some things wrong, but on balance, it's sane enough to use. Just like English as a language is sane enough to use, whilst having lots of stupid inconsistencies in spelling/pronunciation etc.
And it's likely to be the fastest/most optimized of any JVM target language.
And a big part of the value proposition of Clojure is that it gives you Lisp's ability to eliminate almost all duplication with macros alongside most of the benefits of Java.
Appreciated. BTW I thought that was the only part of your post that was putting down another language. But it didn't seem deliberate, just a casual and unconscious going-with-the-flow put-down of java. As axon said, many people do it. I was struck by your preface + the following statement:
My statements that I prefer Arc for the kind of programming I do was not intended to be a put-down of other languages.
If you should be so unfortunate to be stuck trying to write good code in Java, ...
One solution is to remove the connotations, eg:
If you are writing code in Java, ...
Note: this version is more concise :-)
But please keep the factual points, such that Java's verbosity can mean that removing duplication doesn't make it shorter. I thought that was an insightful and pithy expression of the idea. But I also note that that's not the only benefit of removing duplication.
np :) and apologies for taking the comments off topic.
Do linguists agonize over language efficiency as much as some programmers do? For example, writing English is maybe far more letters/strokes than Japanese (idk), but we don't all start learning Japanese and bash English.
If the Sapir-Whorf hypothesis is true, then they should if they don't already. If the Sapir-Whorf hypothesis is true for programming languages, then our agonizing is perfectly reasonable.
I often get jumped on for my views, but S-W is true, and untrue. Untrue in that absence of a direct expression implies absence of concept; true in that absence of a direct expression impedes such an expression, such that it is less likely to get used, and hence, less efficient, and less likely to be conceived.
And I certainly agree that S-W applies for human and computer languages alike.
From what I have seen (not much, but probably more than most programmers), they don't. I suspect the reason is because everybody has at least one native spoken language, but programming languages are not native in the same way; they are acquired, and so are not perceived as a necessity.
And as such, for most people it is much harder to have a "favorite spoken language" that they can use as a platform to bash other languages. The way that programmers, text editor users, and coffee drinkers bash each other is bashing someone for an acquired taste. Bashing other languages is almost like bashing someone's physical appearance, and the immaturity becomes very obvious a lot quicker.
Also, regarding compactness of the spoken language, on average, English is longer than, say, Chinese. But brevity is NOT the goal. The tradeoff is redundancy, which English has much more of (e.g. parallelism and verb/plurality agreement). Old Chinese, with all its homophones, has plenty of texts written so compactly that if you don't read the text you will not understand it (at least for modern pupils).
I'm just imagining an anti-English troll, extolling the virtues of Japanese. Actually, Outliers makes the point that Korean has logical words for numbers, which makes maths a bit more accessible. I have to agree, I mean "eleven, twelve". I was irritated with the nonsensical naming of numbers as a child, especially when people said that mathematics was logical.
Comments
>> "The second half of the book is how to apply the principles to Java code. Which is horrendous! Not the book. If you should be so unfortunate to be stuck trying to write good code in Java, the book is a great, lucid description of how to do so. Yet in Java, it’s hard to get anything shorter than ten or twenty lines of code. See some code duplication, and by the time you’ve written the classes and interfaces and methods you need to write to remove the duplication, the code is just as long as it was before."
Yeah you're doing something wrong there. I know it's fashionable to bash Java and say how lame and verbose it is, but it does wear a bit thin. I actually enjoy writing Java. Perhaps due to me having grown up programming assembly - I don't mind verbosity. Java is an extremely solid fast language.
Java is an extremely solid fast language.
You mean "the JVM is an extremely solid fast runtime" - languages by themselves aren't fast or slow ;-)
Right - Java as a word is heavily overloaded ;). For me, that's the bit that matters - the JVM. Java is just something I use because it's easier than writing bytecode :/
Java as a language, the syntax, is for me sane. It gets a lot of things right, and some things wrong, but on balance, it's sane enough to use. Just like English as a language is sane enough to use, whilst having lots of stupid inconsistencies in spelling/pronunciation etc.
And it's likely to be the fastest/most optimized of any JVM target language.
And a big part of the value proposition of Clojure is that it gives you Lisp's ability to eliminate almost all duplication with macros alongside most of the benefits of Java.
I apologize, it was not my intent to bash Java.
Appreciated. BTW I thought that was the only part of your post that was putting down another language. But it didn't seem deliberate, just a casual and unconscious going-with-the-flow put-down of java. As axon said, many people do it. I was struck by your preface + the following statement:
My statements that I prefer Arc for the kind of programming I do was not intended to be a put-down of other languages.
If you should be so unfortunate to be stuck trying to write good code in Java, ...
One solution is to remove the connotations, eg:
If you are writing code in Java, ...
Note: this version is more concise :-)
But please keep the factual points, such that Java's verbosity can mean that removing duplication doesn't make it shorter. I thought that was an insightful and pithy expression of the idea. But I also note that that's not the only benefit of removing duplication.
Thank you. I rewrote that paragraph.
np :) and apologies for taking the comments off topic.
Do linguists agonize over language efficiency as much as some programmers do? For example, writing English is maybe far more letters/strokes than Japanese (idk), but we don't all start learning Japanese and bash English.
If the Sapir-Whorf hypothesis is true, then they should if they don't already. If the Sapir-Whorf hypothesis is true for programming languages, then our agonizing is perfectly reasonable.
http://en.wikipedia.org/wiki/Sapir–Whorf_hypothesis
I often get jumped on for my views, but S-W is true, and untrue. Untrue in that absence of a direct expression implies absence of concept; true in that absence of a direct expression impedes such an expression, such that it is less likely to get used, and hence, less efficient, and less likely to be conceived.
And I certainly agree that S-W applies for human and computer languages alike.
From what I have seen (not much, but probably more than most programmers), they don't. I suspect the reason is because everybody has at least one native spoken language, but programming languages are not native in the same way; they are acquired, and so are not perceived as a necessity.
And as such, for most people it is much harder to have a "favorite spoken language" that they can use as a platform to bash other languages. The way that programmers, text editor users, and coffee drinkers bash each other is bashing someone for an acquired taste. Bashing other languages is almost like bashing someone's physical appearance, and the immaturity becomes very obvious a lot quicker.
Also, regarding compactness of the spoken language, on average, English is longer than, say, Chinese. But brevity is NOT the goal. The tradeoff is redundancy, which English has much more of (e.g. parallelism and verb/plurality agreement). Old Chinese, with all its homophones, has plenty of texts written so compactly that if you don't read the text you will not understand it (at least for modern pupils).
I'm just imagining an anti-English troll, extolling the virtues of Japanese. Actually, Outliers makes the point that Korean has logical words for numbers, which makes maths a bit more accessible. I have to agree, I mean "eleven, twelve". I was irritated with the nonsensical naming of numbers as a child, especially when people said that mathematics was logical.