(no title)
Genbox | 1 year ago
I assume that free-floating functions are global functions. You can achieve something similar by "global using". Put this in a file and tug it away somewhere:
"global using static YourStaticClass;"
Now you can call all the static methods on the class everywhere.
As for the using vs. naming convention, most people use the IDE and hover the mouse over the type to see its identity. Once you get proficient with the IDE, you can do it using shortcuts. However, if you really want to prefix all types with a shorthand of the package it came from, you can do it with aliases in C#.
ngrilly|1 year ago
Regarding imports, I guess I could do something like `using c = my.namespace.ClassWithMyStaticMethods`, but I suppose it's not idiomatic in C#.
metaltyphoon|1 year ago
Non idiomatic? IMO, this is completely fine. Idiomatic C# doesn't mean OO all the time.
dmoney_2|1 year ago
lordofgibbons|1 year ago
In most languages they're bound to some scope, like package, module, etc. I'm not familiar with C#, but I assume there it would be scoped in a namespace.
ngrilly|1 year ago
coder543|1 year ago
ngrilly|1 year ago