473,725 Members | 2,271 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What C# Needs

Having developed with VB since 1992, I am now VERY
interested in C#. I've written several applications with
C# and I do enjoy the language.

What C# Needs:

There are a few things that I do believe MSFT should do to
improve C#, however.

I know that in the "Whidbey" release of VS.NET currently
under development, VB.NET will get good ole "edit-and-
continue" back. Hurray! What's unfortunate (and correct
me if I'm wrong) is that C# developers won't enjoy this
feature. This is very unfortunate because THAT feature
should exist in ALL programming languages.

Another thing that C# needs is better intellisense (as
good as vb.net). I've found a few instances where I hit
ctrl+spacebar and nothing happens in C#. I write the SAME
exact piece of code in VB.NET and hit ctrl+spacebar and
the intellisense pops up just fine.

It's not like C# developers don't want to have these nice
visual and functional features enjoyed by VBers available
to them if they "choose" to use them. Keep in mind the
word "choose". Don't FORCE developers to have to use
these features. Allow them to disable or enable them as
needed. It's ONE development environment folks, why can't
all .NET languages using that dev env benefit?
Nov 15 '05 #1
46 4228
Keith K <kp******@linux mail.org> wrote:
Having developed with VB since 1992, I am now VERY
interested in C#. I've written several applications with
C# and I do enjoy the language.

What C# Needs:


<snip>

Neither of these are C# suggestions - they're "Visual C#" or "Visual
Studio .NET" suggestions. Last I heard, E&C wasn't ruled out for
Whidbey anyway - not sure about the Intellisense improvements you're
after.

Personally, there are things I'd rather see in the *language* (and
attributes which the C# compiler should recognise) such as:

o Explicit control over beforefieldinit
o Properties with separate access/mutate protection levels (I believe
we're getting this)
o Variables declared within properties, which then can't be accessed
by other methods (except possibly where there's a new attribute
specified, eg AccessPropertyF ields, to allow easier serialization)
o Possibly an attribute to be specified on the derived class which
would tell the compiler to effectively "inherit" the constructors
from the base class (ie automatically provide stub versions which
just call the base version)

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #2
-----Original Message-----
Jon Skeet <sk***@pobox.co m> wrote:
Personally, there are things I'd rather see in the *language* (and attributes which the C# compiler should recognise) such
as:
<snip>

Oh, and also some way of accessing named indexers (and preferrably anicer way of naming them, too). Generics will make this slightly lessimportant, but it's still not terribly easy to provide an efficient,type safe, read-only indexer.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
.


You are correct. There are a number of improvements that
could be added to the language. My suggestions were
mainly centered around the IDE. Really, I just don't see
why any IDE, compiler, and debugger, etc. enhancements
should be "language" specific. If ONE language benefits,
then ALL languages should benefit as well.
Nov 15 '05 #3

"Jon Skeet" <sk***@pobox.co m> wrote in message
news:MP******** *************** *@news.microsof t.com...
Keith K <kp******@linux mail.org> wrote:
<some snippage here...>
o Explicit control over beforefieldinit
o Properties with separate access/mutate protection levels (I believe
we're getting this)
According to a dev chat, that is correct - we are getting this (about time!)
:-)
Chalk one up to old VB, which actually did this correctly.
I believe you can find the transcript at either msdn.com or csharp.net.
o Variables declared within properties, which then can't be accessed
by other methods (except possibly where there's a new attribute
specified, eg AccessPropertyF ields, to allow easier serialization)
I'm not sure I understand this properly. I mean, local variables can't be
accessed by other methods as it is, and how does this affect serialization.
There might be something interesting here, so i'm curious :-)
o Possibly an attribute to be specified on the derived class which
would tell the compiler to effectively "inherit" the constructors
from the base class (ie automatically provide stub versions which
just call the base version)
Well, there's been a lot of this kind of talk over other OOP languages, and
all I can say is that it starts language civel wars :-)
There are some legit reasons why constructors aren't inherited and
overridable (well, no inheritance means no overridable by definition i
suppose).
Personally, I wouldn't mind seeing constructors being part of the interface,
so you can do things like properly mandate constructor signatures when they
are absolutely required (like for serialization - ISerializable, as an
example).

