kinda unsure when a top-level function / class / o...
# announcements
a
kinda unsure when a top-level function / class / object is most appropriate for doing things like ProjectEuler. Ideas? https://github.com/andrewgazelka/ProjectEuler/issues/2
btw ProjectEuler is similar to LeetCode
p
I would go with top level functions and move them to
problemXX
package
a
hmm wouldn't this tend to get cluttered iyo if I have 50
solve()
functions but in different packages?
also, unfortunately there is no package scope in Kotlin so RIP 😕
p
yes, but you’d be importing the functions from a package
My general position is that classes and objects are for when you actually want to mix data and functions that operate on that data
since you don’t do that, you should be using top level functions
kinda clumped some stuff in the commit which shouldn't be there btw
just look at
Problem1*
p
👍
since you have a functional approach to solve the problem, having a functional structure makes sense