vb versus c

  • Thread starter Thread starter Robbie from Philippines
  • Start date Start date
R

Robbie from Philippines

Im a serious programmer and I know that programming is
the path that i would take for the rest of my life.

I use vb6. Since I have to study a new language should i
go for vb.net or its c equivalent (C++, C# .net)?
 
This is personal opinion. Your mileage may vary..

Here's my experience. With some exceptions (others who are deeper into the
languages can expand on this), choice of language is no longer the issue.
..Net and the CLR are the hurdle you're going to need to overcome if you're
making the jump from VB6 (I came from VB5, so I'm dealing with the same
issues..)

The .net languages differences are more syntactical than functionality..
(i.e. for the most part you can do the same things, it's just the format you
use to get there..)

With that in mind my recommendation for you would be VB.Net.. It IS a new
language with a lot of new stuff to learn. It's upside is that the syntax
will be relatively familiar to you, making the transition easier. It also
(for reasons I don't quite understand) has the most complete implementation
of intellisense, which is a godsend in my opinion..

Now if you were coming from Java I'd recommend J#..

And if you were a C++ programmer, I'd recommend C#.. It's not that they're
the same language, just that they're the version of .Net with the most
comfortable syntax. The C++ people may argue with me. The reason I don't
say C++.Net is because I understand it's kind of a hybrid, allowing both
native windows and .Net managed code, but that it's not exactly a pretty or
easy to master implementation..

Would anyone like to expand on, or dis this?

W.G. Rowland
 
I've only had problems with VB.NET and specifically in the following cases:

- unsafe. VB.NET does not support the C# unsafe block, which is a shame.
It especially becomes an issue when you need to manipulate bitmaps pixel by
pixel.
- Compact framework control design. You cannot create a CF control with
design support using VB.NET. You can create a control, just not with design
time support.
- Code examples. I find a lot more in depth examples in C# from 3rd party
sites, though occasionally you will find a VB.NET "trump card" example with
no C# equiv. MS, however, does a good job of providing both C# and VB.NET
examples for most things.

J# is, again in my opinion and only at this time, a non contender. I think
JScript even has a larger following. Subscribe to the J# newsgroup and look
at the post volume compared to VB or C#.


Aside from that, it's ceteris peribus.
 
The first line was phrased poorly. I meant to say:

"I've only had problems with VB.NET in the following specific cases:"
 
I'd say one of the VB .NET downsides is its IDE slo-o-o-wness. All my fellow
programmers who use VB .NET are frequently irritated by that they have to
wait for tens of seconds even if they have just pressed the Enter key to add
a comment.
 
In .NET youll have to get used to the oo structure but the transition
shouldn't give you any problems if you go for vb.NET
as for the speed, no problems w that here (get a decent pc ;p )



Dmitriy Lapshin said:
I'd say one of the VB .NET downsides is its IDE slo-o-o-wness. All my fellow
programmers who use VB .NET are frequently irritated by that they have to
wait for tens of seconds even if they have just pressed the Enter key to add
a comment.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

W.G. Rowland said:
This is personal opinion. Your mileage may vary..

Here's my experience. With some exceptions (others who are deeper into the
languages can expand on this), choice of language is no longer the issue.
.Net and the CLR are the hurdle you're going to need to overcome if you're
making the jump from VB6 (I came from VB5, so I'm dealing with the same
issues..)

The .net languages differences are more syntactical than functionality..
(i.e. for the most part you can do the same things, it's just the format you
use to get there..)

With that in mind my recommendation for you would be VB.Net.. It IS a new
language with a lot of new stuff to learn. It's upside is that the syntax
will be relatively familiar to you, making the transition easier. It also
(for reasons I don't quite understand) has the most complete implementation
of intellisense, which is a godsend in my opinion..

Now if you were coming from Java I'd recommend J#..

And if you were a C++ programmer, I'd recommend C#.. It's not that they're
the same language, just that they're the version of .Net with the most
comfortable syntax. The C++ people may argue with me. The reason I don't
say C++.Net is because I understand it's kind of a hybrid, allowing both
native windows and .Net managed code, but that it's not exactly a pretty or
easy to master implementation..

Would anyone like to expand on, or dis this?

W.G. Rowland
 
Hi Robbie,

In VB.net are the Microsoft.VB functions. They are a real part of the
framework.
In the seldom case that you cannot find a so called "system" function, there
is sometimes a Microsoft VB function.

And sometimes they are very handy to have and much faster than the system
functions (As I said before the Microsoft VB functions are too part of the
system, but you can see them as an extra).

But when you are a bad typer, use C# because VB.net needs more typing.
(Although C# needs codeblocks to make it readable afterwards).

Cor
 
Dear Robbie,

Here are some thoughts from an experienced programmer !!
the path that i would take for the rest of my life.<<

I don't know whether you mean you are a programmer who is serious or
doing/interested in 'serious' programming !! What 'I' mean by serious
programming is the non-trivial stuff - very intense programming.

Broadly speaking there are two disciplines in programming : 1) Trivial
Stuff - doing validation, porting projects, search and replace blah blah,
once you get a hang of what to do (the process) it becomes mechanical. 2)
Non-trivial - Very intense in nature and makes you think all the time. You
are not bound by processes but only by the framework of nature !! This is a
very interesting area of programming(personally). Common examples of
non-trivial stuff include Quantum Computing and Genetic Programming. These
have great potential to strike big and are the technologies of
future(immediate??).

