Docs: StyleGuide.md as single source of truth for coding style - #101
Conversation
Introduce a compact DEC style guide consolidating CONTRIBUTING rules, DEC65.pdf section 3.7.1 structure notes, de-facto library conventions, and adapted Delphi Style Guide practices. Point CONTRIBUTING and readme at the guide; enforce for new/rewritten code only, without reformatting existing sources.
af6cff9 to
f10a90b
Compare
|
I'm currently reading the styleguide, as far as I am it's mostly good. Eight things:
if IsReady then Is not too clever. In this example I wouldn't wrap Process(AValue); in begin / end, as this is simply unnecessary.
|
|
Hallo Markus, danke fürs sorgfältige Lesen. Kurz zu allen acht Punkten — alles StyleGuide für neuen Code, kein Massen-Rewrite der bestehenden Units.
Wenn das für dich passt, arbeite ich das im StyleGuide nach. Viele Grüße |
Clarify donor/PR code, keep begin/end for single statements, point defines at DECOptions.inc, ban with, recommend T for type aliases, avoid public class fields, use s for string constants, and require XML <param> for every public API parameter. Co-authored-by: Olaf Monien <omonien@users.noreply.github.com>
|
Ja bitte nacharbeiten. Geht in die richtige Richtung. Vielleicht so was in Kapitel 5.2 Variables and parameters: Asserts |
|
Hallo Markus, die acht Punkte sind im StyleGuide schon nachgezogen ( Zu den Asserts: Die Richtung „nicht-optionale Objekt-/Pointer-Parameter prüfen“ teile ich. Von Grund: Wenn das für dich passt, nehme ich die Regel so in §5.2 auf. Viele Grüße |
Non-optional object, pointer, and interface parameters must be checked at routine start with a Release-safe Assigned raise, not Assert. Value parameters and TBytes are out of scope; new code only. Co-authored-by: Olaf Monien <omonien@users.noreply.github.com>
|
Ok!
Olaf Monien ***@***.***> schrieb am Mi., 9. Sept. 2026, 14:10:
… *omonien* left a comment (MHumm/DelphiEncryptionCompendium#101)
<#101 (comment)>
Hallo Markus,
die acht Punkte sind im StyleGuide schon nachgezogen (8f9049f auf diesem
PR).
Zu den Asserts: Die Richtung „nicht-optionale Objekt-/Pointer-Parameter
prüfen“ teile ich. Von Assert(Assigned(...)) würde ich aber dringend
abraten zugunsten einer *harten* Prüfung mit EArgumentNilException (oder
der DEC-üblichen EDEC*-Variante, falls wir die schon so nutzen).
Grund: Assert fällt im Release typischerweise weg ({$C-} / Assertions
aus). Die if not Assigned then raise-Variante kostet zwar auch im Release
eine Abfrage, aber in einer Crypto-Bibliothek zählen Robustheit und das
Vermeiden von Nil-Pfaden/Exploits mehr als diese Mikro-Optimierung. Bei
normalen Wertparametern bleibe ich bei deiner Linie: nicht hart fordern.
Wenn das für dich passt, nehme ich die Regel so in §5.2 auf.
Viele Grüße
Olaf
—
Reply to this email directly, view it on GitHub
<#101?email_source=notifications&email_token=AHCTXHKJSGRX2HL4WQBIFG35OFCEBA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNRQGE3DAMBZGMYKM4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-5601600930>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHCTXHPUXU6YNFQYECZZOCT5OFCEBAVCNFSNUABEKJSXA33TNF2G64TZHMZTENJVGIZDMNJ3JFZXG5LFHM2DSNJYGQ4DENZZGSQXMAQ>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AHCTXHKGXDGH6EPARG3EPRL5OFCEBA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNRQGE3DAMBZGMYKM4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/AHCTXHOAUM4UUZGPRD7FK535OFCEBA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNRQGE3DAMBZGMYKM4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you commented.Message ID:
***@***.***>
|
|
Hallo Markus, super, danke fürs OK. Dann ist alles wie besprochen auf diesem PR nachgezogen:
Damit ist #101 aus meiner Sicht fertig zum Mergen. Viele Grüße |
Summary
Docs/StyleGuide.mdas the single source of truth for DEC coding style, structure, and contribution expectations for new / rewritten code.CONTRIBUTING.md,DEC65.pdf§3.7.1 (structure & style), de-facto library conventions (DEC…units, Apache headers, FPC/Delphiuses), and adapted practices from the modern Delphi Style Guide (naming prefixes, formatting, XML docs).CONTRIBUTING.mdinto a short process entry point that points at the style guide.readme.mdso contributors find the style guide next to the other project docs.Policy (explicit)
Docs/StyleGuide.md.DEC65.pdf§3.7.2+) stays in the PDF; when the PDF is next regenerated, §3.7.1 can shrink to a pointer atDocs/StyleGuide.md.Test plan
Docs/StyleGuide.mdfor DEC fit (FPC, unit naming, headers).CONTRIBUTING.mdandreadme.mdlinks resolve..pas/ build changes — nothing to compile.