Skip to main content
12 events
when toggle format what by license comment
Jan 9, 2024 at 19:13 answer added J_H timeline score: 3
Jan 9, 2024 at 11:37 answer added gnasher729 timeline score: 1
Jan 9, 2024 at 8:04 comment added amon I like option 1 because it clearly relates the code to business-level requirements. The other options just try to compress the code into fewer statements/lines as if that were somehow better. I've written some thoughts on misapplied cleverness. I am not opposed to using fancy language features if they provide a useful abstraction, but good abstractions hide complexity and make the higher-level code more expressive. All examples in this question are on the same level of abstraction.
Jan 9, 2024 at 6:25 comment added Luc Franken In addition to the given answers: The function has unclear external dependencies which already makes it not really clear. For example: if (_progressStore.level < 5) return null; could be something like: if(hasUserReachedProgressLevelForRewards()) return null; so the amount of responsibilities of this function goes down. (Single responsibility is a term to look up). All 3 pre-checks could then be grouped in a function: isUserElegibleForLoginReward(). Also the name of the function checkLoginDay is unclear: What does it check? Add that to the name.
Jan 8, 2024 at 20:12 answer added J_H timeline score: 7
Jan 8, 2024 at 20:07 answer added Steve timeline score: 3
Jan 8, 2024 at 19:51 review Close votes
Jan 20, 2024 at 3:03
Jan 8, 2024 at 19:43 history edited Sir Falk CC BY-SA 4.0
edited body
Jan 8, 2024 at 19:43 history edited Sir Falk CC BY-SA 4.0
deleted 20 characters in body; edited title
Jan 8, 2024 at 19:29 history edited Sir Falk
edited tags
S Jan 8, 2024 at 19:13 review First questions
Jan 8, 2024 at 20:16
S Jan 8, 2024 at 19:13 history asked Sir Falk CC BY-SA 4.0