.NET namespaces

前端 未结 9 2387
面向向阳花
面向向阳花 2020-12-31 18:38

My background is primarily as a Java Developer, but lately I have been doing some work in .NET. So I have been trying to do some simple projects at home to get better at wor

9条回答
  •  旧时难觅i
    2020-12-31 19:35

    Indeed, the .Net environment allows you to throw your code at the IDE/filesystem like spaghetti against a wall.

    That doesn't mean that mean this approach is sane, however. Its generally a good idea to stick with the project.foldername.Class approach that was mentioned earlier. Its also a really good idea to keep all of the classes from one namespace into the same class.

    In Java, you can do screwy things like this as well getting all of the "flexibility" that you want, but the tools tend to strongly discourage it. Honestly, one of the most confusing things for me in being introduced to the .Net world was just how sloppy/inconsistent this can be thanks to the relatively poor guidance. Its easy to organize things sanely with a little thought, though. :)

提交回复
热议问题