Skip to main content

All Questions

Tagged with
-2 votes
1 answer
2k views

C# is fantastic, if only List 'd respect Remove&Return [closed]

In the domain of system-modeling (e, systemVerilog, matlab, phyton), lists are obsoleting arrays, stacks and queues(*) altogether. Other domains that use python, perl and ruby have that same mindset, ...
jsonphy's user avatar
  • 57
-3 votes
4 answers
2k views

C# Why should i limit myself to List or Stack ? ( instead of having both)

List is implemented in C# exactly as Stack, see: https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.stack-1.push?view=netframework-4.8#remarks https://docs.microsoft.com/en-us/...
jsonphy's user avatar
  • 57
4 votes
4 answers
2k views

Why doesn't C++ support covariance in STL containers like C# or Java?

The Covariance and Contravariance feature is well supported in C# and Java collections. However C++ doesn't support them in their STL containers. Why is it so? For example the below code will ...
Sisir's user avatar
  • 878
22 votes
7 answers
15k views

Should "Set" have a Get method?

Let's have this C# class (it would be almost the same in Java) public class MyClass { public string A {get; set;} public string B {get; set;} public override bool Equals(object obj) { ...
vojta's user avatar
  • 338