<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for bb-generations blog</title>
	<atom:link href="http://bbgen.net/blog/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://bbgen.net/blog</link>
	<description>blogging about IT</description>
	<lastBuildDate>Fri, 20 Jan 2012 14:25:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>Comment on Java needs operator overloading by Emul</title>
		<link>http://bbgen.net/blog/2011/06/java-operator-overloading/#comment-366</link>
		<dc:creator>Emul</dc:creator>
		<pubDate>Fri, 20 Jan 2012 14:25:46 +0000</pubDate>
		<guid isPermaLink="false">http://bbgen.net/blog/?p=107#comment-366</guid>
		<description>I&#039;ve been a developer for nearly 40 years, mostly in the engineering and scientific realm.  Of course COBOL was useless for these types of applications so we did a lot in Assembly language.  When WATFOR finally came out we could use Fortran for our needs.  And finally C++ became the language of choice.  I had high hopes for Java, but they were soon dashed after I saw many Java forum posts being shot down by the MVPs and experts at Sun.  All we wanted was operator overloading for complex numbers, matrices, quaternions, and vectors.  It&#039;s a simple request.  No changes to the runtime or JRE are needed.  But over and over again the requests from the engineering and scientific community were decried.  

The powers-that-be gave pitiful excuses such as &quot;That&#039;s just syntactic sugar.&quot;  Well then tell me what isn&#039;t?  Do you toggle your programs into the box in binary?  Everything beyond that IS syntactic sugar.  It&#039;s not a would-be-nice-if request, it&#039;s very basic and essential - a huge missing capability in Java.  

Others claimed that somebody could overload the addition operator so that it performs division!  Hmm.  Well heck, I could overload println() so that it deletes all of the files in user-land; and that&#039;s without operator overloading.  We&#039;re not asking to be able to overload the scoping operator - just math, indexing, and assignment.  It&#039;s just syntax - but important syntax.  If you are a business/website developer you may not appreciate the criticality, but imagine that somebody takes away java.net/java.web and makes you use JNI to access sockets!  I&#039;ve written many apps with thousands of lines of matrix math.

