Re:The use of `class` for things that should be simple free ...
by mcv on Thursday May 28, 2020 @10:37AM
(#23337807)
Maybe the problem here is the global namespace. I really like modern javascript where you have to explicitly import everything.
Re:The use of `class` for things that should be simple free ...
by aarong11 on Thursday May 28, 2020 @04:37AM
(#23334917)
Maybe not so much of a problem in C++ but look at JavaScript. With the millions of dependencies / libraries you import, if they all used free standing functions you would inevitably end up with collisions.
Re:The use of `class` for things that should be simple free ...
by wruza on Thursday May 28, 2020 @04:58AM
(#23335029)
In c++ functions can be marked ‘static’ to make them translation-unit local, or you can put them in a library namespace, if they’re public. In a particular js bundler/runtime usually a module system is used (or just iife/umd wrap) which prevents function names from populating globals.
Re:The use of `class` for things that should be simple free ...
by entha_saava on Thursday May 28, 2020 @06:38AM
(#23335743)
The problem is unqualified imports though, not free functions.
I get it, I also experience some reticience when adding free/bare functions in Swift. But maybe it's because of 15 years of OOP programming.