-
May 21st, 2009, 05:10 AM
#16
Re: Difference between c#.net and VB.net
You mean:
List <string> list = new List <string> ();
list [5] = "I'm an indexed property";
www.monotorrent.com For all your .NET bittorrent needs
NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.
-
May 21st, 2009, 05:15 AM
#17
Re: Difference between c#.net and VB.net
perhaps some day they will be as cool as indexed properties in C++/CLI which I miss in C#, they are replaced with get_Something and set_Something methods
win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming
remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation
private lessons are not an option so please don't ask for help in private, I won't replay
if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know
-
May 21st, 2009, 07:19 AM
#18
Re: Difference between c#.net and VB.net
some day they will be as cool as indexed properties in C++/CLI which I miss in C#
What is the difference between C++ indexed properties and C# indexed properties?
www.monotorrent.com For all your .NET bittorrent needs
NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.
-
May 21st, 2009, 07:26 AM
#19
Re: Difference between c#.net and VB.net
a C# class can have only one indexed property, the "this", whereas a C++/CLI class can have multiple indexed properties that can have any name
win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming
remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation
private lessons are not an option so please don't ask for help in private, I won't replay
if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know
-
May 21st, 2009, 07:32 AM
#20
Re: Difference between c#.net and VB.net
Originally Posted by Mutant_Fruit
You mean:
Code:
List <string> list = new List <string> ();
list [5] = "I'm an indexed property";
No, that's an indexer.
I mean:
Code:
...
private:
array<String^>^ myNames;
public:
property String^ Name[int]
{
String^ get(int index)
{
return myNames[index];
}
void set(int index, String^ value)
{
myNames[index] = value;
}
}
...
// Usage:
String^ name = obj->Name[3];
In C# that could have looked something like:
Code:
...
private String[] myNames;
public String Name[int]
{
get
{
return myNames[index];
}
set
{
myNames[index] = value;
}
}
...
// Usage:
String name = obj.Name[3];
Last edited by Zaccheus@Work; May 21st, 2009 at 08:09 AM.
-
May 21st, 2009, 07:35 AM
#21
Re: Difference between c#.net and VB.net
you have forgotten:
Originally Posted by Zaccheus@Work
Code:
property String^ Name[int]
{
...
}
win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming
remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation
private lessons are not an option so please don't ask for help in private, I won't replay
if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know
-
May 21st, 2009, 08:04 AM
#22
Re: Difference between c#.net and VB.net
You are right, I've edited my post!
-
May 21st, 2009, 09:41 AM
#23
Re: Difference between c#.net and VB.net
Ah, very nice. I didn't realise that was possible in C++/CLI. I thought you were just referring to the regular indexer by a different name
www.monotorrent.com For all your .NET bittorrent needs
NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.
-
April 26th, 2013, 01:37 AM
#24
Re: Difference between c#.net and VB.net
Ok people that bash on vb.net has not even looked into vb since the vb6 days. Those people can stay in their c# world and continue to look real dumb. C# and vb.net are almost the same. You can do almost the same things in c# and vb.net. My advice is to learn them both. Tired of hearing the old heads bash vb.net.
-
April 26th, 2013, 01:40 AM
#25
Re: Difference between c#.net and VB.net
Also those who say vb.net code can be jumbled...did you ever look at a hugh program I c#? That is the lamest excuse ever.
-
April 26th, 2013, 01:57 AM
#26
Re: Difference between c#.net and VB.net
Naturally in the C# area of a forum most people would say they prefer C#. If the thread was posted in the VB.Net section the answers would be a bit different.
The fact is that both are very good languages and can do many many things. Which is better depends on who you are and what you are doing. If you are a former VB or VBA coder then VB.Net is much easier to code in than C# simply because of the fact the C# is case sensitive and requires the use of ; after every line of code both of which are things that may trip up a coder who is not used to this. C# on the other hand would be easier for someone who has coded more in C/C++, Java or other similar language.
Personally I find C# code to be a bit longer and harder to follow but that is because I have only used C# and Java script on a few occasions and have been writing in different versions of VB for many years.
Always use [code][/code] tags when posting code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|