From 03d25fd37a3139442b036692884cfcb2df6a0dfa Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 6 May 2023 11:42:05 +0000 Subject: [PATCH] make id public, organigram impl. media password/encryption, settings bug fix, Money->FloatInt change, ... --- standards/general.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/standards/general.md b/standards/general.md index b60701f..391f679 100755 --- a/standards/general.md +++ b/standards/general.md @@ -24,11 +24,19 @@ Files must end with a new line element `\n`. ## Member variables -Member variables should be public unless there is absolutely no reason directly access them or additional data manipulation upon setting, changing or returning them is required. +Member variables should be public unless there is absolutely no reason to directly access them or additional data manipulation upon setting, changing or returning them is required. ### Getters/Setters -Getters and setters for member variables should be kept at a minimum and only used when they actually perform additional actions, such as additional type checks, data manipulation, ... +Getters and setters for member variables should be kept at a absolute minimum and only used when they actually perform additional actions. + +### Why are we using public so much? + +* Private/protected adds a huge amount of unneccessary typing without gaining much/anything +* Getters/setters may hide unsuspecting side effects +* Adding additional functionality afterwards if it becomes necessary is easy by changing the member to private and letting the static code inspection tools find the callers +* Performance overhead (function calls, data mappers) +* Private or protected doesn't add any security due to unserialization and reflections ## Indention