-Rob [MVP]
--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

Nov 15 '05 #4
-----Original Message-----
Jon Skeet <sk***@pobox.co m> wrote:
Personally, there are things I'd rather see in the *language* (and attributes which the C# compiler should recognise) such
as:
<snip>

Oh, and also some way of accessing named indexers (and preferrably anicer way of naming them, too). Generics will make this slightly lessimportant, but it's still not terribly easy to provide an efficient,type safe, read-only indexer.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
.


You are correct. There are a number of improvements that
could be added to the language. My suggestions were
mainly centered around the IDE. Really, I just don't see
why any IDE, compiler, and debugger, etc. enhancements
should be "language" specific. If ONE language benefits,
then ALL languages should benefit as well.
Nov 15 '05 #5
You know what i want? A way to define parameterized properties in general!!
Let's think about this for a moment...

If I write the following:

[System.Compil.. (insert namespace here depending on FW
version)...Inde xerName("MyInde xer")]
public string this [int Index]
{
get { } // get the string from a list here
set { } // set the string to list here
}

What I *really* get in IL, is a function explicitly named "get_MyIndexer" ,
with the [DefaultMember] attribute on it, and an int parameter. It's
basically a method that has special type bits calling it a "property" for
the sake of the consumer code (and don't get me wrong, I love the idea of
separating the concept of a "property" from a method *hinthint for the J
language by the OTHER company).

Ironically, the VB .NET prototype actually has code that's closer to what
actually happens in the IL -

Public Default Property MyIndexer ( ByVal Index As Integer ) As String

The cool thing about the VB syntax is that it allows parameterized
non-indexer (non default members) properties. It also allows you to specify
more than just one indexer on the class (I'd rather like to think of it as
multiple parameterized properties instead of multiple indexers actually). Of
course, it also helps that VB uses ( ) for both param lists and array index
specifiers, whereas C(#)(++) uses [ ] for one and ( ) for the other.

-Rob [MVP]

"Jon Skeet" <sk***@pobox.co m> wrote in message
news:MP******** *************** *@news.microsof t.com...
Jon Skeet <sk***@pobox.co m> wrote:
Personally, there are things I'd rather see in the *language* (and
attributes which the C# compiler should recognise) such as:


<snip>

Oh, and also some way of accessing named indexers (and preferrably a
nicer way of naming them, too). Generics will make this slightly less
important, but it's still not terribly easy to provide an efficient,
type safe, read-only indexer.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

Nov 15 '05 #6

"Jon Skeet" <sk***@pobox.co m> wrote in message
news:MP******** *************** *@news.microsof t.com...
Keith K <kp******@linux mail.org> wrote:
<some snippage here...>
o Explicit control over beforefieldinit
o Properties with separate access/mutate protection levels (I believe
we're getting this)
According to a dev chat, that is correct - we are getting this (about time!)
:-)
Chalk one up to old VB, which actually did this correctly.
I believe you can find the transcript at either msdn.com or csharp.net.
o Variables declared within properties, which then can't be accessed
by other methods (except possibly where there's a new attribute
specified, eg AccessPropertyF ields, to allow easier serialization)
I'm not sure I understand this properly. I mean, local variables can't be
accessed by other methods as it is, and how does this affect serialization.
There might be something interesting here, so i'm curious :-)
o Possibly an attribute to be specified on the derived class which
would tell the compiler to effectively "inherit" the constructors
from the base class (ie automatically provide stub versions which
just call the base version)
Well, there's been a lot of this kind of talk over other OOP languages, and
all I can say is that it starts language civel wars :-)
There are some legit reasons why constructors aren't inherited and
overridable (well, no inheritance means no overridable by definition i
suppose).
Personally, I wouldn't mind seeing constructors being part of the interface,
so you can do things like properly mandate constructor signatures when they
are absolutely required (like for serialization - ISerializable, as an
example).

