Re:Node Modules at War: Why CommonJS and ES Modules Can’t Ge...
by greggman3 on Saturday August 08, 2020 @03:08AM
(#24089696)
in one file declare
In another file declare
Now use both foo.Bar from file 1 and foo.Bar from file 2 in the same project. Aliases don't help with this
[ Parent
| on HN ]
Re:Node Modules at War: Why CommonJS and ES Modules Can’t Ge...
by manigandham on Saturday August 08, 2020 @03:54AM
(#24089874)
Different assemblies with the same assembly name, namespace and class? Use an extern alias (which is how different versions of the same assembly can be used if necessary): https://docs.microsoft.com/en-us/dotnet/csharp/language-refe...
Different assemblies with different assembly names but same namespace and class? Just use the fully qualified type name (and alias it for a shorter name).
Single assembly/project and namespace with the same class in multiple files? If you're just spreading out the code then use partial classes, otherwise why would you define the same type twice?
C# (and other languages) that use virtual namespaces can do everything that file-based namespaces can do, but also support many more scenarios.