Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.java > #13391
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | ram@zedat.fu-berlin.de (Stefan Ram) |
| Newsgroups | de.comp.lang.java |
| Subject | Re: guter Stil void oder boolean |
| Date | 11 Jul 2022 11:43:02 GMT |
| Organization | Stefan Ram |
| Lines | 35 |
| Expires | 1 Apr 2023 11:59:58 GMT |
| Message-ID | <Design-20220711123647@ram.dialup.fu-berlin.de> (permalink) |
| References | <1a3b5a2f-84da-4710-978b-c953f1262955n@googlegroups.com> <tagvmk$b8e$1@newsreader4.netcologne.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 8bit |
| X-Trace | news.uni-berlin.de CzfxG5Q2jad831vqQqTuwAlT47smte6/IC65sJLm0W1tnf |
| X-Copyright | (C) Copyright 2022 Stefan Ram. All rights reserved. Distribution through any means other than regular usenet channels is forbidden. It is forbidden to publish this article in the Web, to change URIs of this article into links, and to transfer the body without this notice, but quotations of parts in other Usenet posts are allowed. |
| X-No-Archive | Yes |
| Archive | no |
| X-No-Archive-Readme | "X-No-Archive" is set, because this prevents some services to mirror the article in the web. But the article may be kept on a Usenet archive server with only NNTP access. |
| X-No-Html | yes |
| Content-Language | de-DE |
| Accept-Language | de-DE, en-US, it, fr-FR |
| Xref | csiph.com de.comp.lang.java:13391 |
Show key headers only | View raw
Patrick Roemer <sangamon@netcologne.de> writes:
>Wenn Du nicht sicher bist, ob und was die Methode zurückgibt, kannst Du
>sie noch nicht schreiben. :)
Wenn das ironisch gemeint sein sollte (wegen des Smileys),
frage ich mich, was dann Deine wirkliche Meinung dazu ist.
Jedenfalls gibt es Ansätze, wie "Code As Design" (Jack Reeves, 2005),
die für den Entwurf Code vorsehen. Vergleiche auch "stepwise
refinement" wie in Elan.
Beim Entwurf kann es die mentale Belastung reduzieren, wenn
man nicht gleich alle Details hinschreiben muß.
In Python kann ich schreiben:
# a stub
def ask_operator():
pass
. Manche sagen ja, Python sei wie Pseudo-Code. Ich frage
mich, was die Übersetzung davon nach Java wäre!
(Erklärung: erste Zeile = Kommentar; zweite Zeile definiert
eine Funktion unter Angabe ihres Namens aber ohne explizite
Angabe eines Rückgabetyps; dritte Zeile sagt, daß der Rumpf
absichtlich leer gelassen wurde.)
PS: Eine "saubere" Lösung wäre an sich die Definition eines
speziellen Typs als Rückgabetyp für Funktionen deren
Rückgabespezifiktion noch offen ist, aber ich finde, solch
ein Typ, wie "ToBeSpecified", würde beim Entwurf schon
wieder zu sehr ablenken.
Back to de.comp.lang.java | Previous | Next | Find similar
csiph-web