reasons to hate C#

R

RobinS

So who *do* you think is better, the Beatles or the Rolling Stones?

Robin S.
p.s. I'M KIDDING!!!
 
R

Rad [Visual C# MVP]

So who *do* you think is better, the Beatles or the Rolling Stones?

Robin S.
p.s. I'M KIDDING!!!
----------------------------------

Surely you jest! Isn't it obvious? Sting & The Police!
 
R

RobinS

Rad said:
Surely you jest! Isn't it obvious? Sting & The Police!

Well, I have to agree with that, being quite a fan myself, although Sting's
direction on his latest album is a bit questionable. (16th century lute
music? Is that a vanity project or what?)

It looks like you might have a chance to see The Police again this summer,
if you have as much energy as you did when they were popular. ;-)

Robin S.
 
R

RobinS

Mike Hofer said:
YOU'RE ALL WRONG!! The greatest music of all time was Pat Boone's
cover of Metallica!!!

:p

I thought that was Paul Anka. (Oh, great, now I have that horrible song,
"Having My Baby", from the late 70's, running through my head. Damn that
Paul Anka! Damn him!)

Robin S.
 
P

PJ6

OK, I'll fess up as to why I dragged out this horse to beat.

For all the pontificating C# people make, I've yet to see problems with VB
quite as deep as these two:

- crippled constructor chaining
- can't have parameterized properties

These are real language shortcomings, and have nothing to do with
differences in syntax or IDE behavior.

Paul
 
M

Mike Hofer

OK, I'll fess up as to why I dragged out this horse to beat.

For all the pontificating C# people make, I've yet to see problems with VB
quite as deep as these two:

- crippled constructor chaining
- can't have parameterized properties

These are real language shortcomings, and have nothing to do with
differences in syntax or IDE behavior.

Paul








- Show quoted text -

Could you clarify what you mean by "crippled constructor chaining"?
"Crippled" implies that it's so broken as to be useless. You'd have to
make some pretty compelling arguments to me that it's constructor
chaining was crippled. I've been working with VB.NET since Beta, and
have yet to see any problems with VB.NET's implementation of
constructors; certainly nothing to lead me to believe that it's
crippled.

Further, the lack of parameterized properties is not a VB.NET thing--
it's a .NET thing. Parameterized properties are indexers, if I recall
correctly. Further, I don't believe it's enforced by the compiler;
it's just not a best practice (though I could be wrong).

For information on parameterized properties, see here:

http://msdn2.microsoft.com/en-us/library/ms229061(VS.80).aspx
 
M

Mike Hofer

Could you clarify what you mean by "crippled constructor chaining"?
"Crippled" implies that it's so broken as to be useless. You'd have to
make some pretty compelling arguments to me that it's constructor
chaining was crippled. I've been working with VB.NET since Beta, and
have yet to see any problems with VB.NET's implementation of
constructors; certainly nothing to lead me to believe that it's
crippled.

Further, the lack of parameterized properties is not a VB.NET thing--
it's a .NET thing. Parameterized properties are indexers, if I recall
correctly. Further, I don't believe it's enforced by the compiler;
it's just not a best practice (though I could be wrong).

For information on parameterized properties, see here:

http://msdn2.microsoft.com/en-us/library/ms229061(VS.80).aspx- Hide quoted text -

- Show quoted text -

Just to clarify: VB.NET does support parameterized properties. But the
best practice is to use them as indexers (that is, they should take
one argument, and that argument should be an index into an array or a
collection; the data type of the index can be any of the standard .NET
data types).

Wasn't sure I was clear -- in re-reading my post, it seemed I had
constradicted myself.
 
P

PJ6

Mike,

In my post, I was referring to C# shortcomings, not VB.NET.

C# has no property indexers, if that is the proper term. Not "best
practice"? That's bunk.

To clarify the constructor chaining problem; in C#, you can't take values
derived within the method body of one constructor and feed them into
another. If you've worked in VB enough, this should strike you as
surprisingly crippled.

Paul

....
 
M

Mike Hofer

C# has no property indexers, if that is the proper term. Not "best
practice"? That's bunk.

To clarify the constructor chaining problem; in C#, you can't take values
derived within the method body of one constructor and feed them into
another. If you've worked in VB enough, this should strike you as
surprisingly crippled.

Paul




...

Paul,

First, I owe you an apology. If my post came across as accusatory or
critical, it was not my intent. The first paragraph of the post
*seemed* to be saying that the issues with constructor chaining and
lack of parameterized properties lay with VB. From your response, that
clearly wasn't your intent, and I apologize for having misunderstood
you.

Now, in the interests of carrying on a clear, calm, and (hopefully)
intelligent discussion (on my part), I'm going to ask a question to
make sure that I understand what you mean in your response. :) I have
an *idea* of what you mean, but I want to be sure before I fly off the
handle and make an unfounded assumption, and say something stupid.
(Again.)

In your response, you said:
C# has no property indexers, if that is the proper term. Not "best
practice"? That's bunk.

It's the "that's bunk" part that I'd like to discuss. Can you expand
on your viewpoint on that?

Now, regarding the constructor issue in C#, I'll admit that I am
nowhere *near* as proficient in C# as I am with VB.NET. I agree that
the inability to invoke one constructor from another in the same class
would seem to be a serious shortcoming (if that's what you're saying,
and if it's not, I'd ask you to correct me). However, it's been a
while since I coded anything in C#, and I'll have to do some coding
with a few test applications to refresh my memory. (I'd prefer to do
something with it so I can speak knowledgably and not rely a vague
sense of recall.)

Thanks, and again, my apologies for misconstruing your intent.

Mike
 
B

Brian Gideon

Mike,

In my post, I was referring to C# shortcomings, not VB.NET.

C# has no property indexers, if that is the proper term. Not "best
practice"? That's bunk.

A class can have a single parameterized indexer in C#, but like you
said, there is no support for parameterized properties.
To clarify the constructor chaining problem; in C#, you can't take values
derived within the method body of one constructor and feed them into
another. If you've worked in VB enough, this should strike you as
surprisingly crippled.

Paul

C# supports constructor chaining. Although the syntax happens to
appear before the constructor body, it is no less powerful than the VB
counterpart since VB requires the chained call to be first in
constructor body anyway.
 
P

PJ6

C# supports constructor chaining. Although the syntax happens to
appear before the constructor body, it is no less powerful than the VB
counterpart since VB requires the chained call to be first in
constructor body anyway.

Huh. Well I stand corrected.

Am I already forgetting VB? Nooooooooooo.....

Paul
 
P

PJ6

Mike Hofer said:
Thanks, and again, my apologies for misconstruing your intent.

Sorry, Mike, I didn't intend my tone to be combative :)

Never mind about the constructor chaining, I was wrong...

Paul
 
P

per9000

I want to rant, but I'm too busy at the moment.

Who else hates working in C#? What's your biggest pet peeve?

Paul

I hate C# since I am unable to put files in the trashcan from it (but
I am able to do it from VB.NET (please tell me how to do it in C# if
you know it)).

Otherwise: I prefer C# to Visual Basic, except for the name. In
general "Basic" sounds cooler than "C", but than again I *am* a geek.

/Per

--

Per Erik Strandberg
..NET Architect - Optimization
Tomlab Optimization Inc.
http://tomopt.com/tomnet/
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

per9000 said:
I hate C# since I am unable to put files in the trashcan from it (but
I am able to do it from VB.NET (please tell me how to do it in C# if
you know it)).

How do you do it in VB.NET, then? It should be quite trivial to
translate to C#.
Otherwise: I prefer C# to Visual Basic, except for the name. In
general "Basic" sounds cooler than "C", but than again I *am* a geek.

If you think that "Basic" sounds cooler tnan "C", you only think that
you are a geek. ;)
 
R

Rory Becker

per9000 said:
How do you do it in VB.NET, then? It should be quite trivial to
translate to C#.

I don't like C# much because of the case-sensitivity.

I don't know how the recycle bin delete is achieved but I'd guess it's a
simple matter of referencing the right assemblies (Perhaps Microsoft.visualbasic)
and calling the function with correct casing.
 
P

per9000

How do you do it in VB.NET, then? It should be quite trivial to
translate to C#.

Indeed, it *should* be...

Sub Main()
Try
My.Computer.FileSystem.DeleteFile("foo.bar",
FileIO.UIOption.OnlyErrorDialogs,
FileIO.RecycleOption.SendToRecycleBin)
Catch ex As Exception
Console.WriteLine("Error: " & ex.Message)
End Try
End Sub

Build it and take a look in reflector ( http://www.aisto.com/roeder/dotnet/
), if you manage to do this in C# in 7 lines (not counting { or })
I'll buy you coffee thursday :) (total value approx 5 SEK)

Also take a look at http://www.pererikstrandberg.se/projects/totrash/
for a small app based on this (the only app I've ever written in
"basic").

I'd really like this in C# to be able to combine more easily with
other stuff I build.

If you think that "Basic" sounds cooler tnan "C", you only think that
you are a geek. ;)

This thread is has really hit the bottom, or as we say in Swedish:
"the botten is nådd..."

/Per

--

Per Erik Strandberg
..NET Architect - Optimization
Tomlab Optimization Inc.
http://tomopt.com/tomnet/
 
R

rowe_newsgroups

if you manage to do this in C# in 7 lines (not counting { or })
I'll buy you coffee thursday :) (total value approx 5 SEK)

I like Kona coffee the best :)

using Microsoft.VisualBasic.FileIO;

void Main()
{
try
{
FileSystem.DeleteFile("foo.bar",
UIOption.OnlyErrorDialogs, RecycleOption.SendToRecycleBin);
}
catch (Exception ex)
{
Console.WriteLine("Error: {0}", ex.Message);
}
}

Thanks,

Seth Rowe
 
P

per9000

I'll be damned,

By adding a reference to Microsoft.VisualBasic the magic namespace
FileIO appeared, before I had only VBCodeProvider in the namespace
Microsoft.VisualBasic.* (now I got lots of stuff), I guess you can
call me Grasshopper now master, or if you prefer: I could commit
harakiri and squeeze my guts by repeatedly opening and closing "DVD-
RAM Drive (D:)"

Seth, if you find me thursday: I will buy you coffee...

Since I no longer have any reason to hate C# perhaps the harakiri can
wait.

/P

--

Per Erik Strandberg
..NET Architect - Optimization
Tomlab Optimization Inc.
http://tomopt.com/tomnet/
 
R

rowe_newsgroups

By adding a reference to Microsoft.VisualBasic the magic namespace
FileIO appeared, before I had only VBCodeProvider in the namespace
Microsoft.VisualBasic.* (now I got lots of stuff)

I always thought it was misleading to have access to VBCodeProvider
when you don't hold a reference to Microsoft.VisualBasic. I can't tell
you how confused I was when I started using C# and was trying to
access the Microsoft.VisualBasic.Devices.Network class!
Seth, if you find me thursday: I will buy you coffee...

Perhaps I'll take a raincheck - especially if you live in Sweden.
Since I no longer have any reason to hate C# perhaps the harakiri can
wait.

Good to hear! - I never have been an advocate for suicide :)

Thanks,

Seth Rowe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top