My advise would be: select your discipline first and once you have done that
you can choose your language. But I would like to stress that it is not the
language that you have to concetrate on, but analytical skills and
programming logic techniques.

Nice Chap
 
Hi Mattias

Yes I did some tests according coding people had sent in.

Jay B was one of the big contributors because he had seen a discussion in
the C# group but he said that nobody took some time to test it. So I did.

I had always the idea, that the system members would be build on a same way
as the vb functions and therefore without any time difference. It seems not
to be so.

I have evaluated seven functions, with a character, and with strings that
makes a big difference. But you cannot evaluate VB functions with
characters, because those do not exist, in VB functions are characters
threaten as strings.

So I show you only the functions in which where strings involved.

Of course I did only test this functions, and you can say, but there are so
much more, could be, but those that we tested are very important ones.

In the test program I have made different very long strings (I made a
program that makes more every kind of character strings with stringbuilder),
you have to know that to see something in 1/1000 seconds it needs very long
strings (think in MB's) on my computer.

\\\\
Public Function Test1(ByVal input As String, ByVal delimiter _
as String) As Integer 'Jay B 1(string)
Dim count, index As Integer
index = input.IndexOf(delimiter)
Do Until index < 0
count += 1
index = input.IndexOf(delimiter, index + 1)
Loop
Return count
End Function
////
This functions took in most test twice the time from the one beneath
\\\\\
Public Function Test2(ByVal strInput As String, ByVal strDelimiter _
As String) As Int32 'Jon (string)
Dim iStart As Int32, iCount As Int32, iResult As Int32
iStart = 1
iCount = 0
Do
iResult = InStr(iStart, strInput, strDelimiter)
If iResult = 0 Then Exit Do
iCount += 1
iStart = iResult + 1
Loop
Return iCount
End Function
////
I changed it with a String member but the time was almost exactly the same
as the function from Jab B.
\\\\
Public Function Test3(ByVal input As String, ByVal delimiter _
As String) As Integer 'Jon with indexof(x,x,x)
Dim iStart As Int32, iCount As Int32, iResult As Int32
iStart = 0
iCount = 0
Do
iResult = input.IndexOf(delimiter, iStart)
If iResult = -1 Then Exit Do
iCount += 1
iStart = iResult + 1
Loop
Return iCount
////
When the test was done, someone did send in a test with a regular
expression.
I don't know how to make those, but I added this one to,
I even did not look what the different was in time, but I thought it took
almost 15 times the time from the one from Jay B (or from John I do not
remember me that right, but that is not important)..
\\\\
Public Shared Function test7(ByVal input As String, _
ByVal delimiter As Char) As Integer '
Dim rx As New System.Text.RegularExpressions.Regex(delimiter)
Return rx.Matches(input).Count
End Function
End Class
////

Can be I did make a mistake, but it is something that surprises me too.

Cor
 
Justin,
- Compact framework control design. You cannot create a CF control with
design support using VB.NET. You can create a control, just not with design
time support.
I find this curious, do you have any details? I have not done a lot with the
compact framework yet, when I do, I will probably need design support.

Thanks
Jay
 
Robbie,
I lean toward what Mattias & W.G. Rowland stated.

Learning the syntax of C#, VB.NET, C++, J# or Java is relatively easy once
you have one, so why not learn both or all. Not so much to be an expert in
each, but to be able to read & write them, then the "samples" problem is not
really a problem. In fact the following section of MSDN highlights the
differences, making moving between languages even easier.

http://msdn.microsoft.com/library/d...us/vsintro7/html/vxgrfLanguageEquivalents.asp

Rather then "study a new language" I would recommend you study solid OOP
techniques, Design Patterns, the CLR, the base class library, one or more
specific .NET technologies (ADO.NET, ASP.NET Forms, ASP.NET Web Services,
Windows Forms). As once you have these things mastered, the language you use
is largely immaterial. Then there are some of the other technologies that
are used in .NET that having an understanding is good, such as XML, XML
Schema, XML Transforms, XPath. Did I mention OOP!

I also found studying Refactoring (http://www.refactoring.com) to be
beneficial in expanding my understanding OOP Techniques & Design Patterns.
However you need to have OOP & Design Patterns down first.

Hope this helps
Jay
 
\\\\
Public Function Test1(ByVal input As String, ByVal delimiter _
as String) As Integer 'Jay B 1(string)
Dim count, index As Integer
index = input.IndexOf(delimiter)
Do Until index < 0
count += 1
index = input.IndexOf(delimiter, index + 1)
Loop
Return count
End Function
////
This functions took in most test twice the time from the one beneath
\\\\\
Public Function Test2(ByVal strInput As String, ByVal strDelimiter _
As String) As Int32 'Jon (string)
Dim iStart As Int32, iCount As Int32, iResult As Int32
iStart = 1
iCount = 0
Do
iResult = InStr(iStart, strInput, strDelimiter)
If iResult = 0 Then Exit Do
iCount += 1
iStart = iResult + 1
Loop
Return iCount
End Function
////


Oh, this one again. See my comments on this from last week at

http://groups.google.com/groups?selm=#[email protected]

Basicly, InStr is only faster than String.IndexOf when you use Option
Compare Binary. And when you do that, the two functions don't work the
same (since String.IndexOf is culture aware), so you're comparing
apples and oranges.


Got any more? We might as well debunk them all at once. :-)



Mattias
 
I haven't experienced any slowness in my IDE (been using VB.NET for 2 yrs.).


Dmitriy Lapshin said:
I'd say one of the VB .NET downsides is its IDE slo-o-o-wness. All my fellow
programmers who use VB .NET are frequently irritated by that they have to
wait for tens of seconds even if they have just pressed the Enter key to add
a comment.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

W.G. Rowland said:
This is personal opinion. Your mileage may vary..

Here's my experience. With some exceptions (others who are deeper into the
languages can expand on this), choice of language is no longer the issue.
.Net and the CLR are the hurdle you're going to need to overcome if you're
making the jump from VB6 (I came from VB5, so I'm dealing with the same
issues..)

