Autor |
Beitrag |
Marco D.
      
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: Fr 21.07.06 22:18
Könnte man nicht an einer zentralen Stelle einen unverbindlichen Styleguide anlegen?
Meine eigentliche Frage allerdings: Wann schreibt man vor den Parameternamen ein A (z.B. AColor: TCOlor) und wann nicht (filename: string)?
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
Born-to-Frag
      
Beiträge: 1094
Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
|
Verfasst: Fr 21.07.06 22:31
Also ich mache es bei meinen Prozeduren dann, wenn ich z.B. den Parameter Color habe und mit einem RichEdit arbeite und dann with MyRichEdt do ... mache.. sonst ist es denke ich egal..
_________________ Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
|
|
Marco D. 
      
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: Fr 21.07.06 22:34
Born-to-Frag hat folgendes geschrieben: | Also ich mache es bei meinen Prozeduren dann, wenn ich z.B. den Parameter Color habe und mit einem RichEdit arbeite und dann with MyRichEdt do ... mache.. sonst ist es denke ich egal.. |
Hab das jetzt mehrmal gelesen und kann das jetzt nicht auf die Frage beziehen. Was hat 'with MyRichEdit do' mit AColor oder nur Color zu tun? 
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
Born-to-Frag
      
Beiträge: 1094
Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
|
Verfasst: Fr 21.07.06 22:38
Delphi-Quelltext 1: 2: 3: 4: 5:
| with RichEdit do begin SelAttributes.Color := Color ... end; |

_________________ Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
Zuletzt bearbeitet von Born-to-Frag am Fr 21.07.06 22:39, insgesamt 1-mal bearbeitet
|
|
Marco D. 
      
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: Fr 21.07.06 22:39
Hm nee, ich glaube wir reden aneinander vorbei 
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
Born-to-Frag
      
Beiträge: 1094
Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
|
Verfasst: Fr 21.07.06 22:40
Ein RichEdit hat auch die Eigenschaft .Color.. welches Color mein ich denn jetzt? Parameter oder RichEdit.Color?
Also lieber SelAttributes.Color := AColor; 
_________________ Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
|
|
GTA-Place
      

Beiträge: 5248
Erhaltene Danke: 2
WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
|
Verfasst: Fr 21.07.06 22:41
Wenn ich kennzeichnen will, was die Variable für ein Typ ist, wird sie wie der Typ + ein 'a' an den Anfang gennant.
Delphi-Quelltext 1: 2:
| aString: String; aInteger: Integer; |
_________________ "Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
|
|
Marco D. 
      
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: Fr 21.07.06 22:42
 Achso!
Jetzt versteh ichs
@GTA: Genau das wollte ich wissen 
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
JayEff
      
Beiträge: 2971
Windows Vista Ultimate
D7 Enterprise
|
Verfasst: Fr 21.07.06 22:43
Genau. AColor hab ich immer englisch aufgefasst: a im sinne von "ein/eine". Also wenn ich schreibe aRichEdit:TRichEdit dann meine ich damit: Hier haben wir ein RichEdit (=this is aRichEdit).
Ähm - Das ist sicher nicht die korrekte Interpretation, aber ich glaub man darfs ruhig so benutzen ^^
Ich verstehe allerdings was du mit dem Styleguide meinst und wäre auch daran interessiert...
Meinst du damit Codeformatting insgesammt oder nur Variablennamen und sowas? Ich würde gern leuten einen Link zu diesem Topic geben können, wenn sie wieder kommen mit
Delphi-Quelltext 1: 2: 3:
| var a,b,c,d,x,y,z,v,h,i,h5,n1,ohrenschmalz:Integer; var geschwindigkeits_korrelations_konstanten_verschiebung_horizontale_achse:Single; |
_________________ >+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
|
|
Marco D. 
      
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: Fr 21.07.06 22:47
JayEff hat folgendes geschrieben: |
Ich verstehe allerdings was du mit dem Styleguide meinst und wäre auch daran interessiert...
Meinst du damit Codeformatting insgesammt oder nur Variablennamen und sowas? |
Beides.
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
JayEff
      
Beiträge: 2971
Windows Vista Ultimate
D7 Enterprise
|
Verfasst: Fr 21.07.06 22:53
Nun, das Formatieren des Codes überlasse ich (fauler Informatiker) dem SourceFormatter(DelForExp). Strg+D, Enter, und schon wird aus
Delphi-Quelltext 1: 2: 3: 4:
| var hallo:String;x,i:integer;s:TStringList; begin x:=1;i:=2;hallo:='blubb';s:=TStringList.Create;if x=v then s.add('sad'+hallo) else s.add('fuubar'); end; | das:
Delphi-Quelltext 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
| Var hallo: String; x, i: integer; s: TStringList; Begin x := 1; i := 2; hallo := 'blubb'; s := TStringList.Create; If x = v Then s.add('sad' + hallo) Else s.add('fuubar'); End; |
Schön, gell?  Man kann das Formatieren übrigens frei nach Schnautze einstellen, aber so wies hier is find ichs besonders schön 
_________________ >+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
|
|
Marco D. 
      
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: Fr 21.07.06 22:55
Du erinnerst mich glücklicherweise dran, dass ich das Tool gestern geladen habe. Gleich mal installieren. 
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
Coder
      
Beiträge: 1383
Erhaltene Danke: 1
WinXP
D2005 PE
|
Verfasst: Fr 21.07.06 23:14
Hier gibts den offiziellen Delphi Styleguide auf Deutsch:
www.dsdt.info/grundlagen/styleguide/
|
|
Born-to-Frag
      
Beiträge: 1094
Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
|
Verfasst: Fr 21.07.06 23:22
DelForExp ist ja echt nich schlecht, werd das Tool jetzt auch mal ausprobieren!
Danke
EDIT: Wow! Den werd ich jetzt immer benutzen, das is ja total geil das Ding 
_________________ Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
|
|
GTA-Place
      

Beiträge: 5248
Erhaltene Danke: 2
WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
|
Verfasst: Sa 22.07.06 08:20
JayEff hat folgendes geschrieben: | AColor hab ich immer englisch aufgefasst: a im sinne von "ein/eine". Also wenn ich schreibe aRichEdit:TRichEdit dann meine ich damit: Hier haben wir ein RichEdit (=this is aRichEdit). |
dito.
_________________ "Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
|
|
Marco D. 
      
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: Sa 22.07.06 13:14
Ich krieg immer die Meldung:
---------------------------
LinkedListDemo - Borland Delphi 2005 - LinkedList
---------------------------
Censored.pas: File or buffer is read only, or not yet saved
---------------------------
OK
---------------------------
wenn ich DelForExp benutzen will. Gespeichert ist sie auf jeden Fall.
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
JayEff
      
Beiträge: 2971
Windows Vista Ultimate
D7 Enterprise
|
Verfasst: Sa 22.07.06 15:03
_________________ >+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
|
|
Marco D. 
      
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: Sa 22.07.06 15:05
Ich kann das hundert mal speichern und es geht nicht.
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
Born-to-Frag
      
Beiträge: 1094
Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
|
Verfasst: Sa 22.07.06 23:55
Das ist, wenn du ein neues Project machst und das Project noch nirgens gespeichert hast 
_________________ Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
|
|
JayEff
      
Beiträge: 2971
Windows Vista Ultimate
D7 Enterprise
|
Verfasst: So 23.07.06 12:59
_________________ >+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
|
|