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.
[ Parent
| on HN ]
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.