The .net languages differences are more syntactical than functionality..
(i.e. for the most part you can do the same things, it's just the format you
use to get there..)

With that in mind my recommendation for you would be VB.Net.. It IS a new
language with a lot of new stuff to learn. It's upside is that the syntax
will be relatively familiar to you, making the transition easier. It also
(for reasons I don't quite understand) has the most complete implementation
of intellisense, which is a godsend in my opinion..

Now if you were coming from Java I'd recommend J#..

And if you were a C++ programmer, I'd recommend C#.. It's not that they're
the same language, just that they're the version of .Net with the most
comfortable syntax. The C++ people may argue with me. The reason I don't
say C++.Net is because I understand it's kind of a hybrid, allowing both
native windows and .Net managed code, but that it's not exactly a pretty or
easy to master implementation..

Would anyone like to expand on, or dis this?

W.G. Rowland
 
Hi Mattias Sjögren.
Basicly, InStr is only faster than String.IndexOf when you use Option
Compare Binary. And when you do that, the two functions don't work the
same (since String.IndexOf is culture aware), so you're comparing
apples and oranges.

???
Apples and oranges, sorry, I thought that had to do with comparing 2
different things.

Basicly you say Instr is faster than String.IndexOf,

I told you I was not arguing about all possibilities, but I can assure you
this ones are with the most used functions in commercial programming.

I will never arguing about using programmes in academic situations.


Cor

..
 
Sure Jay.

The reason is that a lot of the functionality required to design controls is
not included in the runtime component (the design time functionality).

The strategy for building design time components involves creating separate
compilation targets for the same stuff, and changing the references and the
order of the references.

One of the references becomes a compiler warning in C#... but an error in
VB.NET. Bummer. Double bummer because I find every time I start another CF
project, I need to develop a custom control to deal with everything that's
missing functionality wise.


This outlines the process:
http://msdn.microsoft.com/library/en-us/dnnetcomp/html/customctrlscompactfx.asp?frame=true

--

Justin Weinberg
Designing a PrintDocument? Drawing to forms?
Check out GDI+ Architect at www.mrgsoft.com
 
* "Dmitriy Lapshin said:
I'd say one of the VB .NET downsides is its IDE slo-o-o-wness. All my fellow
programmers who use VB .NET are frequently irritated by that they have to
wait for tens of seconds even if they have just pressed the Enter key to add
a comment.

Mhm... I never had to wait tens of seconds...
 
Apples and oranges, sorry, I thought that had to do with comparing 2
different things.

Exactly. The current thread's culture and the invariant culture can
yield different results. And the perf difference you see is due to
caching optimizations that can be done when using the invariant
culture.

Basicly you say Instr is faster than String.IndexOf,

Depends on how you set Option Compare. I'm saying that there's little
point in comparing InStr / Option Compare Binary with String.IndexOf,
since they do things differently.



Mattias
 
Hi Mattias,
Exactly. The current thread's culture and the invariant culture can
yield different results. And the perf difference you see is due to
caching optimizations that can be done when using the invariant
culture.
You mean that if I do find("mattias","mattias") it will be found maybe
nothing?.
(I am never using the find, so maybe the syntax is wrong).

Your words.
Depends on how you set Option Compare. I'm saying that there's little
point in comparing InStr / Option Compare Binary with String.IndexOf,
since they do things differently.

I only compare "Mattias".indexof("Mattias") with Find("Mattias","Mattias")

That is doing the same thing in my opinion with the difference that the
result will be a zero of a one (that is one of the reasons why I do not use
the find).

I said, I had thought they work basicly the same, but the Find seems to do
things differently from the indexof and has more efficient code.

Cor
 
Back
Top