(I guess if you&#039;re a business-app developer, the engineering and scientific world looks scary and strange - something to actively avoid.)

So most of us left for greener pastures - often to Microsoft C# where we could do math beyond simple arithmetic without writing illegible code.  After a few years away from Java I have now revisited these forums only to discover that nobody is asking for operator overloading anymore - at least not in the past few years.  Why not?  It&#039;s not lack of interest.  The rest of us were just smart enough to abandon ship when it made sense.  So I did some research.  Try to search for engineering and scientific libraries and apps in Java, then do the same for .NET.  There are some Java academic projects, but not many serious products out there.  The few that exist are typically rudimentary or make use of underlying C/C++ code via JNI.  It seems as if almost nobody is using Java for anything but business apps, most typically websites.  Graphical games, likewise - switch to .NET if you want 3D graphics, finite element analysis, solid modeling, or constructive solid geometry.  Oracle/Sun is deliberately shutting out a quarter of their potential market - and it&#039;s an important segment.

Note that this is not intended to be an insult but, rather, as advice.  General Patton was once advised that there was scuttlebutt about him going around.  He responded, &quot;Thanks, but I don&#039;t worry when I hear scuttlebutt - I worry when I stop hearing it.&quot;  Well Oracle/Sun - after looking at your forums it seems that you have stopped hearing the scuttlebutt.  So my only question for you remains: &quot;Is Java trying to be the COBOL of the 21st century?&quot;</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been a developer for nearly 40 years, mostly in the engineering and scientific realm.  Of course COBOL was useless for these types of applications so we did a lot in Assembly language.  When WATFOR finally came out we could use Fortran for our needs.  And finally C++ became the language of choice.  I had high hopes for Java, but they were soon dashed after I saw many Java forum posts being shot down by the MVPs and experts at Sun.  All we wanted was operator overloading for complex numbers, matrices, quaternions, and vectors.  It&#8217;s a simple request.  No changes to the runtime or JRE are needed.  But over and over again the requests from the engineering and scientific community were decried.  </p>
<p>The powers-that-be gave pitiful excuses such as &#8220;That&#8217;s just syntactic sugar.&#8221;  Well then tell me what isn&#8217;t?  Do you toggle your programs into the box in binary?  Everything beyond that IS syntactic sugar.  It&#8217;s not a would-be-nice-if request, it&#8217;s very basic and essential &#8211; a huge missing capability in Java.  </p>
<p>Others claimed that somebody could overload the addition operator so that it performs division!  Hmm.  Well heck, I could overload println() so that it deletes all of the files in user-land; and that&#8217;s without operator overloading.  We&#8217;re not asking to be able to overload the scoping operator &#8211; just math, indexing, and assignment.  It&#8217;s just syntax &#8211; but important syntax.  If you are a business/website developer you may not appreciate the criticality, but imagine that somebody takes away java.net/java.web and makes you use JNI to access sockets!  I&#8217;ve written many apps with thousands of lines of matrix math.</p>
<p>(I guess if you&#8217;re a business-app developer, the engineering and scientific world looks scary and strange &#8211; something to actively avoid.)</p>
<p>So most of us left for greener pastures &#8211; often to Microsoft C# where we could do math beyond simple arithmetic without writing illegible code.  After a few years away from Java I have now revisited these forums only to discover that nobody is asking for operator overloading anymore &#8211; at least not in the past few years.  Why not?  It&#8217;s not lack of interest.  The rest of us were just smart enough to abandon ship when it made sense.  So I did some research.  Try to search for engineering and scientific libraries and apps in Java, then do the same for .NET.  There are some Java academic projects, but not many serious products out there.  The few that exist are typically rudimentary or make use of underlying C/C++ code via JNI.  It seems as if almost nobody is using Java for anything but business apps, most typically websites.  Graphical games, likewise &#8211; switch to .NET if you want 3D graphics, finite element analysis, solid modeling, or constructive solid geometry.  Oracle/Sun is deliberately shutting out a quarter of their potential market &#8211; and it&#8217;s an important segment.</p>
<p>Note that this is not intended to be an insult but, rather, as advice.  General Patton was once advised that there was scuttlebutt about him going around.  He responded, &#8220;Thanks, but I don&#8217;t worry when I hear scuttlebutt &#8211; I worry when I stop hearing it.&#8221;  Well Oracle/Sun &#8211; after looking at your forums it seems that you have stopped hearing the scuttlebutt.  So my only question for you remains: &#8220;Is Java trying to be the COBOL of the 21st century?&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Java needs operator overloading by Daniel</title>
		<link>http://bbgen.net/blog/2011/06/java-operator-overloading/#comment-112</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Thu, 01 Sep 2011 14:54:29 +0000</pubDate>
		<guid isPermaLink="false">http://bbgen.net/blog/?p=107#comment-112</guid>
		<description>An manchen Tagen möcht ich Leuten die gegen Operatorüberladung sind einfach ins Gesicht schlagen. Heute ist soeiner. 
Graphikprogrammierung wird zu einer richtig hässlichen Sache wenn man Matrix und Vektoroperatoren nicht definieren kann aber noch schlimmer ist, dass wir im Unternehmen gerade das float primitive durch BigDecimal sollen. Wir sind echt am Überlegen auf die Genauigkeit zu pfeifen obwohl sie eigentlich erforderlich ist damit wir uns nicht mit .mul(), .add() usw. rumschlagen müssen. 

===
Operator-Überladung ist immer böse, weil es verschleiert, was hinter dem Code steckt.
===
Das macht jeder Methodenaufruf. Nur weil es Leute gibt die mit dem + operator Objekte multiplizieren ist das noch lang kein Grund operatorüberladung wegzulassen. In jedem Methodenaufruf kann genausoviel blödsinn gemacht werden. Operatoren sind nichts anderes als Methoden.</description>
		<content:encoded><![CDATA[<p>An manchen Tagen möcht ich Leuten die gegen Operatorüberladung sind einfach ins Gesicht schlagen. Heute ist soeiner.<br />
Graphikprogrammierung wird zu einer richtig hässlichen Sache wenn man Matrix und Vektoroperatoren nicht definieren kann aber noch schlimmer ist, dass wir im Unternehmen gerade das float primitive durch BigDecimal sollen. Wir sind echt am Überlegen auf die Genauigkeit zu pfeifen obwohl sie eigentlich erforderlich ist damit wir uns nicht mit .mul(), .add() usw. rumschlagen müssen. </p>
<p>===<br />
Operator-Überladung ist immer böse, weil es verschleiert, was hinter dem Code steckt.<br />
===<br />
Das macht jeder Methodenaufruf. Nur weil es Leute gibt die mit dem + operator Objekte multiplizieren ist das noch lang kein Grund operatorüberladung wegzulassen. In jedem Methodenaufruf kann genausoviel blödsinn gemacht werden. Operatoren sind nichts anderes als Methoden.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Java: Loading a SVG into a BufferedImage by Tyron</title>
		<link>http://bbgen.net/blog/2011/06/java-svg-to-bufferedimage/#comment-64</link>
		<dc:creator>Tyron</dc:creator>
		<pubDate>Wed, 27 Jul 2011 23:17:37 +0000</pubDate>
		<guid isPermaLink="false">http://bbgen.net/blog/?p=176#comment-64</guid>
		<description>Funny, I just got in contact with batik as well recently, for converting browser generated charts in svg. Though I avoided its use by converting the svg to a canvas with the js lib canvg, which in return can be saved as png directly.</description>
		<content:encoded><![CDATA[<p>Funny, I just got in contact with batik as well recently, for converting browser generated charts in svg. Though I avoided its use by converting the svg to a canvas with the js lib canvg, which in return can be saved as png directly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Java needs operator overloading by bb-generation</title>
		<link>http://bbgen.net/blog/2011/06/java-operator-overloading/#comment-6</link>
		<dc:creator>bb-generation</dc:creator>
		<pubDate>Mon, 13 Jun 2011 09:26:01 +0000</pubDate>
		<guid isPermaLink="false">http://bbgen.net/blog/?p=107#comment-6</guid>
		<description>Mit Operator Überladung ist es wie mit Klassenvererbung, Methoden-Namensgebung, usw. Man muss das ganze sinnvoll einsetzen.
[] bei einem Set zu überladen macht keinen Sinn, bei einer Map hingegen sehr wohl.
Eine Map ist ja eine eine eindeutige Beziehung A-&gt;B (wobei jedes A nur einem B zugeordnet ist). Folglich macht map[A] natürlich Sinn und es spricht auch nichts dagegen es einzusetzen.
Folglich gilt natürlich: Überlade Operatoren dann, wenn es sinnvoll ist und es dem Entwickler ohne groß nachzuschauen klar ist, was passiert. In den meisten Fällen, die ich bei guten libraries gesehen habe, ist dies der Fall.

Interessanter Punkt mit den Referenzen-Vergleich. Daran hatte ich wirklich nicht gedacht.
C++ umgeht halt das Problem, indem man klar den Unterschied zwischen Objekt und Pointer hat. In Java besteht da eine gewisse Transparenz.</description>
		<content:encoded><![CDATA[<p>Mit Operator Überladung ist es wie mit Klassenvererbung, Methoden-Namensgebung, usw. Man muss das ganze sinnvoll einsetzen.<br />
[] bei einem Set zu überladen macht keinen Sinn, bei einer Map hingegen sehr wohl.<br />
Eine Map ist ja eine eine eindeutige Beziehung A->B (wobei jedes A nur einem B zugeordnet ist). Folglich macht map[A] natürlich Sinn und es spricht auch nichts dagegen es einzusetzen.<br />
Folglich gilt natürlich: Überlade Operatoren dann, wenn es sinnvoll ist und es dem Entwickler ohne groß nachzuschauen klar ist, was passiert. In den meisten Fällen, die ich bei guten libraries gesehen habe, ist dies der Fall.</p>
<p>Interessanter Punkt mit den Referenzen-Vergleich. Daran hatte ich wirklich nicht gedacht.<br />
C++ umgeht halt das Problem, indem man klar den Unterschied zwischen Objekt und Pointer hat. In Java besteht da eine gewisse Transparenz.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Java needs operator overloading by Tobias</title>
		<link>http://bbgen.net/blog/2011/06/java-operator-overloading/#comment-5</link>
		<dc:creator>Tobias</dc:creator>
		<pubDate>Sun, 12 Jun 2011 23:51:46 +0000</pubDate>
		<guid isPermaLink="false">http://bbgen.net/blog/?p=107#comment-5</guid>
		<description>Operator-Überladung ist immer böse, weil es verschleiert, was hinter dem Code steckt. Eins der größten Probleme von C++ ist, dass man ein Stück Code ohne Kontext nicht verstehen _kann_, weil durch z.B. Operator-Überladung der identische Code einmal dies oder einmal etwas ganz anderes bedeuten kann. (C++ ist kontext-abhhängig.)

Ich durfte mal an einem Framework (C++) mitarbeiten, bei dem der Hauptentwickler ein Verfechter von Templates und Operator-Überladung war. Glaub mir, das macht keinen Spaß. Selbst in einfachen Fällen wie in deinem []-Beispiel ist der resultierende Code verwirrend. Man _muss_ wissen, dass die verwendete Klasse den []-Operator überlädt _und_ was die Klasse in dem Fall tut. Das ist bei [] ja nun nicht immer so klar. (Was macht der Operator z.B. bei einer Map? Oder bei einem Set?) Man braucht also Kontext und Dokumentation. Das ist schlecht.

Dein Beispiel mit den Integer-Objekten ist eher weniger gut. Der ==-Operator ist klar definiert: Er vergleicht Objekt-Referenzen bzw. bei primitiven Datentypen den Wert.

Nur weil es Klassen gibt, die primitive Datentypen wrappen können, heißt das ja nicht, dass der ==-Operator in diesem speziellen Fall eine andere Funktion haben sollte. Wenn man Objekt-Referenzen vergleicht, dann ==, wenn man Objekt-Inhalte vergleicht, dann equals().
Man kann jetzt natürlich trefflich darüber streiten, ob es bei der Spezifikation von Java nicht sinnvoller gewesen wäre, primitive Datentypen gleich als Objekte zu verstehen. Nun ist es aber nicht so, und daher sind auch die Operatoren entsprechend anzuwenden.

Und selbst wenn man den ==-Operator für z.B. Integer jetzt ändern würde (wenn man könnte): Wie vergleicht man dann Referenzen? Es kommt ja durchaus mal vor, dass man auch Integer-Referenzen vergleichen möchte. Dafür brauchte man dann plötzlich noch einen Operator, oder gar eine spezielle Methode. Das klingt für mich nicht so sinnvoll, um ehrlich zu sein. Einheitlichkeit ist bei Programmiersprachen wichtig.</description>
		<content:encoded><![CDATA[<p>Operator-Überladung ist immer böse, weil es verschleiert, was hinter dem Code steckt. Eins der größten Probleme von C++ ist, dass man ein Stück Code ohne Kontext nicht verstehen _kann_, weil durch z.B. Operator-Überladung der identische Code einmal dies oder einmal etwas ganz anderes bedeuten kann. (C++ ist kontext-abhhängig.)</p>
<p>Ich durfte mal an einem Framework (C++) mitarbeiten, bei dem der Hauptentwickler ein Verfechter von Templates und Operator-Überladung war. Glaub mir, das macht keinen Spaß. Selbst in einfachen Fällen wie in deinem []-Beispiel ist der resultierende Code verwirrend. Man _muss_ wissen, dass die verwendete Klasse den []-Operator überlädt _und_ was die Klasse in dem Fall tut. Das ist bei [] ja nun nicht immer so klar. (Was macht der Operator z.B. bei einer Map? Oder bei einem Set?) Man braucht also Kontext und Dokumentation. Das ist schlecht.</p>
<p>Dein Beispiel mit den Integer-Objekten ist eher weniger gut. Der ==-Operator ist klar definiert: Er vergleicht Objekt-Referenzen bzw. bei primitiven Datentypen den Wert.</p>
<p>Nur weil es Klassen gibt, die primitive Datentypen wrappen können, heißt das ja nicht, dass der ==-Operator in diesem speziellen Fall eine andere Funktion haben sollte. Wenn man Objekt-Referenzen vergleicht, dann ==, wenn man Objekt-Inhalte vergleicht, dann equals().<br />
Man kann jetzt natürlich trefflich darüber streiten, ob es bei der Spezifikation von Java nicht sinnvoller gewesen wäre, primitive Datentypen gleich als Objekte zu verstehen. Nun ist es aber nicht so, und daher sind auch die Operatoren entsprechend anzuwenden.</p>
<p>Und selbst wenn man den ==-Operator für z.B. Integer jetzt ändern würde (wenn man könnte): Wie vergleicht man dann Referenzen? Es kommt ja durchaus mal vor, dass man auch Integer-Referenzen vergleichen möchte. Dafür brauchte man dann plötzlich noch einen Operator, oder gar eine spezielle Methode. Das klingt für mich nicht so sinnvoll, um ehrlich zu sein. Einheitlichkeit ist bei Programmiersprachen wichtig.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

