Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: VB Language Question Answered


Message #1 by "Scott Guthrie" <scottgu@m...> on Thu, 22 Mar 2001 09:19:40 -0800
Origional Question:

---------------------------------------------



marcelo@m... asks:



I=B4m a development team leader of Visual Studio and others Microsoft

technologies. I am concerned about the new VB.NET. Some articles

describes

VB.NET as a totally new language. It's difficult to trainning people

quickly to absorve new technologies. I would like to receive your

opinion

and more information about .NET plataform.



ScottGu Answer:

---------------------------------------------



Hi Marcelo,



VB.NET is a significant language overhaul of the VB language that

shipped in VB6.  The VB team has spent some quality time trying to clean

up and simplify the language -- trying to ensure that it appeals to

people for a long time going forward.



Some people have expressed concern over some of these language changes

-- because change of any type is often scary.  While I think this is a

valid concern (especially when you have a large body of code that needs

to be updated), I think the thing to keep in mind is that doing these

changes now -- while requiring a few hours of learning costs -- will end

up simplifying the concepts needed to become a proficient VB programmer

(because the language is more consistent and has fewer special case

exceptions to master). 



A specific example of this I can think of:  In classic VB there was the

difference of "Set", "Let" and "Straight-forward" variable assignment



	Dim x

	Dim y



	x =3D 5

	Set y =3D Server.CreateObject("ADODB.Connection")



In the above code "x" was set directly (no set) because it was a

non-object assignment.  "y" required a Set statement (because the

variable was an object) to avoid a runtime error.  Most VB and ASP

programmers I've encountered (including myself when I use VB!) never get

these always straight.



With VB.NET, developers can simply say:



	Dim x

	Dim y



	x =3D 5

	y =3D Server.CreateObject("ADODB.Connection")



One consistent way to do variable assignment -- not set/let ever

required.



Cleaning up a lot of the VB language inconcistencies will hopefully

lower the training cost of your development team going forward -- as

well as significantly lower the bar required for new programmers to get

started with the platform.



Hope this helps,



Scott



Message #2 by "Samuel Engelman" <samuel_engelman@p...> on Thu, 22 Mar 2001 15:24:42 -0500
Is this dim statement  correct?



Dim x



Does it not have to be



Dim x as <Object>?







"Scott Guthrie" <scottgu@m...>

Thursday March 22, 2001 12:19 PM



Please respond to "ASP+" <aspx@p...>

To:   "ASP+" <aspx@p...>

cc:

Subject:  [aspx] VB Language Question Answered





Origional Question:

---------------------------------------------



marcelo@m... asks:



I=B4m a development team leader of Visual Studio and others Microsoft

technologies. I am concerned about the new VB.NET. Some articles

describes

VB.NET as a totally new language. It's difficult to trainning people

quickly to absorve new technologies. I would like to receive your

opinion

and more information about .NET plataform.



ScottGu Answer:

---------------------------------------------



Hi Marcelo,



VB.NET is a significant language overhaul of the VB language that

shipped in VB6.  The VB team has spent some quality time trying to clea

n

up and simplify the language -- trying to ensure that it appeals to

people for a long time going forward.



Some people have expressed concern over some of these language changes

-- because change of any type is often scary.  While I think this is a

valid concern (especially when you have a large body of code that needs



to be updated), I think the thing to keep in mind is that doing these

changes now -- while requiring a few hours of learning costs -- will en

d

up simplifying the concepts needed to become a proficient VB programmer



(because the language is more consistent and has fewer special case

exceptions to master).



A specific example of this I can think of:  In classic VB there was the



difference of "Set", "Let" and "Straight-forward" variable assignment



     Dim x

     Dim y



     x =3D 5

     Set y =3D Server.CreateObject("ADODB.Connection")



In the above code "x" was set directly (no set) because it was a

non-object assignment.  "y" required a Set statement (because the

variable was an object) to avoid a runtime error.  Most VB and ASP

programmers I've encountered (including myself when I use VB!) never ge

t

these always straight.



With VB.NET, developers can simply say:



     Dim x

     Dim y



     x =3D 5

     y =3D Server.CreateObject("ADODB.Connection")



One consistent way to do variable assignment -- not set/let ever

required.



Cleaning up a lot of the VB language inconcistencies will hopefully

lower the training cost of your development team going forward -- as

well as significantly lower the bar required for new programmers to get



started with the platform.



Hope this helps,



Scott



Message #3 by "Scott Guthrie" <scottgu@m...> on Thu, 22 Mar 2001 12:39:14 -0800
Hi Samuel,



VB.NET continues to support both late-bound and early-bound modes of

operation.  If you use Option Explicit -- then you must declare the

variable, but don't have to declare the type.  For example, the below

code will work fine:



   Dim x

   x =3D 5



If you use Option Strict -- then you must declare both the variable and

the type.  The above code would cause an error in this case. Instead

you'd need to write:



   Dim x as Integer

   x =3D 5



If you set Option None -- then you don't even have to declare the

variable.  Instead you can just write:



   x =3D 5



ASP.NET's default out of the box setting in Beta2 will be "Option

Explicit".  Meaning you must declare the variable -- but don't have to

declare the type (although it is recommended that you do):



   Dim x

   x =3D 5



You can change ASP.NET to require Option Strict by adding a page

directive at the top of your .aspx file:



   <%@ Page Language=3D"VB" Explicit=3D"true" Strict=3D"true" %>



Hope this helps,



Scott



-----Original Message-----

From: Samuel Engelman [mailto:samuel_engelman@p...]

Sent: Thursday, March 22, 2001 12:25 PM

To: ASP+

Subject: [aspx] Re: VB Language Question Answered





Is this dim statement  correct?



Dim x



Does it not have to be



Dim x as <Object>?







"Scott Guthrie" <scottgu@m...>

Thursday March 22, 2001 12:19 PM



Please respond to "ASP+" <aspx@p...>

To:   "ASP+" <aspx@p...>

cc:

Subject:  [aspx] VB Language Question Answered





Origional Question:

---------------------------------------------



marcelo@m... asks:



I=B4m a development team leader of Visual Studio and others Microsoft

technologies. I am concerned about the new VB.NET. Some articles

describes

VB.NET as a totally new language. It's difficult to trainning people

quickly to absorve new technologies. I would like to receive your

opinion

and more information about .NET plataform.



ScottGu Answer:

---------------------------------------------



Hi Marcelo,



VB.NET is a significant language overhaul of the VB language that

shipped in VB6.  The VB team has spent some quality time trying to clean

up and simplify the language -- trying to ensure that it appeals to

people for a long time going forward.



Some people have expressed concern over some of these language changes

-- because change of any type is often scary.  While I think this is a

valid concern (especially when you have a large body of code that needs

to be updated), I think the thing to keep in mind is that doing these

changes now -- while requiring a few hours of learning costs -- will end

up simplifying the concepts needed to become a proficient VB programmer

(because the language is more consistent and has fewer special case

exceptions to master).



A specific example of this I can think of:  In classic VB there was the

difference of "Set", "Let" and "Straight-forward" variable assignment



     Dim x

     Dim y



     x =3D 5

     Set y =3D Server.CreateObject("ADODB.Connection")



In the above code "x" was set directly (no set) because it was a

non-object assignment.  "y" required a Set statement (because the

variable was an object) to avoid a runtime error.  Most VB and ASP

programmers I've encountered (including myself when I use VB!) never get

these always straight.



With VB.NET, developers can simply say:



     Dim x

     Dim y



     x =3D 5

     y =3D Server.CreateObject("ADODB.Connection")



One consistent way to do variable assignment -- not set/let ever

required.



Cleaning up a lot of the VB language inconcistencies will hopefully

lower the training cost of your development team going forward -- as

well as significantly lower the bar required for new programmers to get

started with the platform.



Hope this helps,



Scott





---

SoftArtisans helps developers build robust, scalable Web applications!

Excel Web reports, charts: http://www.softartisans.com/excelwriter.html

File uploads: http://www.softartisans.com/saf.html

Transactional file management: http://www.softartisans.com/saf1.html

Scalability: http://www.softartisans.com/saxsession.html

ASPstudio value pack: http://www.softartisans.com/aspstudiosuite.html







  Return to Index