<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Sauberer Code]]></title><description><![CDATA[<pre><code>class Konto
{
	public:
		string bankname;
		string kontoinhaber;
		string bezahlungsmethode;
		int    kontonummer;
		int    guthaben;

		Konto::Konto(){
			this-&gt;bankname          = &quot;Standartname&quot;;
			this-&gt;kontoinhaber      = &quot;Sparkes Espanio&quot;;
			this-&gt;bezahlungsmethode = &quot;Paypal&quot;;
			this-&gt;kontonummer       = 10120012;
			this-&gt;guthaben          = 0;
		}

		int    Konto::getGuthaben()           const { return this-&gt;guthaben; }
		int    Konto::getKontonummer()        const { return this-&gt;kontonummer; }
		string Konto::getBankname()           const { return this-&gt;bankname; }
		string Konto::getKontoinhaber()       const { return this-&gt;kontoinhaber; }
		string Konto::getBezahlungsmethode()  const { return this-&gt;bezahlungsmethode; }

		void   Konto::KontoInfos(){
			cout &lt;&lt; this-&gt;getBankname() &lt;&lt; endl;
			cout &lt;&lt; this-&gt;getKontoinhaber() &lt;&lt; endl;
			cout &lt;&lt; this-&gt;getKontonummer() &lt;&lt; endl;
			cout &lt;&lt; this-&gt;getBezahlungsmethode() &lt;&lt; endl;
			cout &lt;&lt; this-&gt;getGuthaben() &lt;&lt; endl;
		}

		void   Konto::programmWarten(void){
			cin.clear ();
			cin.ignore();
			cin.get   ();
		}
};
</code></pre>
<p>Ich wollte mal eure Meinung hören<br />
Ist es so in Ordnung? sollte ich was dran verändern?<br />
Wie kann ich den Code verbessern?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/325947/sauberer-code</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 00:19:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/325947.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 24 May 2014 18:50:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Sauberer Code on Sat, 24 May 2014 18:50:11 GMT]]></title><description><![CDATA[<pre><code>class Konto
{
	public:
		string bankname;
		string kontoinhaber;
		string bezahlungsmethode;
		int    kontonummer;
		int    guthaben;

		Konto::Konto(){
			this-&gt;bankname          = &quot;Standartname&quot;;
			this-&gt;kontoinhaber      = &quot;Sparkes Espanio&quot;;
			this-&gt;bezahlungsmethode = &quot;Paypal&quot;;
			this-&gt;kontonummer       = 10120012;
			this-&gt;guthaben          = 0;
		}

		int    Konto::getGuthaben()           const { return this-&gt;guthaben; }
		int    Konto::getKontonummer()        const { return this-&gt;kontonummer; }
		string Konto::getBankname()           const { return this-&gt;bankname; }
		string Konto::getKontoinhaber()       const { return this-&gt;kontoinhaber; }
		string Konto::getBezahlungsmethode()  const { return this-&gt;bezahlungsmethode; }

		void   Konto::KontoInfos(){
			cout &lt;&lt; this-&gt;getBankname() &lt;&lt; endl;
			cout &lt;&lt; this-&gt;getKontoinhaber() &lt;&lt; endl;
			cout &lt;&lt; this-&gt;getKontonummer() &lt;&lt; endl;
			cout &lt;&lt; this-&gt;getBezahlungsmethode() &lt;&lt; endl;
			cout &lt;&lt; this-&gt;getGuthaben() &lt;&lt; endl;
		}

		void   Konto::programmWarten(void){
			cin.clear ();
			cin.ignore();
			cin.get   ();
		}
};
</code></pre>
<p>Ich wollte mal eure Meinung hören<br />
Ist es so in Ordnung? sollte ich was dran verändern?<br />
Wie kann ich den Code verbessern?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400699</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400699</guid><dc:creator><![CDATA[Kofi]]></dc:creator><pubDate>Sat, 24 May 2014 18:50:11 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sat, 24 May 2014 19:10:25 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>als aller erstes:<br />
'programmWarten' hat in einer Klasse 'Konto' mit Sicherheit nichts zu suchen!</p>
<p>'KontoInfos' ist gernzwertig, aber finde ich ok, auch wenn du wahrscheinlich noch andere Meinungen dazu hören wirst.<br />
(Eine Alternative ist eine freie Funktion, die ein Konto übergeben kriegt und vielleicht einen allgemeinen stream).</p>
<p>Im Konstruktor Initalisierungslisten verwenden.<br />
Und befremdlich finde ich, dass der Default-Konstruktor so konkrete Werte anlegt.</p>
<p>Namenskonventionen nicht einheitlich (einmal (), dann (void), KontoInfos gross, sonst klein)</p>
<p>Woher kennt er string im Header? namespace std global bekannt gemacht?</p>
<p>Gut ist auf jeden Fall, dass die getter const sind.<br />
Edit:<br />
Bzw. doch nicht. Warum getter, wenn die Member alle public sind?<br />
Die sollten (im Zweifel) private sein, dann machen die getter auch wieder Sinn.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400700</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400700</guid><dc:creator><![CDATA[Jockelx]]></dc:creator><pubDate>Sat, 24 May 2014 19:10:25 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sat, 24 May 2014 19:40:47 GMT]]></title><description><![CDATA[<p>(mit aus Bequemlichkeit abgekürzten Bezeichnern)</p>
<pre><code>struct Konto{
  string bank;
  string inhaber;
  string methode;
  int kto;
  int guthaben;
  Konto(void) : bank(&quot;...&quot;), inhaber(&quot;...&quot;), methode(&quot;...&quot;), kto(12345678), guthaben(123){};
  infos(void) const { 
    cout &lt;&lt; bank &lt;&lt; endl 
     &lt;&lt; kto &lt;&lt; endl
     /*... usw ...*/
     &lt;&lt; guthaben &lt;&lt; endl;
  }
  void warten(void) const { /* ... */ }
};
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2400704</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400704</guid><dc:creator><![CDATA[großbuchstaben]]></dc:creator><pubDate>Sat, 24 May 2014 19:40:47 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sat, 24 May 2014 20:08:57 GMT]]></title><description><![CDATA[<p>Jockelx schrieb:</p>
<blockquote>
<p>Hi,</p>
<p>als aller erstes:<br />
'programmWarten' hat in einer Klasse 'Konto' mit Sicherheit nichts zu suchen!</p>
<p>'KontoInfos' ist gernzwertig, aber finde ich ok, auch wenn du wahrscheinlich noch andere Meinungen dazu hören wirst.<br />
(Eine Alternative ist eine freie Funktion, die ein Konto übergeben kriegt und vielleicht einen allgemeinen stream).</p>
<p>Im Konstruktor Initalisierungslisten verwenden.<br />
Und befremdlich finde ich, dass der Default-Konstruktor so konkrete Werte anlegt.</p>
<p>Namenskonventionen nicht einheitlich (einmal (), dann (void), KontoInfos gross, sonst klein)</p>
<p>Woher kennt er string im Header? namespace std global bekannt gemacht?</p>
<p>Gut ist auf jeden Fall, dass die getter const sind.<br />
Edit:<br />
Bzw. doch nicht. Warum getter, wenn die Member alle public sind?<br />
Die sollten (im Zweifel) private sein, dann machen die getter auch wieder Sinn.</p>
</blockquote>
<p>Ich habe die Klasse nicht in eine Header Datei geschrieben aber sonst finde ich<br />
deine Kritik gut</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400713</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400713</guid><dc:creator><![CDATA[Kofi]]></dc:creator><pubDate>Sat, 24 May 2014 20:08:57 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sat, 24 May 2014 20:13:38 GMT]]></title><description><![CDATA[<p>großbuchstaben schrieb:</p>
<blockquote>
<p>(mit aus Bequemlichkeit abgekürzten Bezeichnern)</p>
<pre><code>struct Konto{
  string bank;
  string inhaber;
  string methode;
  int kto;
  int guthaben;
  Konto(void) : bank(&quot;...&quot;), inhaber(&quot;...&quot;), methode(&quot;...&quot;), kto(12345678), guthaben(123){};
  infos(void) const { 
    cout &lt;&lt; bank &lt;&lt; endl 
     &lt;&lt; kto &lt;&lt; endl
     /*... usw ...*/
     &lt;&lt; guthaben &lt;&lt; endl;
  }
  void warten(void) const { /* ... */ }
};
</code></pre>
</blockquote>
<p>Das ist schwer lesbar</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400715</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400715</guid><dc:creator><![CDATA[Kofi]]></dc:creator><pubDate>Sat, 24 May 2014 20:13:38 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sat, 24 May 2014 20:17:11 GMT]]></title><description><![CDATA[<p>Dieses &quot;this-&gt;member&quot; kannst du auch als &quot;member&quot; schreiben</p>
<p>also return guthaben anstatt return this-&gt;guthaben</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400716</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400716</guid><dc:creator><![CDATA[hardware]]></dc:creator><pubDate>Sat, 24 May 2014 20:17:11 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sat, 24 May 2014 21:48:51 GMT]]></title><description><![CDATA[<p>Kofi schrieb:</p>
<blockquote>
<p>Ich wollte mal eure Meinung hören<br />
Ist es so in Ordnung?</p>
</blockquote>
<p>Ich hasse Denglisch. Ich kann es schon nicht ausstehen, wenn jemand deutsche Bezeichner verwendet, aber dann kommst du auch noch mit gemischten Bezeichnern wie getKontonummer(). Wie kann das sauber sein?<br />
Lass das (void) weg, das braucht man in C++ nicht.<br />
Dass Infos irgendwas über cout ausgibt, finde ich schlecht. Kann man zum Test mal machen, aber das hat in so einer Klasse nichts verloren. Logik und Darstellung muss man strikt trennen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400733</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400733</guid><dc:creator><![CDATA[Mechanics]]></dc:creator><pubDate>Sat, 24 May 2014 21:48:51 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sun, 25 May 2014 06:28:47 GMT]]></title><description><![CDATA[<p>Und das &quot;Konto::&quot; ist innerhalb der Klassendefinition auch unnötig (bzw. ist das überhaupt vom Standard so erlaubt?).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400741</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400741</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Sun, 25 May 2014 06:28:47 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sun, 25 May 2014 09:48:13 GMT]]></title><description><![CDATA[<p>Mechanics schrieb:</p>
<blockquote>
<p>Lass das (void) weg, das braucht man in C++ nicht.</p>
</blockquote>
<p>Mit (void) erkennt man auf einen Blick, ob es sich um eine leere Parameterliste oder um einen Funktionsaufruf mit leerer Argumentliste handelt, und das finde ich vorteilhaft. Ist natürlich Geschmacksfrage.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400752</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400752</guid><dc:creator><![CDATA[großbuchstaben]]></dc:creator><pubDate>Sun, 25 May 2014 09:48:13 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sun, 25 May 2014 14:46:53 GMT]]></title><description><![CDATA[<p>[quote=&quot;großbuchstaben&quot;]</p>
<p>Mechanics schrieb:</p>
<blockquote>
<p>Mit (void) erkennt man auf einen Blick, ob es sich um eine leere Parameterliste oder um einen Funktionsaufruf mit leerer Argumentliste handelt</p>
</blockquote>
<p>Mach mal ein Beispiel, mir ist spontan nicht ganz klar, wie du das genau meinst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400785</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400785</guid><dc:creator><![CDATA[Mechanics]]></dc:creator><pubDate>Sun, 25 May 2014 14:46:53 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sun, 25 May 2014 16:56:53 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">class A{};
A foo(void){}
A a = foo();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2400797</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400797</guid><dc:creator><![CDATA[großbuchstaben]]></dc:creator><pubDate>Sun, 25 May 2014 16:56:53 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sun, 25 May 2014 17:01:59 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">A foo(){}
</code></pre>
<p>Da erkennt man aber auch auf einen Blick, dass es sich um eine leere Parameterliste handelt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400798</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400798</guid><dc:creator><![CDATA[aufeinenblick]]></dc:creator><pubDate>Sun, 25 May 2014 17:01:59 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sun, 25 May 2014 17:20:40 GMT]]></title><description><![CDATA[<p>Das (void) ist ein syntaktischer Spezialfall, den man sich für ANSI-C ausgedacht hat, weil man die Kompatibilität zu K&amp;R bewahren wollte. In C++ sollte man das IMHO nicht verwenden. Das Argument von großbuchstaben finde ich nicht überzeugend. Nichtmal ansatzweise, sorry.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400801</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400801</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Sun, 25 May 2014 17:20:40 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sun, 25 May 2014 17:25:41 GMT]]></title><description><![CDATA[<p>Ich würde die Information, dass es man da dran erkennen könnte, verwirrender finden, als die Erkenntnis, die man dadurch gewinnt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400802</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400802</guid><dc:creator><![CDATA[Mechanics]]></dc:creator><pubDate>Sun, 25 May 2014 17:25:41 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sun, 25 May 2014 18:34:09 GMT]]></title><description><![CDATA[<p>Ich mach es zwar mittlerweile auch ohne extra void in der Klammer, da ich möglichst reduzierten (auch optisch) Code bevorzuge (sonst krieg ich Krämpfe im Kopf), finde die Konsistenz aber an sich ganz schnicke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400810</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400810</guid><dc:creator><![CDATA[Namenloser324]]></dc:creator><pubDate>Sun, 25 May 2014 18:34:09 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sun, 25 May 2014 18:35:45 GMT]]></title><description><![CDATA[<p>Namenloser324 schrieb:</p>
<blockquote>
<p>Ich mach es zwar mittlerweile auch ohne extra void in der Klammer, da ich möglichst reduzierten (auch optisch) Code bevorzuge (sonst krieg ich Krämpfe im Kopf), finde die Konsistenz aber an sich ganz schnicke.</p>
</blockquote>
<p>Addendum:<br />
Im Endeffekt aber wieder völlig nichtiges Thema, hauptsache man macht es konsistent.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400811</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400811</guid><dc:creator><![CDATA[Namenloser324]]></dc:creator><pubDate>Sun, 25 May 2014 18:35:45 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sun, 25 May 2014 18:42:20 GMT]]></title><description><![CDATA[<p>Tja - da sind wir eben verschieden.</p>
<p>wenn ich foo() in <strong>meinem</strong> Code sehe, sehe ich sofort, daß das keine Deklaration ist, und wenn ich foo(void) sehe, weiß ich sofort das Gegenteil.</p>
<p>Würde ich für beides &quot;foo()&quot; schreiben, dann bräuchte ich Kontext, bspw., was vor dem &quot;foo()&quot; steht - ein Klassenbezeichner, ein Gleichheitszeichen, ein Operator oder was Anderes.<br />
Das wäre mir eine unnötige Einbuße an Codelokalität - und Codelokalität ist mir wichtig <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f4a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--light_bulb"
      title=":bulb:"
      alt="💡"
    /></p>
<p>Also bleibt's beim (void).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400813</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400813</guid><dc:creator><![CDATA[großbuchstaben]]></dc:creator><pubDate>Sun, 25 May 2014 18:42:20 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sun, 25 May 2014 18:50:39 GMT]]></title><description><![CDATA[<p>Namenloser324 schrieb:</p>
<blockquote>
<p>Namenloser324 schrieb:</p>
<blockquote>
<p>Ich mach es zwar mittlerweile auch ohne extra void in der Klammer, da ich möglichst reduzierten (auch optisch) Code bevorzuge (sonst krieg ich Krämpfe im Kopf), finde die Konsistenz aber an sich ganz schnicke.</p>
</blockquote>
<p>Addendum:<br />
Im Endeffekt aber wieder völlig nichtiges Thema, hauptsache man macht es konsistent.</p>
</blockquote>
<p>nein. sowas nichtiges sollte man schon so machen wie alle anderen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400815</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400815</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sun, 25 May 2014 18:50:39 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sun, 25 May 2014 18:54:49 GMT]]></title><description><![CDATA[<p>Mechanics schrieb:</p>
<blockquote>
<p>Ich hasse Denglisch. Ich kann es schon nicht ausstehen, wenn jemand deutsche Bezeichner verwendet, aber dann kommst du auch noch mit gemischten Bezeichnern wie getKontonummer(). Wie kann das sauber sein?</p>
</blockquote>
<p>Es ist sauber. Wenn man deutsche Bezeichner nimmt, und dafür gibt es durchaus gute Gründe, dann ist getKotonummer vollkommen ok.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400816</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400816</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sun, 25 May 2014 18:54:49 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Sun, 25 May 2014 18:56:31 GMT]]></title><description><![CDATA[<p>volkard schrieb:</p>
<blockquote>
<p>Namenloser324 schrieb:</p>
<blockquote>
<p>Namenloser324 schrieb:</p>
<blockquote>
<p>Ich mach es zwar mittlerweile auch ohne extra void in der Klammer, da ich möglichst reduzierten (auch optisch) Code bevorzuge (sonst krieg ich Krämpfe im Kopf), finde die Konsistenz aber an sich ganz schnicke.</p>
</blockquote>
<p>Addendum:<br />
Im Endeffekt aber wieder völlig nichtiges Thema, hauptsache man macht es konsistent.</p>
</blockquote>
<p>nein. sowas nichtiges sollte man schon so machen wie alle anderen.</p>
</blockquote>
<p>Hauptsache man macht es konsistent steht da. D.h. arbeitet man in einem Projekt einigt man sich entweder auf eine Variante oder folgt halt der Masse falls du mit deiner Implikation, dass es alle so machen würden, recht hast.<br />
Arbeitet man alleine macht man es halt wie man möchte nur eben konsistent. Seitenweise (Achtung: Übertreibung) drüber zu diskutieren ist halt massive Zeitverschwendung.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400817</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400817</guid><dc:creator><![CDATA[Namenloser324]]></dc:creator><pubDate>Sun, 25 May 2014 18:56:31 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Mon, 26 May 2014 05:31:03 GMT]]></title><description><![CDATA[<p>Namenloser324 schrieb:</p>
<blockquote>
<p>volkard schrieb:</p>
<blockquote>
<p>Namenloser324 schrieb:</p>
<blockquote>
<p>Namenloser324 schrieb:</p>
<blockquote>
<p>Ich mach es zwar mittlerweile auch ohne extra void in der Klammer, da ich möglichst reduzierten (auch optisch) Code bevorzuge (sonst krieg ich Krämpfe im Kopf), finde die Konsistenz aber an sich ganz schnicke.</p>
</blockquote>
<p>Addendum:<br />
Im Endeffekt aber wieder völlig nichtiges Thema, hauptsache man macht es konsistent.</p>
</blockquote>
<p>nein. sowas nichtiges sollte man schon so machen wie alle anderen.</p>
</blockquote>
<p>Hauptsache man macht es konsistent steht da. D.h. arbeitet man in einem Projekt einigt man sich entweder auf eine Variante oder folgt halt der Masse falls du mit deiner Implikation, dass es alle so machen würden, recht hast.<br />
Arbeitet man alleine macht man es halt wie man möchte nur eben konsistent.</p>
</blockquote>
<p>nein. sowas nichtiges sollte man schon so machen wie alle anderen.</p>
<p>Namenloser324 schrieb:</p>
<blockquote>
<p>Seitenweise (Achtung: Übertreibung) drüber zu diskutieren ist halt massive Zeitverschwendung.</p>
</blockquote>
<p>Kein Vergleich zur Zeitverschwendung, die dadurch entsteht, daß man sich hier einen unüblichen Stil angewöhnt und jedes Stück Code, was man posten will, vorher bereinigen muss, damit das obligatorische &quot;(void) ist in C++ nicht mehr nötig&quot; nicht kommt. Oder gegen den Effizienzverlust, wenn der unwissende Chef (void) in den Styleguide reinschreibt, und jeder Mitarbeiter tagelang drüber stolpert. Vom künstlich erzeugten Mißmut ganz abzusehen. Außerdem nehme ich die Fragen von (void)-Programmierern nicht so ernst, und das wird sicherlich noch vielen anderen so gehen. Eben weil dieser Punkt nicht andeutungsweise strittig wäre, sondern alle () schreiben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400844</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400844</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Mon, 26 May 2014 05:31:03 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Mon, 26 May 2014 06:59:25 GMT]]></title><description><![CDATA[<p>würde ich alles so machen wie alle anderen, bekäme ich auch nur die Codequalität, die alle anderen haben. Überlegungen zur Optimierung der Codelokalität führen mich zwangsläufig zu (void).</p>
<p>mit dem Argument, es käme von C, müßte ich ja auch auf struct verzichten, weil es in C++ die Alternative class mit public gibt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400849</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400849</guid><dc:creator><![CDATA[großbuchstaben]]></dc:creator><pubDate>Mon, 26 May 2014 06:59:25 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Mon, 26 May 2014 07:09:40 GMT]]></title><description><![CDATA[<p>großbuchstaben schrieb:</p>
<blockquote>
<p>mit dem Argument, es käme von C</p>
</blockquote>
<p>Das ist nicht das Argument. Es ist in C genauso unnatürlich wie in C++, aber als Kompromiss wegen der K&amp;R-Kompatibilität nicht zu vermeiden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400850</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400850</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Mon, 26 May 2014 07:09:40 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Mon, 26 May 2014 10:23:08 GMT]]></title><description><![CDATA[<p>Ne, in C ist es sinnvoll.</p>
<pre><code>//C
void f();
f(42); //kompiliert
void f(void);
f(42); //error: f nimmt 0 parameter

//C++
void f();
f(42); //Error: f nimmt 0 parameter
</code></pre>
<p>void <strong>muss</strong> man in C für eine Funktion ohne Parameter angeben. In C++ ist es sinnloses Rauschen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400893</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400893</guid><dc:creator><![CDATA[nwp3]]></dc:creator><pubDate>Mon, 26 May 2014 10:23:08 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Mon, 26 May 2014 10:30:23 GMT]]></title><description><![CDATA[<p>nwp3 schrieb:</p>
<blockquote>
<p>Ne, in C ist es sinnvoll.</p>
</blockquote>
<p>Ich meinte das vom Sprachdesign her. Dass es das gibt, und dass es in C benutzt werden sollte ist unstrittig.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400896</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400896</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Mon, 26 May 2014 10:30:23 GMT</pubDate></item><item><title><![CDATA[Reply to Sauberer Code on Mon, 26 May 2014 11:37:36 GMT]]></title><description><![CDATA[<p>es ist kein sinnloses Rauschen. (void) ermöglicht, Deklarationen von Funktionsaufrufen zu unterscheiden, ohne Kontext zu sehen.</p>
<p>Code auf das Mininimum zu reduzieren, indem man jegliche Redundanz vermeidet, wäre eine Strategie, um etwa eine Platzierung beim Ioccc zu gewinnen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2400914</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2400914</guid><dc:creator><![CDATA[großbuchstaben]]></dc:creator><pubDate>Mon, 26 May 2014 11:37:36 GMT</pubDate></item></channel></rss>