News for hackers. Stuff that matters.
Re:The use of `class` for things that should be simple free ... by sebsito on Thursday May 28, 2020 @04:01AM (#23334709)
Depending on the language it could be tricky. For example in Ruby everything literally is an object. There are no standalone functions. Not having a class simply makes it hard to use. I can't autoload methods. I could group them in a module but that's not the point. So while coding in Ruby I'm planning to stay with small classes. I treat class as a smallest testable entity in Ruby.

On the contrary, in Python, a function is a first class citizen which can be selectively imported and easily tested.

Re:The use of `class` for things that should be simple free ... by jordinl on Thursday May 28, 2020 @04:05AM (#23334739)
> For example in Ruby everything literally is an object. There are no standalone functions. Not having a class simply makes it hard to use

Nothing prevents you from writing one function in a file, requiring that file and calling that function. Not sure what's so hard about it.

Re:The use of `class` for things that should be simple free ... by ClikeX on Thursday May 28, 2020 @04:52AM (#23334998)
If you write Ruby from scratch, sure. If you work in Rails you have to work around everything being autoloaded on boot.

Best bet is to just build modules to namespace your functions.