C#, did Microsoft just want to be different?

I have been using C# for the past week or 2, so far it has been a breeze but some things are really annoying me and it seems like it is due to Microsoft just wanting to be “different”.

First off, Dictionary. Who named this? Every other languages uses the name Map, as in your map a key to a value. Even other languages by MS use map, like F#.

The List, addRange(). Why addRange? This gives me the impression I am wanting to add elements within a range inside the list, what is wrong with addAll()?

There is a lot of other nitpicky stuff that just seems illogically named, Visual Studio likes to call a project a solution, is there not supposed to be a problem?

I’m pretty sure all those names are common conventions elsewhere, the universe didn’t begin with Java.

Dictionary is pretty common (although I do prefer Map for it’s mathematical connotation), one could argue that addRange is more accurate and clear as to what it means than addAll, given that the parameter is not (I don’t think) necessarily all of the elements of a collection.
I did think “Solution” was a bit gimmicky, but it still makes sense at least.

At my work there is a lib made by some guy who used to work there and List’s .size funcion is called .Usage() o-o

To be fair the Java standard libraries can’t agree on how to the length of a string, array, or collection. (.length(), .length, .size(), respectively)

Java 1.0 had a Dictionary class: https://docs.oracle.com/javase/7/docs/api/java/util/Dictionary.html

The Map interface didn’t come around until Java 1.2.

All I have to say about C# is that to me it’s Java and so much more. Of course there are upsides to Java, but I fell in LOVE with C# when I first learned it.

In many ways it’s inconsistent and rushed feeling. Definitely feels incomplete. I enjoyed extension methods, briefly. The different bracketing layout convention irritates me on sight but that’s just a case of what I’m used to.

It seems like it’s had the kitchen sink bolted on to it and every other kitchen appliance going to try and appease everyone with a personal issue with some aspect of the language and this hasn’t helped its readability or even its design as a language. The whole properties / events thing is like a DSL somehow finding its way into the core language and I have a small vendetta against properties anyway. Methods not being virtual by default is irritating.

What I have rather liked about C# is the ability to use value types (yay!) although it’s far less intuitive than you’d expect when they start mingling with reference types. Also I had a brief affair with extension methods though I am now slightly wary about their potential for unexpected meaning in code.

At the end of the day though… it’s just not really anywhere near as good as Java is. It’s just such a shame Java is so damned difficult to port to other platforms.

Cas :slight_smile:

Actually a project is not a soultion. A solution can hold multiple projects :wink:

Why nobody mentioned events and beautiful delegates? ???

Actually dictionary is more accurate. We don’t (generally) have 1 to N maps, we have 1-to-1 or N-to-1 maps, which are dictionaries. The only reason I like map is because it’s less characters to type.

For everything there is, there is a microsoft equivalent.
from Silverlight to Zune.

they even got into gaming with the original xbox no one really cared about. all of that because microsoft is… well I can find too many insults here

they want to be everywhere, and they like doing a lot of things bad, instead of one or a couple things good.

thats why all their products are rushed beyond believe, hurry and make money, dont care about the quality
sucky xbox 360 architecture leading to the RROD and all the windows problems from freezing, locking and BSODs are just the most famous examples

microsoft is quantity over quality basically

so yeah @topic, a lot of their crappy products have these distinction purely so they are different

“Solution” is not even a technical term, its a marketing term.
But seeing as they use “experience” up the ass with the xbox, it doesnt surprise.

Hm let’s be fair here: Windows is excellent (still the best desktop OS IMHO) and MSVC++ is likewise state-of-the-art when it comes to C++ development. And Office is also pretty much awesome. And SQL Server. And even IIS, and IE11. And DirectX is basically converging on OpenGL. They’ve got a history of awesome software.

…and of course they also have a history of “yeah and we can do that too! With blackjack! And hookers!” with things like .net and C# but for all of that I’m glad it exists because it’s brought next-generation programming ideas to a load of old farts (crazy stuff like JIT, garbage collection, and array bounds checks!) who thought that everything should be hewn from C++ using toothpicks and were frightened of Java because of Sun’s incredibly inept handling. The competition from C# has done Java a power of good.

Cas :slight_smile:

One major difference, is that it is possible to assign to [icode]this[/icode] in C# structures. An example that uses that feature is OpenTK’s Math structures, Matrix3 struct does this, for example.


public void Transpose()
{
    this = Matrix3.Transpose(this);
}

public static Matrix3 Transpose(Matrix3 mat)
{
    return new Matrix3(mat.Column0, mat.Column1, mat.Column2);
}

So simple, isn’t it? Yeah it confused me a lot at first, but it is possible (not in Java!!) only in structs.

IIRC, something similar was in C++ v1 ???

One of my most used util classes is my OneToManyMap :slight_smile:

Porting a Java map (that can return null) to a C# dictionary using TryGetValue() calls is a highly tedious activity. I don’t know enough about C#, but does it have a weak (non-existant keys allowed) dictionary variant?

I didn’t meant to start a language vs language thing here, I was genuinely curious to these naming conventions and why C# had to be different from other OOP languages despite sharing the exact same principles.

Soooo…you mean a workspace like every other IDE has? :stuck_out_tongue:

My original post seemed biased, apologies. I know it never began at Java lol. I was merely saying that when I had a look at Java, C++ and then I opened up VS and looked at my C# code, it seemed that things were different; for no reason other than “just because”.

Topic is not really about functionality, more about functions that exist in each language but named differently. But yes, delegates and events are sexy. I do like anonymous “interfaces” with Java though, frowned upon but good for firing in small and quick callback even type code.

Someone that feels the same as me, have a medal.

Re. C# is unnecessarily different: Maybe they felt they were improving things … maybe they did … maybe Java is not and has never been the perfect language…maybe the Java Executive Committee would be a tad conservative and slow-moving without Microsoft hustling them along…

From Wikipedia “…recent versions of Java (notably version 5.0) have in turn implemented ideas originally implemented in C#, such as the foreach construct, autoboxing, methods with variable number of parameters (varargs), enumerated types, and annotations”.

In general, I think competition is good, even if sometimes we wish “our side” would “win” forever and all the “enemies” would go away and die. Visual Studio vs Eclipse, Java vs C#, Microsoft vs IBM or whoever, Intel vs AMD, Windows vs *nix, ad infinitum. Standards consistently raised.

Re. VS, well obviously it’s such a tribal thing there’s no point arguing too hard but, I mean, a good, free IDE, what’s not to like :smiley:

Is any programming language really perfect? There is always something. IMHO Java is just a very accessible and easy to use language.

Not quite, VS has a workspace, it’s like an umbrella that encloses multiple projects, the purpose? IDK, but it’s there. I was originally pissed that Java had packages, you have a src folder why need another? Now I know better.

Things are this way in every language, they all have pros and cons. Microsoft probably looked at Java and thought, hey you know, this language is cool, but I bet we could do better and did their version. Is it better? meh…it’s hard to say.

The world is full of grey

Everything’s blue in this world.

Cas :slight_smile: