Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> ridiculous breaking change

Not at all. This can be done without breaking code. The important part isn't typing the namespace - rather, the freedom to move files around without having to change namespaces.

Even if it were something like:

  auto namespace; // for example
it's good enough. Allows me to move directories around, without having to depend on an IDE to keep namespaces in sync. IDEs anyway can only take a good guess at this, if namespace doesn't match the dir name.

> just look at https://devblogs.microsoft.com/dotnet/announcing-dotnet-run-...

I am not looking for a scripting solution. C# is a misfit for it. I want all of C#, with terseness and not forcing OOP.



> Allows me to move directories around, without having to depend on an IDE to keep namespaces in sync.

So... without and IDE, you'd move code around, let the NS be changed due to being placed in a different directory structure, and then fix namespaces on use-sites manually?

> I want all of C#, with terseness and not forcing OOP.

C# does not force OOP on you. You can have a single namespace, single static partial class and spread its members across as many files as you want. So the "ceremony" consists of the following snippet _per file_

    namespace NS;
    static partial class C {
        // Your methods here
    }


How would the caller reference that auto-namespaced class?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: