473,796 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Microsoft should have simplified properties

If you aare going to change the entire Basic language in a new distribution
the least Microsoft coulds have done for VBers is give us a new simplified
syntax. I have seen many cases in VB.net where they seem to have had "no
insightfullness " into these considerations.

Their implementation of the property for example is gaudy at best:
Property Name(ByVal Value As String) As String
Get
Return m_sName
End Get
Set(ByVal Value As String)
m_sName = Value
End Set
End Property

When it would have been so much more intuitive to simply use the following:

Property Name(ByVal Value As String) As String
Get Return m_sName
Set m_sName = Value
End Property
--
-----------------------------
Name: James Allen Bressem
Phone: (323) 691-4279
Email: 18*****@SprintM ail.Com
UCOM: http://www.ucom-ism.com
Mirror site: http://www.geocities.com/wizardofwizards
-----------------------------



Nov 20 '05 #1
3 1401
Cor
Hi James

When it would have been so much more intuitive to simply use the following:
Property Name(ByVal Value As String) As String
Get Return m_sName
Set m_sName = Value
End Property


A matter of taste, maybe.

I don't like
If a = b then a = c
either

It confuse me always I wish they had never made it posible.

And the IDE makes it automaticly for you.

Just a thought

Cor
Nov 20 '05 #2
Well James, your example is very simple. What if there was more than one
line of code in your property ? Lets say you validated the input value
before you set the private variable ??

If you have simple properties and don't like the ugly syntax then I would
suggest that you use 'Fields'.
Nov 20 '05 #3
James,
You do realize that you just defined an indexed property? :-)
Property Name(ByVal Value As String) As String
Your sample should be: Their implementation of the property for example is gaudy at best:
Property Name() As String
Get
Return m_sName
End Get
Set(ByVal Value As String)
m_sName = Value
End Set
End Property
which supports defining an indexed property: Property Name(ByVal index As Integer) As String
Get
Return m_sName(index)
End Get
Set(ByVal Value As String)
m_sName(index) = Value
End Set
End Property
To support indexed properties the shorted syntax would need to be:
Property Name() As String
Get Return m_sName
Set m_sName = Value
End Property
Where "Value" is a known parameter similiar to how it is in C#.

which allows, defining an indexed property, such as:
Property Name(ByVal index As Integer) As String
Get Return m_sName(index)
Set m_sName(index) = Value
End Property
Of course supporting a short form of a property may lead us to short forms
of Functions & Subs! (Similar to the QBasic DEF FN statement)

Function CalculateTax(By val income As Decimal) As Decimal = income *
1.10 / .1

Sub DoSomething() = Call SomethingElse()

Of course the short version of the Function may get more use then the short
form of the Sub.

If they do support the short forms, I hope you will agree they need to
continue supporting the long forms! As Cor pointed out there is a short form
of the If statement as well as the long form. And as Nice Chap pointed out
there is a need for the long forms.

Personally I don't think I would ever use the shortened syntax, if it was
available, just like I rarely use the short form of the If statement. I do
however see some marginal benefit in the short form.

I don't remember if C# defined "Value" to be a keyword or not, which is
another consideration in supporting shorted syntax

If you feel strongly about the suggestion, you can always submit something
to MS Wish.

http://register.microsoft.com/mswish/suggestion.asp

BTW: The above statements are not intended to sound as if I am mocking you,
I agree there is some marginal benefit in a short form. Whether the "juice
is worth the squeeze" is a different matter. Is there enough "bang for the
buck" to have the compiler team add short form properties, or should the
team spend their time in other areas, such as generics & overloading
operators? Personally I would prefer generics & overloading operators.

Hope this helps
Jay

"James Allen Bressem" <18*****@Sprint Mail.Com> wrote in message
news:eP******** ******@tk2msftn gp13.phx.gbl... If you aare going to change the entire Basic language in a new distribution the least Microsoft coulds have done for VBers is give us a new simplified
syntax. I have seen many cases in VB.net where they seem to have had "no
insightfullness " into these considerations.

Their implementation of the property for example is gaudy at best:
Property Name(ByVal Value As String) As String
Get
Return m_sName
End Get
Set(ByVal Value As String)
m_sName = Value
End Set
End Property

When it would have been so much more intuitive to simply use the following:
Property Name(ByVal Value As String) As String
Get Return m_sName
Set m_sName = Value
End Property
--
-----------------------------
Name: James Allen Bressem
Phone: (323) 691-4279
Email: 18*****@SprintM ail.Com
UCOM: http://www.ucom-ism.com
Mirror site: http://www.geocities.com/wizardofwizards
-----------------------------



Nov 20 '05 #4

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

Similar topics

3
1690
by: Stephan Kurpjuweit | last post by:
Hi! I am looking for a simplified Docbook XML schema. As far as I know, "Simplified Docbook" only exists as DTD, right? Could you please send me pointers or ideas that might be useful for me? Thank you! Stephan
6
22274
by: Zhang Weiwu | last post by:
Hello. I am working with a php software project, in it (www.egroupware.org) Chinese simplified locate is "zh" while Traditional Chinese "tw". I wish to send correct language attribute in http header, I found "zh" is not standard. I found this line in apache2's default httpd.conf # Simplified Chinese (zh-CN) AddLanguage zh-CN .zh-cn
99
6249
by: Jim Hubbard | last post by:
It seems that Microsoft not only does not need the classic Visual Basic developer army (the largest army of developers the world has ever seen), but now they don't need ANY Windows developer at a small or mid-sized business. http://groups-beta.google.com/group/microsoft.public.msdn.general/browse_thread/thread/9d7e8f9a00c1c7da/459ca99eb0e7c328?q=%22Proposed+MSDN+subscription+changes%22&rnum=1#459ca99eb0e7c328 Damn! To be that...
182
7561
by: Jim Hubbard | last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
1
1013
by: PaulieS | last post by:
Hi all. Am migrating a customer from IIS5 on W2K server to IIS6 on W2K3. Zipped all the websites and unzipped them to the identical locations on new server. Used IISMT to migrate metabase. Got this error when I tried to run a very basic page... code: <%@ LANGUAGE=vbscript %> <%
0
1685
by: george_Martinho | last post by:
It seems that the ASP.NET Microsoft team didn't think about this!! The profilemanager class has the following methods: - DeleteInactiveProfiles. Enables you to delete all profiles older than a specified date. - DeleteProfile. Enables you to delete a profile associated with a specified username. - DeleteProfiles. Enables you to delete a set of profiles. - FindInactiveProfilesByUserName. Returns a collection of ProfileInfo
0
2240
by: Massimiliano Polito | last post by:
It seems the option '/useenv' is no longer supported in in Microsoft Visual .NET 2005. If I run 'devenv /?' I get the following: ------------------------ Microsoft (R) Visual Studio Version 8.0.50727.42. Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Use: devenv
4
1933
by: Mukesh | last post by:
Hi I m using microsoft application blocks Enterprise Library june 2005 with .net framework 1.1 and VStudio2003 And C# as coding language Sql server 2000 database the project is running properly on the localhost server but my online server does not have the ms Ent lib installed and also de\oes not have visual studio that simply a .net 1.1 installed on that.
3
1737
by: Mukesh | last post by:
Thx Sloan for the solution. It is working properly under Full trust When i tried it under Medium trust it was giving error Parser Error Message: Required permissions cannot be acquired. :::::::::: Source Error:
0
9680
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
10455
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...
1
10173
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
10006
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9052
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
6788
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
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.