My 1st .NET / C# impressions

After having worked a bit with C# and .NET, these are my 1st impressions:

  • Awfully similar to java. Even the stacktrace looks exactly the same. They even have their own Java Web Start equivalent.
  • VS.Net is pretty good and has some nice wizards but is expensive. And if you want the C# editor to compete with Eclipse,
    you need a plug-in which is also not free (the standard C# programming environment is not nearly as good as Eclipse).
  • Using .dll’s with your own programs is pretty straightforward.
  • The .net framework as far as I can tell is not cross-platform for GUI applications. There’s no swing equivalent for
    example (you create forms using the proprietary MS libraries).
  • C# is nice, but even though it’s often considered to be like an ‘enhanced java’, I actually don’t think so. In java,
    almost everything seems well thought out and consequent, while my 1st impression of C# is that it seems a bit cluttered and
    can’t decide if it wants to please C++ developers or Java developers. In many cases, things that are possible in C# but not
    in java are things that I really don’t want.
  • The naming conventions just suck.

Note that I’m not a .net expert yet, so some of my views may not be justified…

Been working in .net over the summer on my internship…(both VB and C# but mostly C#…)

I agree with you on most everything… first 2 months I worked without the resharper plugin… and always complained to myself of how much better eclipse is than the VS ide… Now I’m using resharper on a trial period… and it makes things ALOT better… with resharper it’s almost as good as eclipse… I still think eclipse has an edge in a lot of areas… but VS ide is a lot faster and more responsive… (especially working on gui programs compared to VE plugin for eclipse)

As for the languages I like c# because of the fact it’s so similair to java… but for my own work I’d still choose java… but that might be just from the fact that I’ve been exposed to java alot more… so I definitely agree on the suckiness of the naming conventions. :-)… I just don’t like method names starting with a capital letter (obviously because of lack of exposure)… the one good thing in the convention though is the ‘I’ in front of interfaces… makes a lot of sense. (I always name my own interfaces ‘I_’ in java…)…

but I also admit alot of things could be better in java…

Oh, and I very much dislike the javadoc equivalent in c# (the autogenerated stuff)… it’s so cluttered… javadoc is so much cleaner and nicer.

Oh yes, the javadoc equivilent is awful. Reminds me of the equally aweful online VS6 docs.

In the shot time I used C# I kept thinking how similar it was to java and also how many things (naming convensions, javadoc etc) I think they changes “just to be different” to java.

Will.

The primary reason I have not delved deep into .net is precisely that - it’s just different enough to be annoying, just similar enough to have too many gotchas. I’ve spent years learning the deep, deep intricacies of Java. I’m probably a leading expert on many aspects of the way it works, having not specialised in crap like JSP and J2EE. Why throw away all that investment learning something that does essentially exactly the same thing?

Cas :slight_smile:

Just out of interest, why?

It smells a bit too much like Hungarian notation, which AFAICS, inflicts bleeding eyes on innocent programmers in return for the amazing benefit of making it easier for those same programmers, presumably having mopped the blood from their faces, to perform manual type checking on their code!

The final section (“I’m Hungary” and beyond) of this article tells the sad tale of how Hungarian Notation started out as a good idea that was misinterpreted to become useless, and then the misinterpretation spread far and wide and even standardised.

At any rate, what’s the benefit in having “I_” infront of Interface names? Any half-decent IDE will make it immediately obvious if the interface is misused.

If you’d google for my hovercraft is full of eels and C# you’d find a some resource about Java and C#.

If you have come this far with java stay with it. Java and c++ should complement themselves very well for games. And if you need something more high-level than java for AI there are prolog and rule-based systems that work well on top of the java vm and can take advantage of the benefits of the java platform.

My personal opinion, java as a programing language is nothing special. The so called father of Java already said in some interviews he regreted some of the decisions he had to take when building it and if you look at .NET without trying to nitpick it to dead it has a couple of details that make it stand a little above Java. But what’s the point ? Java is not only the language, its also the virtual machine, the apis and of course the support with tools like Eclipse.

bleb…

Well I guess I like that files are grouped together nicely in Navigator, isn’'t that a good reason… :slight_smile:

I don’t like the hungarian notation though… but “I_” in front just seems pretty clean to me, and my eyes…

hungarian doesn’t make much sense anymore since you rarely use global fields… and you readily see the type of things you want to access in getters in a good IDE.

alos when I need an interface I like to just have to type I + ctrl+space to get up a list of interfaces… not have to browse through another million classes…

(you probably figured out now that I prefer get/setters to properties in c#… I like the way you code properties in c#… but like that getters/setters are grouped together in lists in java…)

Fair enough, whatever works for you.

I wouldn’t be surprised if Eclispe will already restrict the auto-complete suggestions to interfaces if you trigger it after typing “implements”, but I haven’t tested.

Yeah Eclipse is already very clever like that.

The reason I stick “I” in front of some interfaces these days is so I can name a default concrete implementation after it without the I :wink:

Cas :slight_smile:

And what about I at the end?

but then you don’t get the nice sorting in popup lists and the navigator (and ordinary file browsers…)

It however prevents showing implementing files next to the interface…

Not to mention that standard parsers have switches to show only interfaces.

Hey, it “works for me”.

Cas :slight_smile:

[quote=“princec,post:15,topic:24733”]
+1 ;D

I personally don’t use I* to denote interfaces (my default implementations are usually called Abstract* or *Impl depending on whether or not they are concrete). However, I’ve seen many people use such a naming convention, and it definitely works for them!

Tolerance in coding conventions is something we should all aspire to - especially since the language is very permissive of personal coding style. People can use their own conventions and their code will still be easily usable by others - more power to them. Except, of course, for those utter bastards who put open-braces on the same line as their control statements - I mean really…

har har… that would be me ;D

It’s just such a waste with those blank lines… And with eclipse there is no problem with brace matching…

And after a long time of using it, I’ve come to the very objective conclusion that it looks much nicer too! :wink:

(This very meaningful post made me jr member… Hooray!!)

You mean like this?

if(something > somethingElse){doThings() ; }

Nothing that much wrong if the if statement is just one line. What is REALY bad is

if (a > i)
somethingugly()

of course it might be used with for as well.

He meant:


if(whatever) {
   task.perform();
}

I would have to say that the near-perfection of Eclipse’s code formatter should relegate these religious whitespace arguments to a thing of the past.
After ctrl-s, my most-used shortcut is esc,ctrl-f.