From 59e6aeb6a43970c1a9ba743ee1e72e852d0a9868 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Tue, 3 Jun 2025 20:39:28 +0700 Subject: 2024/bad_coding_practices: add section on "Using advice" In certain programming language there is a syntactic metadata that allow programmer to inject, bind, or change the behaviour of code based on the metadata being injected. This metaprogramming style known as Advice. In Java, this known as annotation. In Python, this known as decorator. --- .../journal/2024/bad_coding_practices/index.adoc | 78 +++++++++++++++++++++- 1 file changed, 75 insertions(+), 3 deletions(-) diff --git a/_content/journal/2024/bad_coding_practices/index.adoc b/_content/journal/2024/bad_coding_practices/index.adoc index ae431fa..989994a 100644 --- a/_content/journal/2024/bad_coding_practices/index.adoc +++ b/_content/journal/2024/bad_coding_practices/index.adoc @@ -24,6 +24,7 @@ The term "coding" in this context does not only means "a line of code" or "programming language", more on "software engineering" in general. +//{{{ [#storing_time_not_in_utc] == Storing time not in UTC @@ -49,6 +50,8 @@ records. The rule of thumb is store time in UTC and display time in local time zones. +//}}} +//{{{ [#logic_in_the_client] == Logic in the client @@ -103,6 +106,8 @@ END ---- +//}}} +//{{{ [#bad_mvc] == Grouping same class file into one directory @@ -166,6 +171,8 @@ For example, we can say that feature-C exist only when feature-B is enabled or depends on feature-B to be functional. +//}}} +//{{{ [#one_component_many_functions] == One component many functions @@ -197,6 +204,8 @@ In the form, we can still have `if-else` to disable or hide some fields or information, but at least this only happened in the view. +//}}} +//{{{ [#logic_in_view] == Logic in view @@ -221,6 +230,8 @@ and reference that in view as variable only.