3 ms·
This was the whole basis of C#'s grandaddy C++, was it not? Thinking "What if structs didn't just have data, but methods?" The Class was born, but it is basical
by feintruled 7y ago
This was the whole basis of C#'s grandaddy C++, was it not? Thinking "What if structs didn't just have data, but methods?"
The Class was born, but it is basically still a superset of 'struct'. I guess the wrinkle here is that is specifically a main() but the article payoff singularly fails to deliver. "This compiles" is rather unenlightening.
- nmeofthestate 7y agoStruct in C# means type has "by value semantics", whereas class in c# means "reference type", so the keywords have a quite different usage compared to C++, where it's about whether public/private is default. Still a frivolous and "so what" blog post though.