473,763 Members | 7,044 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Interesting VB.NET Intellisense

Hi,

Seems like VB.NET Intellisense and complier does check for method
definitions much. The following code compiles with no errors in VB.NET! (but
of course, trust C# to be strict and perfect :) )

[c#]
public class MyOwnClass
{
public void Print()
{
Console.WriteLi ne("Print");
}
}

static void Main(string[] args)
{
object myObj = new MyOwnClass();
myObj.Print();
}

[VB.NET]
Public Class MyOwnClass
Public Sub Print()
Console.WriteLi ne("Print")
End Sub
End Class

Module Module1

Sub Main()
Dim myObject As Object = New MyOwnClass
myObject.Print( )
End Sub

End Module

I believe i read somehere about VB being dynamin binding or
something....du nno whether this is something to do with it.

--
Rakesh Rajan
Jul 21 '05 #1
10 1438
Sorry...i meant "Seems like VB.NET Intellisense and complier does NOT check
for method definitions much. The following code compiles with no errors in
VB.NET!"....mis sed a NOT :)

"

"Rakesh Rajan" wrote:
Hi,

Seems like VB.NET Intellisense and complier does check for method
definitions much. The following code compiles with no errors in VB.NET! (but
of course, trust C# to be strict and perfect :) )

[c#]
public class MyOwnClass
{
public void Print()
{
Console.WriteLi ne("Print");
}
}

static void Main(string[] args)
{
object myObj = new MyOwnClass();
myObj.Print();
}

[VB.NET]
Public Class MyOwnClass
Public Sub Print()
Console.WriteLi ne("Print")
End Sub
End Class

Module Module1

Sub Main()
Dim myObject As Object = New MyOwnClass
myObject.Print( )
End Sub

End Module

I believe i read somehere about VB being dynamin binding or
something....du nno whether this is something to do with it.

--
Rakesh Rajan

Jul 21 '05 #2
Rakesh,

This is something the people who use VBNet do hate in C#, it has many legacy
restrictions from C and that is needed because it does not use intellisense
in the IDE which can help the programmer with the exeption than that C# is
showing some more information (wherefore is the documenter which is not in
VBNet until 2005).

In VBNet does "object.whateve r" mean by default "object.whateve r()" what it
would be in classic C. What can it be else, however it is checked with
background compiling by the IDE in VBNet, a feature that does not exist in
C#.

When you are talking about binding, than has VBNet two possibilities, with
late binding and early binding.

Late binding can be very effective for modeling however not good for real
production software because it can give unpredicted errors. It is easy to
set in VBNet as a option in the IDE to use always option strict on, and than
it is exactly the same as with C#.

I hope this gives some idea's

(When you translate a language by the way, do than not use the style of code
you are used to by your regular code, the sample you showed from VBNet would
be made by a VBNet programmer much simpler).

Cor
Jul 21 '05 #3
Are you a VB.NETter? ;)
In VBNet does "object.whateve r" mean by default "object.whateve r()" what it
would be in classic C. What can it be else, however it is checked with
background compiling by the IDE in VBNet, a feature that does not exist in
C#.

I don't understand how this feature could be useful - won't this result in
errors that could be easily prevented? For example, if someone misspells a
method name in VB.NET - this would create a run-time exception, whereas this
would be caught @ compile time in C# (much better).

Jul 21 '05 #4
I don't understand how this feature could be useful - won't this result in
errors that could be easily prevented? For example, if someone misspells a
method name in VB.NET - this would create a run-time exception, whereas this would be caught @ compile time in C# (much better).


The errors are catched when typing in the IDE directly with VBNet, The VBNet
IDE corrects as well by instance although not directly needed as well all
cases.

There is one argument that this is not a good method; This checking while
typing cost time, so especially on more older computers the C# way of doing
it is than better.

I hope this makes it even more clear.

For me is this a major reason why I am a VBNetter yes. The language
differences itself are very fair and are not a reason for me.

Cor
Jul 21 '05 #5
I'm a VB.NETter too. I have done some programming in C# but much prefer the
forgiveability (that might not be a real word) of VB. If I misspell a method
then VB will complain to me that the method does not exist. This is because
I have Option Strict On and Option Explicit On.

If I make a mistake in VB the IDE tells me immediately, C# waits for me to
Build.

Now the main reason that I prefer VB is that it is not case sensitive.
mymethod is exactly the same as myMethod and the IDE will automagically
correct the case for me. C# does not and so I have to spend too much time
correcting case (I'm not a touch typist so I look at the keyboard not the
screen).
If I have 2 different variables/methods I would choose to give them
different names rather than different case, since I find it is much easier
to read back.

What's the difference between myvar, myVar and MyVar? Which one am I
referring to in myMethod? Did I really mean to use MyVar when I used myVar?
It may compile just fine but will give me an error which may be hard to
trace. This is the reason that i would not declare variables using
differering case and so I immediately lose the benefit of Case Sensitivity.

There are things about C# that I do like, but overall I much prefer VB.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Rakesh Rajan" <Ra*********@di scussions.micro soft.com> wrote in message
news:01******** *************** ***********@mic rosoft.com...
Are you a VB.NETter? ;)
In VBNet does "object.whateve r" mean by default "object.whateve r()" what
it
would be in classic C. What can it be else, however it is checked with
background compiling by the IDE in VBNet, a feature that does not exist
in
C#.

I don't understand how this feature could be useful - won't this result in
errors that could be easily prevented? For example, if someone misspells a
method name in VB.NET - this would create a run-time exception, whereas
this
would be caught @ compile time in C# (much better).

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.742 / Virus Database: 495 - Release Date: 19/08/2004
Jul 21 '05 #6
All you said are very much true...but I must say that C# is more OOPs-like,
and that makes a significant difference....h mm...is this thread yet another
beginning of the 'language wars'? ;)

"Mick Doherty" wrote:
I'm a VB.NETter too. I have done some programming in C# but much prefer the
forgiveability (that might not be a real word) of VB. If I misspell a method
then VB will complain to me that the method does not exist. This is because
I have Option Strict On and Option Explicit On.

If I make a mistake in VB the IDE tells me immediately, C# waits for me to
Build.

Now the main reason that I prefer VB is that it is not case sensitive.
mymethod is exactly the same as myMethod and the IDE will automagically
correct the case for me. C# does not and so I have to spend too much time
correcting case (I'm not a touch typist so I look at the keyboard not the
screen).
If I have 2 different variables/methods I would choose to give them
different names rather than different case, since I find it is much easier
to read back.

What's the difference between myvar, myVar and MyVar? Which one am I
referring to in myMethod? Did I really mean to use MyVar when I used myVar?
It may compile just fine but will give me an error which may be hard to
trace. This is the reason that i would not declare variables using
differering case and so I immediately lose the benefit of Case Sensitivity.

There are things about C# that I do like, but overall I much prefer VB.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Rakesh Rajan" <Ra*********@di scussions.micro soft.com> wrote in message
news:01******** *************** ***********@mic rosoft.com...
Are you a VB.NETter? ;)
In VBNet does "object.whateve r" mean by default "object.whateve r()" what
it
would be in classic C. What can it be else, however it is checked with
background compiling by the IDE in VBNet, a feature that does not exist
in
C#.

I don't understand how this feature could be useful - won't this result in
errors that could be easily prevented? For example, if someone misspells a
method name in VB.NET - this would create a run-time exception, whereas
this
would be caught @ compile time in C# (much better).

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.742 / Virus Database: 495 - Release Date: 19/08/2004

Jul 21 '05 #7
All you said are very much true...but I must say that C# is more OOPs-like, and that makes a significant difference...


Why just give some examples,

This is not a war however I was almost sure you was missing that part of the
checking of typing in VBNet so that I tried to explain for you.

The first time I used C# (I started with VBNet) I was expecting that it was
there as well. So probably your starting message was because you did not
know that this was in VBNet.

However explain to use why in your opinion C# is more OOP than VBNet, I am
currious about it because it is really again an message we see seldom in
this dotNet newsgroups, even not when people are telling why the one
language is better than the other (what I do not, I am only talking about
the IDE which I prefer).

Cor

Jul 21 '05 #8
How is it more OOP like?
I don't believe that VB is better than C# or vice versa, I just much prefer
VB. Maybe I am swayed by my VBClassic background, but I don't think so.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Rakesh Rajan" <Ra*********@di scussions.micro soft.com> wrote in message
news:1C******** *************** ***********@mic rosoft.com...
All you said are very much true...but I must say that C# is more
OOPs-like,
and that makes a significant difference....h mm...is this thread yet
another
beginning of the 'language wars'? ;)

