Skip to main content

All Questions

Tagged with
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
3 votes
2 answers
306 views

For what reasons Java and C# initialize static data on demand?

I am reading "The Go Programming Language" right now and I have read package initialization chapter which tells (or I read it wrong) that Go uses eagerly initialization. So in time we saw say C++ ...
greenoldman's user avatar
  • 1,543
6 votes
3 answers
2k views

Why is the most common integer number 32 bits, but the most common floating point number 64 bits?

Coming from a Java and C# background, I've learned to use int (32 bits) whenever I need a whole number, and double (64 bits) when dealing with fractional values. Most methods from their respective ...
Arturo Torres Sánchez's user avatar
-2 votes
0 answers
287 views

Reasons to want false-negatives when comparing strings (or string references)? [duplicate]

Java programmers know that new String("some-text") == new String("some-text") evaluates to false because two different objects/references are being compared [and that String.equals should be used to ...
Anonsage's user avatar
  • 105
63 votes
6 answers
28k views

Why was C# made with "new" and "virtual+override" keywords unlike Java?

In Java there are no virtual, new, override keywords for method definition. So the working of a method is easy to understand. Cause if DerivedClass extends BaseClass and has a method with same name ...
Anirban Nag 'tintinmj''s user avatar
36 votes
3 answers
2k views

Does Java development typically involve more subclassing than C#/.NET?

I've recently started looking at Android development. This has brought me back into the world of Java software development. The last time I worked with Java, I'll admit, I didn't understand OOP nearly ...
MetaFight's user avatar
  • 11.6k
39 votes
9 answers
6k views

Why do C# and Java use reference equality as the default for '=='?

I've been pondering for a while why Java and C# (and I'm sure other languages) default to reference equality for ==. In the programming I do (which certainly is only a small subset of programming ...
Zipper's user avatar
  • 540
89 votes
11 answers
13k views

Did the developers of Java consciously abandon RAII?

As a long-time C# programmer, I have recently come to learn more about the advantages of Resource Acquisition Is Initialization (RAII). In particular, I have discovered that the C# idiom: using (var ...
JoelFan's user avatar
  • 7,121