custard
❔ Running a small part of a forms project?
I'm writing a windows forms app. Within in I have a small piece of logic that I will use but which doesnt actually display anything or interact with the rest of the project. Like a utility function.
I want to try it out and see if it works how I want. But I don't want to use it in Program.cs (which already has lots going on) and build the entire project. If I were using Python or Javascript, I would import just the module I need in a REPL and play with it. How do I do something like this in C# without creating a whole new project for the code I want to see running?
12 replies
❔ More details on the equivelent of modules in c#?
In Python and Javascipt, I can have modules and packages and must import them to access stuff within them.
It seems the C# equivalent is namespaces. I think I get the basic idea.
It seems that if I don't place something within a namespace, it is accessible everywhere within the project. Meanwhile, placing stuff within a namespace means the namespace itself is accessible everywhere. Is that all there is to the 'accessibility' of top-level names across files? If not, where can I find details? (I don't really know the specific terms to use, hope that was comprehensible)
17 replies