Greg Poirier
03/08/2024, 2:07 PMKlitos Kyriacou
03/08/2024, 2:20 PMGreg Poirier
03/08/2024, 2:26 PMGreg Poirier
03/08/2024, 2:27 PMGreg Poirier
03/08/2024, 2:27 PMChris Lee
03/08/2024, 2:40 PMCollection<Pair<String, String>>
well before that for a bunch of reasons.Ruckus
03/08/2024, 4:05 PMCLOVIS
03/08/2024, 4:22 PMYoussef Shoaib [MOD]
03/08/2024, 4:22 PMCollection<Pair<String, String>>
is definitely a code smell unless it shows up somewhere in an intermediate calculation. Instead, use types liberally. Create data classes, value classes, interfaces, etc to model your domain correctly, and then use extension functions to model things that aren't core to those types but might be useful utilities for themCLOVIS
03/08/2024, 4:25 PMString.toDatabase(): Database
. This makes no sense, because you cannot convert a string into a database. What the code did was create:
• create a database connection
• assume the string is a connection URL
• use it as settings
To me, this is way too many assumptions.
However, String.asEmail()
makes sense, because any string could indeed be an email.Youssef Shoaib [MOD]
03/08/2024, 4:28 PMString.toDatabase
, while obviously bad, can instead be broken down to String.toUrl().toDatabaseConnectionSettings().connect(): Database
or something along those lines, where the intermediate types help model the steps that happen and thus allow you to configure things more granularly.CLOVIS
03/08/2024, 4:29 PMGreg Poirier
03/10/2024, 4:13 PM