anonymous methods only available in C#?

P

PJ6

I just learned about anonymous methods and was taken aback to discover that
they are only available in C#. What, is there still a stigma against VB.Net,
that maybe somehow this is a language that doesn't deserve to be as powerful
as others? I hate C#. Anyway... what gives? What's the reasoning behind
*that* decision?

Oh I don't expect anyone to have a real answer for me. Who knows what they
were thinking. I'm just ranting. I'll go sulk over there now...

Paul
 
C

Cor Ligthert [MVP]

PJ6

Are you happy with this kind of coding, it reminds me back to my assembler
mainframe time when I had to declare every memory address almost fixed. It
took only a lot of time and I was spending thousand times more time to
create a simple "Hello World" program.

I see things as delegates and reflection as a wrong solution for still
existing failures from a programming language.

There will be however always be fanatic orthodox people who tell that that
way of programming is the most optimum there is.

However, just my opinion.

Cor
 
L

Larry Lard

PJ6 said:
I just learned about anonymous methods and was taken aback to discover that
they are only available in C#. What, is there still a stigma against VB.Net,
that maybe somehow this is a language that doesn't deserve to be as powerful
as others?
Yes.

I hate C#.

It's not so bad.
Anyway... what gives? What's the reasoning behind
*that* decision?

Oh I don't expect anyone to have a real answer for me. Who knows what they
were thinking. I'm just ranting. I'll go sulk over there now...

In the past it was rare for MS to ever explain their decisions, but
since the rise of blogs.msdn.com as a quasi-official communication
channel, we are seeing a lot more about motivations come out. However, I
can't say I've ever seen anything from the VB.NET team explaining this
particular omission. I *imagine* it would go something like this:

"VB.NET is designed for RAD and ease-of-use and is targeted at
developers who want to get things done as quickly as possible without
being lumbered with complex architectural features."

which would translate into reality as

"VB developers are too stupid to comprehend anonymous delegates.
Besides, all of us here are actually C++ developers, and hence we
haven't got a chance of being sufficiently in tune with the Spirit of
Basic to be able to work out a syntax for them."


Just my opinion, of course.
 
P

PJ6

Larry Lard said:
"VB.NET is designed for RAD and ease-of-use and is targeted at developers
who want to get things done as quickly as possible without being lumbered
with complex architectural features."

which would translate into reality as

"VB developers are too stupid to comprehend anonymous delegates. Besides,
all of us here are actually C++ developers, and hence we haven't got a
chance of being sufficiently in tune with the Spirit of Basic to be able
to work out a syntax for them."

I agree, it's not at all about "complex architectural features". There's
really no difference between VB and C# except two very fundamental
syntactical differences. All those goddam parentheses, and case-sensitivity.
That last one's a real killer - case-sensitivity isn't even complaint to
their own compiler standard. C# isn't a language, it's a bad habit.

Paul
 
P

PJ6

I see things as delegates and reflection as a wrong solution for still
existing failures from a programming language.

You've really piqued my curiosity on this one. If you don't use reflection,
how do you collect attribution data? If you don't use delegates, how do you
handle events? Or maybe you're saying, there is a better way but it doesn't
exist in VS.Net. What would you do differently?

Paul
 
P

Paul Clement

¤ I just learned about anonymous methods and was taken aback to discover that
¤ they are only available in C#. What, is there still a stigma against VB.Net,
¤ that maybe somehow this is a language that doesn't deserve to be as powerful
¤ as others? I hate C#. Anyway... what gives? What's the reasoning behind
¤ *that* decision?

Probably the same reason as why GoSub is no longer part of the language.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
T

Tom Shelton

PJ6 said:
I agree, it's not at all about "complex architectural features". There's
really no difference between VB and C# except two very fundamental
syntactical differences. All those goddam parentheses, and case-sensitivity.
That last one's a real killer - case-sensitivity isn't even complaint to
their own compiler standard. C# isn't a language, it's a bad habit.

That's funny... I actually hate the fact that VB is not case sensitive
:)
 
J

Jim Wooley

I recommend you check out Brian Bec's articles regarding trying to come up
with a scheme for Lambda's in VB for some insight into the complexities of
doing anonymous methods. see http://weblogs.asp.net/brianbec/arc...osures_2C00_-Currying_2C00_-and-All-That.aspx.

Also, check out Eric's post regarding anonymous methods and variable scoping
at http://blogs.msdn.com/oldnewthing/archive/2006/08/02/686456.aspx.

FWIW, in C# Anonymous methods are simply syntatic sugar. They translate into
actual methods on the IL.
Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx
 
C

Cor Ligthert [MVP]

PJ6.

In visual Basic you don't have in standard situations not direct to use
delegates to handle events. There are enough methods for that to do that
without that, this is a known point where it outclasses C#.

If you use reflection, than the first thing you have in my opinion to ask
yourself is if there is no better method. Reflection is only another name
for late binding.

In other words, if you use these things consequent, your program will be in
my opinion probably be lousy to maintenance and slow performing.

In Visual Basic by instance is the way to do background processing made more
simple, this is for me a normal development from a living program language.

As I started with, the old mainframe programming as some orthodox
programmers still like, is for me only for hobbyists.

Cor
 
C

Cor Ligthert [MVP]

Sorry,

I used in the text the direct translation from Dutch (which I saw) :).
this is for me a normal development from a living program language
this is for me a normal evolution from a living program language.
 
P

PJ6

Cor Ligthert said:
Reflection is only another name for late binding.

You may be an MVP, but this statement reveals a huge gap in your knowledge
of what reflection is and can be used for.

Paul
 
C

Cor Ligthert [MVP]

Paul,
You may be an MVP, but this statement reveals a huge gap in your
knowledge of what reflection is and can be used for.
If you do this statement, than tell in about 10 words what reflection is,
your current text can be done by any child older than 10 and shows that you
have at least the knowledge of that, not more.

Cor
 
P

PJ6

Cor Ligthert said:
Paul,

If you do this statement, than tell in about 10 words what reflection is,
your current text can be done by any child older than 10 and shows that
you have at least the knowledge of that, not more.

Cor

Cor,

I didn't mean to offend you; as such I'm not especially interested in
trading ad-hominem over a technical matter.

For now assume my statement is correct, back up, and do a little research on
your own as to why I may have a big and legitimate reason to disagree with
you. I'll post an explanation of the role and necessity of reflection in
systems architecture for you later in a new thread.

Paul
 
B

Brian Gideon

Cor said:
I see things as delegates and reflection as a wrong solution for still
existing failures from a programming language.

Delegates give you the ability to use a more concise syntax for
implementing the observer design pattern. What do you propose in place
of delegates?

Reflection gives you several things. First, it makes attribute based
programming possible. We can mark up classes and methods to create
unique debugger visualizers, etc. Second, it makes aspect oriented
programming easier. Third, it makes dynamic code generation much
easier. I good example of this is the Regex class which will compile
the finite automata to code from the regular expression. That way it
doesn't have to be interpreted. That's just to name a few off the top
of my head.
 
H

Herfried K. Wagner [MVP]

PJ6 said:
You may be an MVP, but this statement reveals a huge gap in your
knowledge of what reflection is and can be used for.

This doesn't mean that calling methods and accessing members through
reflection is not a late-bound access.
 
C

Cor Ligthert [MVP]

Brian,

In my opinion do you completely confirm what I wanted to say.

Let me try to say it in other words, delegates and reflections are in my
opinion no benefits, they can (are) sometimes be needed when the program
language does not give you more for (normal) humans better understandable
and readable options for that.

Cor
 
?

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

PJ6 said:
I just learned about anonymous methods and was taken aback to discover that
they are only available in C#. What, is there still a stigma against VB.Net,
that maybe somehow this is a language that doesn't deserve to be as powerful
as others?

Yes, of course there is, but that's probably not the reason why there
isn't anonymous methods. It's probably more on the side that the syntax
for anonymous methods would be awkward in a line based programming language.

Actually, as VB.NET is using the same framework as the other .NET
languages, it's a lot more powerful than it deserves. ;)

Anyway, an inability to use anonymous methods doesn't make VB.NET less
powerful, just less flexible. You can still accomplish the same thing
using a named method.
I hate C#.

So you hate C# because it has features that VB.NET is lacking?

That sounds like a pure outburst of envy... ;)
 
B

Brian Gideon

Cor,

That's fine that you disagree. And who knows, you may even change my
mind :) But, to do that I need alternatives. What do you propose in
replace of delegates? How would you like to see AOP incorporated into
the language? How would you create a fast regular expression parser?

Brian
 

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