The year of Linux is long passed. Linux will have a strong position on the server for a long time, but as GNOME and KDE bickered with each other, Apple came along and gave the world a great desktop UNIX.
After I started studying CS in 2000 and having never tried Linux/Unix I toyed around with Desktop Linux for a couple of years. I tried 8-10 different distros, even paid for Xandros 2.0 (this was before Ubuntu was all the rage). And for while I was kinda satisfied.
Then my friend tried a Cube for a couple of months and wholeheartedly recommended OS X, people started raving about OS X on slashdot, and in 2004 I bought a PowerBook on which I am writing this... and I never looked back.
I think you're right when you say that you have to be careful with the + operator in java. But your example may not be the best.
According to "Java Performance Tuning (1st ed.)" by Jack Shirazi your example string is actually resolved at compile time (but that's not what the javadoc for StringBuffer says). Eg.
String newString = "this" + " language " + "sucks";
is compiled as if it read:
String newString = "this language sucks";
Of course, when an expression involving String concatenation cannot be resolved at compile time, the concatenation must execute at runtime. Eg.
public String languageSucks(String language) {
return "The " + language + " programming language sucks";
}
could be compiled as:
public String languageSucks(String language) {
return (new StringBuffer()).append("The
".append(language).
append(" programming language sucks").toString();
After I started studying CS in 2000 and having never tried Linux/Unix I toyed around with Desktop Linux for a couple of years. I tried 8-10 different distros, even paid for Xandros 2.0 (this was before Ubuntu was all the rage). And for while I was kinda satisfied.
Then my friend tried a Cube for a couple of months and wholeheartedly recommended OS X, people started raving about OS X on slashdot, and in 2004 I bought a PowerBook on which I am writing this... and I never looked back.
I think you're right when you say that you have to be careful with the + operator in java. But your example may not be the best.
According to "Java Performance Tuning (1st ed.)" by Jack Shirazi your example string is actually resolved at compile time (but that's not what the javadoc for StringBuffer says). Eg.
is compiled as if it read:
Of course, when an expression involving String concatenation cannot be resolved at compile time, the concatenation must execute at runtime. Eg.
could be compiled as: