Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » C# - The Good and The Bad.

This thread is locked; no one can reply to it. rss feed Print
 1   2   3   4 
C# - The Good and The Bad.
monkeyCode
Member #7,140
April 2006

Been playing with C# these past few days and i have to say it's very nice for the most part, but came across something just now..

The Point object has overloaded operators for dealing with the Size object, but not with itself? WTF?

point1 -= point2; // Error
point1 -= size1; // implemented.. wtf?

Yeah, well senseless post.. just had to say WTF.. :P

Trezker
Member #1,739
December 2001
avatar

Well, I agree that seems strange. But I'm sure they have a good reason for it...

Can anyone think of a good reason?

James Stanley
Member #7,275
May 2006
avatar

Quote:

C# - The Bad.

Fixed. :P

monkeyCode
Member #7,140
April 2006

The same reason that they leave out event information even it it's in the event structure (i.e mouse move doesn't contain button press information, even though it's right there in the MouseEventArgs), And there doesn't seem to be any way to get a snapshot of the input events maybe?

nonnus29
Member #2,606
August 2002
avatar

MSDN sucks, I just went there looking for something similar to javadocs but all I found was a stupid Point/Size example (in 3 languages).

Lesson; when you play in the MS sandbox you only get what they want you to have...

:-/

BAF
Member #2,981
December 2002
avatar

Quote:

MSDN sucks, I just went there looking for something similar to javadocs but all I found was a stupid Point/Size example (in 3 languages).

Found in two seconds. As far as adding goes, I found that page in about 3 more seconds. In case you didn't notice, the examples are just the "main" page, you can see the members and what not by clicking the appropriate links on the left hand side.

Also, yay for all you close-minded anti-MS zealots. I personally take C# over Java any day. Javadoc is worse than MSDN (at least MSDN's coverage of .NET). I'd rather have examples on the front page with basic info with links to in depth info than one huge page cluttered full of all the useless shit in the class.

Paul Pridham
Member #250
April 2000
avatar

Both C# and Java are really great if you enjoy a whole hell of a lot of typing.

BAF
Member #2,981
December 2002
avatar

monkeyCode
Member #7,140
April 2006

Visual Studio makes wonders in C#, basically you type very very little. Auto Complete pops right up, also a lot of macros in there. And it catches what would be compile errors as you type.

Goalie Ca
Member #2,579
July 2002
avatar

I really have to complain about LINQ. It is a great concept but awful syntax. What the hell where they thinking?

-------------
Bah weep granah weep nini bong!

Epsi
Member #5,731
April 2005
avatar

"if Point sucks, then C# sucks, and so does MS."

Nice logic you have there

___________________________________

piccolo: "soon all new 2d alegro games will be better. after i finsh my MMRPG. my game will serve as a code reference. so you can understand and grab code from."
piccolo: "just wait until my invetion comes out its going to take the wii to the next leave of game play. it will run sony and microsoft out of busness if i dont let them use it aswell."

Jonatan Hedborg
Member #4,886
July 2004
avatar

I think the train of thought was closer to "MS is evil for some arbitrary reason, and as such C# and all other MS-products must suck"

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

"MS is evil for some arbitrary reason, and as such C# and all other MS-products must suck"

Its too bad it doesn't work that way. I hear the newer MSVCs rock, and my favorite non ancient non super-expensive keyboard had to be the "MS Ergonomic Internet Keyboard" I had for years. Same goes for the MS Mouse I had, It was great.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

count
Member #5,401
January 2005

Quote:

I personally take C# over Java any day.

Me too.
I HAVE to work with Java in my job.
I really enjoy coding in C# in my private time.
I hate peoples opinion about this great language just because its from Microsoft.
Actually C# was created by Anders Hejlsberg who also worked on Pascal and created Delphi.
A very talented man and he did a great job on all three languages.

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

I hate peoples opinion about this great language just because its from Microsoft.

Ah, I forgot to mention .NET... I like C# as well, but I hate MS. Though they seem to make some classic stupid API design mistakes over and over. As if they never learn from their (or other's) past mistakes.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

count
Member #5,401
January 2005

Quote:

I like C# as well, but I hate MS.

That's why I use mono :D
Ok... that's no argument against the design mistakes, because those are the same under mono.
But it feels better just because of the saner licensing.

Jakub Wasilewski
Member #3,653
June 2003
avatar

Quote:

Can anyone think of a good reason?

The way I see it, it does make sense, but only from a purist viewpoint.

A Point is a position in space. Adding two positions doesn't make a lot of sense in general. On the other hand, a Size is actually more of a displacement between two points, a distance in a given direction - and from this viewpoint, it makes more sense to add a displacement to a position than to add two positions together.

Of course, that is all just an educated guess, and a bit of a strained one at that :).

In my own projects I tend to use a single Vector struct for positions, sizes and displacements, and that's the way I like it. It doesn't really make a lot of sense, from a pragmatic viewpoint, to differentiate between those three.

---------------------------
[ ChristmasHack! | My games ] :::: One CSS to style them all, One Javascript to script them, / One HTML to bring them all and in the browser bind them / In the Land of Fantasy where Standards mean something.

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

Ok... that's no argument against the design mistakes, because those are the same under mono.

THEY HAVE TO BE. Mono is a C# and .NET clone. If they changed anything, it wouldn't run things anywhere near as well as it does.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Peter Hull
Member #1,136
March 2001

I don't understand the 'hate Java, love C#' people, since they are about as similar as two languages could be.

The thing that troubles me about MS is their willingness* to throw out existing standards and reinvent the wheel if they don't feel they're getting their own way. For example, Direct3d and OpenGL, OOXML and ODF, .NET and J2SE, Silverlight and Flash, Windows Media Photo vs JPEG, etc. I reckon this has set back the course of software/hardware development significantly over the years.

On the other hand you could say that competition is good - the threat of .NET has caused Sun to sharpen their act up in recent months.

Pete

jhuuskon
Member #302
April 2000
avatar

You know, C# (particularly coupled with Visual Studio 2005) was the first language that actually lessened my hatred of programming. The root cause of that hatred is of course the putrid pile of frustration that is C and C++. :P

You don't deserve my sig.

Ron Ofir
Member #2,357
May 2002
avatar

C# is a nice language, but it isn't much better (or different) than Java, and since the JVM is open source now, Java is my chosen language. Oh, and Eclipse is a pretty good IDE, as good as MSVC.

Quote:

OOXML and ODF

Speaking of which, is there any action going to be taken against ISO?

ixilom
Member #7,167
April 2006
avatar

For those of us who used IRC for quite some time maybe remember Microsofts futile attempt with IRCX. face-palms himself

[edit]
Maybe I should say something concerning the topic ;)
I haven't really used C# at all, been avoiding .NET stuff forever. Mostly because it would force users to download the framework just to get some small application going.
Thats no excuse nowadays though since almost everyone has .NET installed.

I should probably look into C# again.

___________________________________________
Democracy in Sweden? Not since 2008-Jun-18.
<someone> The lesbians next door bought me a rolex for my birthday.
<someone> I think they misunderstood when I said I wanna watch...

count
Member #5,401
January 2005

Quote:

I don't understand the 'hate Java, love C#' people, since they are about as similar as two languages could be.

There are diffrencens.
What I totaly love are C#'s properties.
Java code is so ugly cluttered with getFoo setFoo getMoreFoo setMoreFoo.
Properties make code niceer to read. AND your getters and setter are acting just like attributes wich is a BIG plus.

exception handling is diffrent. In c# you aren't forced to catch exceptions. If this is good or bad... you decide.
I think it's good.
All java programmers handle this forced exception handling with try {...} catch { // TODO } which is worser than not doing it at all.

I don't want to say C# is better language. Java is nice too. I just don't like it (anymore). And I just wanted to point out that there are diffrences.

Quote:

and since the JVM is open source now

C# is ECMA standard. Java isn't.

Quote:

Mostly because it would force users to download the framework

Yea. thats the good thing about java. It just runs without... oh wait... you need to download a JRE to run Java Programs... ;)
(sorry for abusing your post to point this out :D; you actually didn't mention Java at all)

Ron Ofir
Member #2,357
May 2002
avatar

Quote:

All java programmers handle this forced exception handling with try {...} catch { // TODO } which is worser than not doing it at all.

I know I'm nitpicking, but that's not a good point.

Quote:

What I totaly love are C#'s properties.

That's true. Java certainly has a couple of stupid design decisions, but it's not enough to justify the "c# good, java bad" statement.

Quote:

C# is ECMA standard. Java isn't.

While that is true, being an ECMA standard doesn't mean that you can change the language (AFAIK). On the other hand, there are a couple of open Java alternatives that can run on the JVM (Groovy, Scala), and I don't know of any that run on the .NET framework.

count
Member #5,401
January 2005

Quote:

I know I'm nitpicking, but that's not a good point.

Youre right. Thats was a bad statement.

Quote:

but it's not enough to justify the "c# good, java bad" statement.

And C# beeing developed by ms is not enough to say "java good, c# bad" (I don't blame you doing this, but there are others that do this)
And for completeness:

I said:

I don't want to say C# is better language. Java is nice too. I just don't like it (anymore).

 1   2   3   4 


Go to: