Is linq the final straw for VB?

  • Thread starter Thread starter Michael C
  • Start date Start date
Herfried,

I hear you only telling about writting.

Did you know that some people have to maintain as well programs.

Do you know what nice almost impossable to maintain spaghethi programmers
can make.

You won't me say that VB is better then C#.

However, C# invites in my idea more to make almost impossible maintanable
programs more.

Certainly can't agree with that. I think it all comes down to the quality of
the original code, and has nothing to do with the language. In other words,
both environments give ample opertunity to create unmaintainable code.
 
Personally I have used C-style languages (especially "pure" C) and different
dialects of BASIC for many years in parallel.

My conclusion is that the difference in the syntax is negligible compared to
other differences, especially semantical differences or differences in IDE
the support. For example, > 10 years ago I really preferred VB over C (for
user-level development) because it was almost impossible to provoce buffer
overruns and to dereference invalid pointers as it was possible in C without
using certain odd tricks.

As for the comparison between VB and C# I tend to prefer VB because of some
handy features it provides opposed to C#, such as 'My', declarative event
handling, XML literal support directly built into the language.
Nevertheless, I believe that even those features are only a plus for VB if
you really need them. When building a library dealing with XML (Office Open
XML or similar) heavily, XML support of VB is really a huge advantage over
C#. On the other hand, if using Lambdas etc. forms a core part of the code,
C# would have advantages over VB.

The opinions expressed are my own - and are not intended to disparage the OP's
or others opinions or to make any claims about the fitness of VB as a language
:)

1) My - not so much. There are a couple of places where it has some handy
methods, etc (setting and resources) - but, I'm not sure overall it's a
significant advantage. Any C# developer who has to deal with sort of thing
continually, is likely to create their own wrappers anyway - basically
nullifying the advantage....

2) Declaritve Event Handling - ewwwww! Can't stand it actually. It's fine
when you have one, maybe two controls sharing a common event handler - but,
many more then that and Handles becomes a down right abomination in my opinion.
Again, this is purely subjective opinion - but, I much prefere the C# way (though,
I've never been thoroughly satisifed with the use of the +=, -= operators)

3) XML literals - Yes, in some cases this gives VB a slight advantage over C#,
but I wouldn't make it to be a significant advantage. I would put it more on
the order of auto implemented properties in C# or VB's ability to redirect a
interface method to an implementation with a different name, convienient, but not
essential. I mean, really you could accomplish nearly the same thing in C#
using a resource... Granted, it takes a bit more code and setup, but once
done - it wouldn't pose a significant issue.

I think the only domain where VB currently has a real and significant
advantage over C# is in COM interop scenarios.
What I basically want to say: The number of charactes one has to type to
achieve a certain task is often irrelevant because there are so many other
factors which play a crucial role in determining which programming language
is more suitable for a certain task.

I totally agree with the above.
 
Cor Ligthert said:
However, C# invites in my idea more to make almost impossible maintanable
programs more.

This is the impression that someone who hadn't used C# might have. However
it is simply not true. Either language is pretty much equally maintainable.
The only thing I would say is that C# missing a lot of legacy stuff like On
Error Goto makes it easier to maintain. Also, the stricter compiler checks
probably help too.

Michael
 
Herfried K. Wagner said:
Personally I have used C-style languages (especially "pure" C) and
different dialects of BASIC for many years in parallel.

My conclusion is that the difference in the syntax is negligible compared
to other differences, especially semantical differences or differences in
IDE the support.

I find that I do pretty much the same stuff in VB and C#. I don't use any of
the wizards of VB so it all comes down to the typing for me. As I said, I
find C# more streamlined for typing in code. This is *the* most significant
issue imo because it effects me all day every day. I might declare the
occasional event or rarely use xml but every single day I spend hours and
hours typing code.
For example, > 10 years ago I really preferred VB over C (for user-level
development) because it was almost impossible to provoce buffer overruns
and to dereference invalid pointers as it was possible in C without using
certain odd tricks.

Back then there was a real difference between C and VB, now there is little
difference between C# and vb.net. 10 years ago I would have chosen VB for
most business apps also.
As for the comparison between VB and C# I tend to prefer VB because of
some handy features it provides opposed to C#, such as 'My',

My is one of the things I don't like about VB. IMO things like this should
either be part of the framework that all languages use or not be there at
all. The language should not define it's own classes (namespaces?) such as
My.
declarative event handling, XML literal support directly built into the
language. Nevertheless, I believe that even those features are only a plus
for VB if you really need them. When building a library dealing with XML
(Office Open XML or similar) heavily, XML support of VB is really a huge
advantage over C#. On the other hand, if using Lambdas etc. forms a core
part of the code, C# would have advantages over VB.

Events I don't need a huge amount of (outside the forms designer) and xml is
very rare. On the other hand I find I use lambdas in every second function.
I would say I have more lambda expressions than I do actual functions
because when you use them you might use 10 in one function. I know that
comes down the the type of app you're writing because I had one app that
hardly had a need for linq and another that seemed to need it everywhere.
But as a general rule I think linq use would be significantly greater than
typing out xml in code or using events outside the designer.
What I basically want to say: The number of charactes one has to type to
achieve a certain task is often irrelevant because there are so many other
factors which play a crucial role in determining which programming
language is more suitable for a certain task.

I disagree with that. The typing is something you do a lot of not matter
what task you are doing. All the other tasks are less often used.

Michael
 
Herfried,
Could you describe how C# or VB invites programmers to write
hard-to-maintain programs more easily than the other programming langauge?
Simple have a look at the English C# newsgroup, there you see people
searching the limits.

To make it simple I give only one example, but it is not limited to this
one.

As Reflection is in my idea something to use as there are no other
possibilities (Don't think that I don't use it), seems it for some people
using C# a goal, because "they" seems to have the idea that it gives better
programs. (This can simply be done in VB by setting Option Strict to Off).

Cor
 
Cor Ligthert said:
Simple have a look at the English C# newsgroup, there you see people
searching the limits.

To make it simple I give only one example, but it is not limited to this
one.

As Reflection is in my idea something to use as there are no other
possibilities (Don't think that I don't use it), seems it for some people
using C# a goal, because "they" seems to have the idea that it gives
better programs. (This can simply be done in VB by setting Option Strict
to Off).

That is just plain wrong. C# doesn't make anyone use reflection.

Michael
 
"That is just plain wrong. C# doesn't make anyone use reflection."

Last I knew, C# or VB can't make you do anything except follow its
programming style rules if there are any. I have my preferences of VB over
C# but that isn't because VB made me do it....
 
Andy B. said:
"That is just plain wrong. C# doesn't make anyone use reflection."

Last I knew, C# or VB can't make you do anything except follow its
programming style rules if there are any. I have my preferences of VB over
C# but that isn't because VB made me do it....
?
 
Herfried K. Wagner said:
So how are you doing late binding then?

I thought someone might bring up. Cor was trying to say people in C# use
reflection when they don't need it. My point is that C# doesn't make them.

Michael
 
Michael C said:
I thought someone might bring up. Cor was trying to say people in C# use
reflection when they don't need it. My point is that C# doesn't make them.

Cor's statement is ambiguous, but based on the sentence "This can simply be
done in VB by setting Option Strict to Off" I assume that he was referring
to those scenarios which can be written using late binding via 'Option
Strict Off' in VB.
 
Herfried K. Wagner said:
Cor's statement is ambiguous, but based on the sentence "This can simply
be done in VB by setting Option Strict to Off" I assume that he was
referring to those scenarios which can be written using late binding via
'Option Strict Off' in VB.

His statement appeared to be that people who use C# intentionally try to do
things a more difficult way. While what he said wasn't clear I don't think
you can assume all he was talking about was late binding. If that is all he
is talking about then this is an issue discussed many times.

Michael
 
Michael,
His statement appeared to be that people who use C# intentionally try to
do things a more difficult way.

The word "some" has a meaning in English, by simple removing it when it fits
you, you are wrong reflecting the words somebody said.

I wrote "some" to show the idea of a tendency I have. This does not mean
that it is a fact, this is simple my idea based by instance on visiting two
newsgroups.

However, in the way you wrote that I told it, it is absolute not my idea, if
it is done both well, there is for me not much difference between a good C#
and a VB program to maintain.

(And yes I gave reflection as a sample).

Cor
 
Back
Top