-Rob [MVP]
--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

Nov 15 '05 #7
You know what i want? A way to define parameterized properties in general!!
Let's think about this for a moment...

If I write the following:

[System.Compil.. (insert namespace here depending on FW
version)...Inde xerName("MyInde xer")]
public string this [int Index]
{
get { } // get the string from a list here
set { } // set the string to list here
}

What I *really* get in IL, is a function explicitly named "get_MyIndexer" ,
with the [DefaultMember] attribute on it, and an int parameter. It's
basically a method that has special type bits calling it a "property" for
the sake of the consumer code (and don't get me wrong, I love the idea of
separating the concept of a "property" from a method *hinthint for the J
language by the OTHER company).

Ironically, the VB .NET prototype actually has code that's closer to what
actually happens in the IL -

Public Default Property MyIndexer ( ByVal Index As Integer ) As String

The cool thing about the VB syntax is that it allows parameterized
non-indexer (non default members) properties. It also allows you to specify
more than just one indexer on the class (I'd rather like to think of it as
multiple parameterized properties instead of multiple indexers actually). Of
course, it also helps that VB uses ( ) for both param lists and array index
specifiers, whereas C(#)(++) uses [ ] for one and ( ) for the other.

-Rob [MVP]

"Jon Skeet" <sk***@pobox.co m> wrote in message
news:MP******** *************** *@news.microsof t.com...
Jon Skeet <sk***@pobox.co m> wrote:
Personally, there are things I'd rather see in the *language* (and
attributes which the C# compiler should recognise) such as:


<snip>

Oh, and also some way of accessing named indexers (and preferrably a
nicer way of naming them, too). Generics will make this slightly less
important, but it's still not terribly easy to provide an efficient,
type safe, read-only indexer.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

Nov 15 '05 #8
I agree. Never quite felt the urge to use something like that. In addition,
you lose the ability to have the variable placed on the stack since it's a
field, so you have to deal with the heap (which is faster in .NET, but
still...) and you have to deal with threading issues (multiple threads
coming into the property and using the same
field-that-pretends-to-be-a-local).
I'm not getting a good feeling from this idea. The field would also have to
automatically be thread-static then.

-Rob [MVP]
"Mattias Sjögren" <ma************ ********@mvps.o rg> wrote in message
news:OL******** ******@TK2MSFTN GP12.phx.gbl...
Rob,
o Variables declared within properties, which then can't be accessed
by other methods (except possibly where there's a new attribute
specified, eg AccessPropertyF ields, to allow easier serialization)


I'm not sure I understand this properly. I mean, local variables can't be
accessed by other methods as it is, and how does this affect serialization.There might be something interesting here, so i'm curious :-)


I'm guessing that Jon is asking for something like

int MyProp {
int i;
get { ... }
set { ... }
}

i would compile down to a field, but the compiler would restrict its
scope to the MyProp accessor methods. Much like how the VB.NET
compiler handles Static locals. That's why you'd have to be able to
control serialization of it.

Personally I've never felt I needed this, and I'm not sure if it's a
good idea. I think it would just cause confusion, having something
that looks like a local but that has the lifetime of a field.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.

Nov 15 '05 #9
I agree. Never quite felt the urge to use something like that. In addition,
you lose the ability to have the variable placed on the stack since it's a
field, so you have to deal with the heap (which is faster in .NET, but
still...) and you have to deal with threading issues (multiple threads
coming into the property and using the same
field-that-pretends-to-be-a-local).
I'm not getting a good feeling from this idea. The field would also have to
automatically be thread-static then.

-Rob [MVP]
"Mattias Sjögren" <ma************ ********@mvps.o rg> wrote in message
news:OL******** ******@TK2MSFTN GP12.phx.gbl...
Rob,
o Variables declared within properties, which then can't be accessed
by other methods (except possibly where there's a new attribute
specified, eg AccessPropertyF ields, to allow easier serialization)


I'm not sure I understand this properly. I mean, local variables can't be
accessed by other methods as it is, and how does this affect serialization.There might be something interesting here, so i'm curious :-)


I'm guessing that Jon is asking for something like

int MyProp {
int i;
get { ... }
set { ... }
}

i would compile down to a field, but the compiler would restrict its
scope to the MyProp accessor methods. Much like how the VB.NET
compiler handles Static locals. That's why you'd have to be able to
control serialization of it.

Personally I've never felt I needed this, and I'm not sure if it's a
good idea. I think it would just cause confusion, having something
that looks like a local but that has the lifetime of a field.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.

Nov 15 '05 #10

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

Similar topics

0
1517
by: Donald 'Paddy' McCarthy | last post by:
So, for those that don't actively not-want a Python macro facility. If we are to have it what should it do? 1) Macro definitions should allow Doc strings. 2) There should be a separate statement to import Macro definitions from another file. 3) Existing import of a module file containing module definitions should NOT cause the module files macros to be 'active' in the file that is importing. A new macro import command would be needed...
2
3090
by: Martin Danielson | last post by:
Hello. I've been testing the WScript.Shell object and the Run command now for a server query. The file I am running generates a file with the server querys which i later on parse in my page. But there is a problem. When running the Run command om my Windows XP machine it all seems fine. But when trying to run it on my webserver (not configured by myself) I get an error, or the command fails. It's nothing wrong with the acctuall command but...
1
290
by: BStorm | last post by:
We have an application that is using .NET Crystal Reports. However, doing an XCOPY of this application to a client machine does not seem to work. What needs to be included?
5
1961
by: djake | last post by:
Someone can explain me what are makefiles useful for? Couldn't i write shell script instead of makefiles? (*.sh in unix; *.cmd in win32) Moreover i really doesn't understand what dependencies are useful for? Except when i need to compile different files with different compile options, i doesn't need to declare explicitly dependecies. Infact the compiler already find dependecies looking for header files included into the sources. Can...
35
3338
by: GTO | last post by:
I do not believe that C# is the future of C++. I also do not believe that adding two thousand new library functions to the standard library is the future of C++. But what is the future of C++? Is it as good as a programming language can get? Like so many of you, I programmed speech recognizers, image recognition systems, a portion of a chess program, lots of numeric code using STL, and tons of other applications in C++, (even firmware...
0
1216
by: Darin Browne | last post by:
I found the following email validation code in the newsgroup and it works great except it won't allow a dash in the name. I do not understand regular expressions so I'm unsure of how to fix it. Can someone who understands regular expressions tell me what needs to be changed to allow a dash in the email name public static bool IsValidEmailAddress(string sEmail if (sEmail == null return false
3
2052
by: Ben Becker | last post by:
I am trying to build a custom crosstab type of grid where I take some items in a data grid and based on the content of the current item compared to the previous item, determine if a new row in a table should be created or not. In order to do this, I need to have full control over the conditional logic for how items get displayed within a repeater element which I'm not seeing as possible. How can I cursor through a data set, apply...
5
1063
by: Oscar | last post by:
After that I've build a VB.NET/ASP.NET Webapplication in VS 2003 I want to install it at a webserver. Are there additional licence requirements besides the MS 2003 Server Operating system?
5
2952
by: HotRod | last post by:
I am new to this so please go easy. We currently have some students doing some work on some web based tracking documents for us. They are currently using VB .net to develop what we requested. Anyway I've been calling my local ISP's and no one supports .net it seems to be all apache and MySQL. I'm wondering if everyone here can answer a few questions. 1) Can I run vb .net web pages on a regular IIS server without the .net extensions? 2)...
2
1621
by: stargate03 | last post by:
Hi there I have a MYSQL database which has the following table CREATE TABLE `#__content` ( `id` int(11) unsigned NOT NULL auto_increment, `title` varchar(100) NOT NULL default '', `title_alias` varchar(100) NOT NULL default '', `introtext` mediumtext NOT NULL,
0
8884
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
8749
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
9252
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
9168
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
8084
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...
1
6700
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6009
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
4508
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...
1
3217
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.