Travis Griggs11/07/2023, 5:19 PM
CLOVIS11/07/2023, 5:21 PM
) • if there are not really anything else in the package, I just name them after what they do (e.g. in this package, there is a sealed class and everything else is just extension functions on it)
ephemient11/07/2023, 5:29 PM
for functions on `Float`s
Casey Brooks11/07/2023, 5:46 PM
, because not every function in that file is strictly an “extension function”, and I guess I’m just used to the Java naming convention
Travis Griggs11/07/2023, 8:36 PM
Stephan Schröder11/07/2023, 9:37 PM
Klitos Kyriacou11/08/2023, 11:46 AM
This doesn't explain what you should do if you are defining extension functions that are relevant to all clients but they are extensions of a third-party class so you can't put them in with that class. In that case, ephemient's use of the plural of the class name sounds sensible.
when defining extension functions for a class which are relevant for all clients of this class, put them in the same file with the class itself. When defining extension functions that make sense only for a specific client, put them next to the code of that client. Avoid creating files just to hold all extensions of some class.
Daniel Pitts11/15/2023, 4:01 PM
ephemient11/15/2023, 11:31 PM
to hold extensions for classes defined in