|
|
|
|
|
by Genbox
496 days ago
|
|
C# started as a language tightly aligned with C++/Java, but has since moved to be something else entirely that is highly capable. 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#. |
|
Regarding imports, I guess I could do something like `using c = my.namespace.ClassWithMyStaticMethods`, but I suppose it's not idiomatic in C#.