drogon icon indicating copy to clipboard operation
drogon copied to clipboard

remove unnecessary macros

Open smahapatra1 opened this issue 2 years ago • 2 comments

In TimeFilter.cc, there is code: #define VDate "visitDate"

Is there any reason for this? I understand it is only an example and is not really a bug, but when people read drogon code, they should see really good code all around to increase its popularity and usage.

smahapatra1 avatar Mar 31 '23 17:03 smahapatra1

Why it is unnecessary ? If we use "visitDate" everywhere in the code, it becomes an error-prone magic string.

hwc0919 avatar Apr 06 '23 09:04 hwc0919

@hwc0919 The macro can be static constexpr std::string_view VDate = "visitDate", then this is better. The macros can be detected by clang-tidy (cppcoreguidelines-macro-usage), so this is https://github.com/drogonframework/drogon/issues/1927 's task.

ken-matsui avatar Jan 31 '24 15:01 ken-matsui