"Mick Doherty" wrote:
I'm a VB.NETter too. I have done some programming in C# but much prefer
the
forgiveability (that might not be a real word) of VB. If I misspell a
method
then VB will complain to me that the method does not exist. This is
because
I have Option Strict On and Option Explicit On.

If I make a mistake in VB the IDE tells me immediately, C# waits for me
to
Build.

Now the main reason that I prefer VB is that it is not case sensitive.
mymethod is exactly the same as myMethod and the IDE will automagically
correct the case for me. C# does not and so I have to spend too much time
correcting case (I'm not a touch typist so I look at the keyboard not the
screen).
If I have 2 different variables/methods I would choose to give them
different names rather than different case, since I find it is much
easier
to read back.

What's the difference between myvar, myVar and MyVar? Which one am I
referring to in myMethod? Did I really mean to use MyVar when I used
myVar?
It may compile just fine but will give me an error which may be hard to
trace. This is the reason that i would not declare variables using
differering case and so I immediately lose the benefit of Case
Sensitivity.

There are things about C# that I do like, but overall I much prefer VB.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Rakesh Rajan" <Ra*********@di scussions.micro soft.com> wrote in message
news:01******** *************** ***********@mic rosoft.com...
> Are you a VB.NETter? ;)
>
>> In VBNet does "object.whateve r" mean by default "object.whateve r()"
>> what
>> it
>> would be in classic C. What can it be else, however it is checked with
>> background compiling by the IDE in VBNet, a feature that does not
>> exist
>> in
>> C#.
> I don't understand how this feature could be useful - won't this result
> in
> errors that could be easily prevented? For example, if someone
> misspells a
> method name in VB.NET - this would create a run-time exception, whereas
> this
> would be caught @ compile time in C# (much better).
>

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.742 / Virus Database: 495 - Release Date: 19/08/2004

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.742 / Virus Database: 495 - Release Date: 19/08/2004
Jul 21 '05 #9
Cor and Mick,

I feel it's more OOPs like because OOPs started with c++ and c# derives it's
most of it's syntax from c++ and java...most of the keywords map directly
with what OOPs states....with VB.NET, i feel it's more like an 'add-on' to an
existing set of keywords, rather than pure thing u know...

The point i want to bring here is that as C# was developed from scratch
based on OOPs and all, it's seeminlgy very usable.

Don't you feel so?

Rakesh

"Mick Doherty" wrote:
How is it more OOP like?
I don't believe that VB is better than C# or vice versa, I just much prefer
VB. Maybe I am swayed by my VBClassic background, but I don't think so.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Rakesh Rajan" <Ra*********@di scussions.micro soft.com> wrote in message
news:1C******** *************** ***********@mic rosoft.com...
All you said are very much true...but I must say that C# is more
OOPs-like,
and that makes a significant difference....h mm...is this thread yet
another
beginning of the 'language wars'? ;)

"Mick Doherty" wrote:
I'm a VB.NETter too. I have done some programming in C# but much prefer
the
forgiveability (that might not be a real word) of VB. If I misspell a
method
then VB will complain to me that the method does not exist. This is
because
I have Option Strict On and Option Explicit On.

If I make a mistake in VB the IDE tells me immediately, C# waits for me
to
Build.

Now the main reason that I prefer VB is that it is not case sensitive.
mymethod is exactly the same as myMethod and the IDE will automagically
correct the case for me. C# does not and so I have to spend too much time
correcting case (I'm not a touch typist so I look at the keyboard not the
screen).
If I have 2 different variables/methods I would choose to give them
different names rather than different case, since I find it is much
easier
to read back.

What's the difference between myvar, myVar and MyVar? Which one am I
referring to in myMethod? Did I really mean to use MyVar when I used
myVar?
It may compile just fine but will give me an error which may be hard to
trace. This is the reason that i would not declare variables using
differering case and so I immediately lose the benefit of Case
Sensitivity.

