You are currently viewing What is the best practice for grouping related methods and variables?

What is the best practice for grouping related methods and variables?

im fairly new to kotlin and i want to what is the best practice for the following example. let’s say i have some math functionality that i want to group together so that i can access it like mathUtils.derivative (or something similar) for example. should i make a class called MathUtils with a companion object containing these methods or should i just put these functions in a file called mathUtils?

submitted by /u/Savings_Garlic5498
[link] [comments]