5 ms·
I really disliked this the first time I saw it. I was like "WTF is this?" I can only think the reason why they did this was to compete with python, as our scri
by masfoobar 3y ago
I really disliked this the first time I saw it. I was like "WTF is this?"
I can only think the reason why they did this was to compete with python, as our scripting languages that do not require a main/Main entry point.
Personally, it just feels wrong for compiled-based languages.
I think they could improve on C# with their namespace. Rather, for example, a typical C# file looking like:-
using EFG;
namespace ABC
{
public class XYZ
{
}
}
They could just :-
using EFG;
using namespace ABC;
public class XYZ
{
}
Pretty much taken from the C++ way.. but it saves on space availability.
- sfn42 3y agoNamespace declarations have been a thing in C# for a while
- masfoobar 3y agoYep. Point is it should have been added since Framework 4.
- neonsunset 3y agoThe second option is what C# defaults to since a few versions ago.
- masfoobar 3y agoCorrect -- was added since .net 6, I believe.