There are things about C# that I do like, but overall I much prefer VB.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Rakesh Rajan" <Ra*********@di scussions.micro soft.com> wrote in message
news:01******** *************** ***********@mic rosoft.com...
> Are you a VB.NETter? ;)
>
>> In VBNet does "object.whateve r" mean by default "object.whateve r()"
>> what
>> it
>> would be in classic C. What can it be else, however it is checked with
>> background compiling by the IDE in VBNet, a feature that does not
>> exist
>> in
>> C#.
> I don't understand how this feature could be useful - won't this result
> in
> errors that could be easily prevented? For example, if someone
> misspells a
> method name in VB.NET - this would create a run-time exception, whereas
> this
> would be caught @ compile time in C# (much better).
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.742 / Virus Database: 495 - Release Date: 19/08/2004

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.742 / Virus Database: 495 - Release Date: 19/08/2004

Jul 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2405
by: andrew.queisser | last post by:
Yesterday I typed in some C++ code that called a function with two ints. Intellisense (auto-complete) helpfully told me that the first formal parameter was called "frontLight" and the second "ringLight". It occurred to me that I'm getting some semantic help here on top of the obvious type safety. It seems to me that the existance of this kind of support is tied to the static typing nature of C++. I've always been interested in the...
6
8099
by: Stefan Kronberg | last post by:
I'm working on a solution containing about 20 projects. Some of the projects contain class definitions that are used in other of the projects. Most of the time intellisense is working ok, i.e. if I work with objects declared from my own classes intellisense will show me all alternatives (methods and properties from my classes and from the classes they are derived from). But sometimes I will get nothing from intellisense, completely nothing,...
1
2212
by: Christopher W. Douglas | last post by:
I'm working in VB.Net, using Visual Studio 2003. I have a project, let's call it Foo, that contains common methods, forms, and objects I use in other projects. It compiles as Foo.dll, which I then reference from the project that needs it. Let's say I have a method, Bar, that I want to access from another project. If I add a public module Methods to Foo, and add a public method Bar to Methods, I can call it from my other project a...
1
1896
by: Yaron | last post by:
Hi, I have a custom ListView-type control that I designed a few months ago. The control is completely stable and functional. However, often, the Visual Studio .NET IDE's Intellisense will lose and not display members not contained inside of Control (which my control is inherited from). Despite this, program execution still works fine; Intellisense just stops displaying these members, is all. If I close down Visual Studio and open it again,...
1
262
by: Rakesh Rajan | last post by:
Hi, Seems like VB.NET Intellisense and complier does check for method definitions much. The following code compiles with no errors in VB.NET! (but of course, trust C# to be strict and perfect :) ) public class MyOwnClass { public void Print()
12
4836
by: Peteroid | last post by:
I was creating my application just fine for the last 3 weeks or so. Then, starting this morning, IntelliSense seems to be having problems. It goes into a locked 'Updating IntelliSense..." mode. When this happens its time to close VS C++.NET, which can only be done via the Windows Task Manager. I tried repairing C++. It did seem to help, but the problem is back a few hours later. I will try creating a new project, copy over source files,...
5
3247
by: wal | last post by:
Hello, I'm using __declspec(property) to access get/set methods as properties (like in C# and VB.NET). Now, the problem is that both the property name and the get/set methods show in the intellisense list. Is there anyway to remove the names of the get/set methods from the intellisense list? Here's an example, I have two methods, one is a get method with the name getText and another set method with the name setText, the name of the...
11
2217
by: kimiraikkonen | last post by:
Hi there, I needed to use MouseOver event on Webbrowser which is NOT provided by webbrowser control natively(what a disappointment), so i decided to go with another route to simulate this like: //////////////////////////////////////////////// Public Sub DisplayHyperlinks(ByVal sender As Object, ByVal e As System.Windows.Forms.HtmlElementEventArgs)
3
340
by: Travis | last post by:
Hi, I was a user of Visual C# for a while and have gotten used to the Intellisense for that program. I went to try Visual Basic, and the intellisense is so much different. I'll try to make an example: Say I want to write: MessageBox.Show("Hi there") In C#, once I type just a single "M," everything (objects, classes, everything) that begins with M will appear in the intellisense list. Once you get to "Mes" MessageBox will be selected...
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10144
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9997
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9937
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8821
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.