|
Parthasarathy Mandayam wrote: Can you list advantages of C# over vb.net?
No, because it's been covered about a bazillion times all over the web.
So what if the code is written in C#. It's not that much different than VB.NET. Most of the code you see is using the .NET Framework classes and has very little to do with the language itself. It also wouldn't kill you to learn it. Why limit yourself to just one language.
If you want a Rosetta stone, showing you the same code snippets in both languages, there's thousands of examples all over the .NET Framework documentation on MSDN.
|
|
|
|
|
Dave,
I agree with you. Further more, if you have a copy of Lutz Roedoer's Reflector for .NET[^], then you have all .NET languages. Once you open up an assembly with that tool, you can convert it to another language with the click of drop down box.
Hogan
|
|
|
|
|
Yes, I do have it. It doesn't support ALL the languages that target the .NET CLR, but it does cover the major ones.
|
|
|
|
|
Dave Kreskowiak wrote: It also wouldn't kill you to learn it. Why limit yourself to just one language.
I agree that it wouldn't hurt to know both.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Parthasarathy Mandayam wrote: Why are most articles in C# rather than vb.net?
Because most people here have a fanatical hatred of VB.
Kevin
|
|
|
|
|
That's just a stupid answer.
In the past, it was true that the average VB developer was at a lower level than the average C++ developer, and there was a short term flow effect to C#. I'd say that's no longer true.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: That's just a stupid answer.
No, it's not, it's a true answer. A true answer can't be stupid.
Kevin
|
|
|
|
|
Parthasarathy Mandayam wrote: Can you list advantages of C# over vb.net?
No I can't. That's not to say I think one is better than the other - it's too subjective, and is a matter of personal perspective. I prefer C#, but that's because of my C background (and I just happen to think the syntax is cleaner) - VB programmers tend to prefer VB.NET. Ultimately, they both work with the .NET framework, so you can't realistically choose one over the other as being better.
|
|
|
|
|
i was having the same problem about a year ago. so, i learned c#. it didn't take me more than 2 hours to switch to c# from vb.net
Eslam Afifi
|
|
|
|
|
Yes
i'm accept, but i think c# development greater than vb.net.
and many guy use the C#> vb.net
Cheers
RRave
MCTS,MCPD
|
|
|
|
|
I'm working on a method and I want to allow the user to pass in a System.StringComparer, but I also want to determine whether or not that System.StringComparer is case sensitive.
System.StringComparer has an _ignoreCase member but it's private (Microsoft! Gimme a property!)
So I was thinking of doing:
ignorecase =
(
EqualityComparer.Equals
(
System.StringComparer.CurrentCultureIgnoreCase
)
||
EqualityComparer.Equals
(
System.StringComparer.InvariantCultureIgnoreCase
)
||
EqualityComparer.Equals
(
System.StringComparer.OrdinalIgnoreCase
)
) ;
but that would need to be maintained as comparers are added and removed.
Then it occured to me that:
ignorecase = ( EqualityComparer.Compare ( "X" , "x" ) == 0 ) ;
should work, and preliminary tests confirm this.
Does anyone have a more robust method of determining whether or not a System.StringComparer is case-sensitive?
|
|
|
|
|
No, none that I'm aware of.
|
|
|
|
|
ignorecase = ( EqualityComparer.Compare ( "X" , "x" ) == 0 ) ;
Seems clean and effecient
only two letters away from being an asset
|
|
|
|
|
I don't have a better method, but a problem with your approach is that StringComparer.CurrentCultureIgnoreCase.Equals("X", "x") does not necessarily return true in all cultures.
For example, StringComparer.CurrentCultureIgnoreCase.Equals("I", "i") is false on Turkish systems (Turkish distinguishes between dotted and dotless i[^]).
I don't know if there is any language that does something similar for "x".
Be careful with the "i" issue, case-insensitive comparisons of file extensions like ".gif" might fail on Turkish systems if you use CurrentCulture.
|
|
|
|
|
I certainly didn't know that. I chose X more or less at random.
Do you know whether or not InvariantCulture does that as well?
|
|
|
|
|
I am trying to sent an email to everyone in my sql database, the code selects all the email addresses to send to and then an email should be sent to all these addresses.
the problem: when i try to run this code i get the following error.
"the specified string is not a valid e-mail address."
clearly one of my addresses isn't in the correct format, the problem is that i have 2500+ clients.
How do i find out which address is invalid?
Thanks
|
|
|
|
|
Fatbuddha2 wrote: How do i find out which address is invalid?
You're kidding right?
led mike
|
|
|
|
|
|
Mike is referring to the obvious fact that your code has no error handling capability what-so-ever. Having this would making it incredibly easy to just log the offending address to a file or a TextBox or some other place to let you know which ones failed.
|
|
|
|
|
yes i have tried doing this with try and catch, but i am quite new to C# and asp.net and am still working on my first project. so i'm not exactly sure of the best way of doing this.
some help would be really appreciated
|
|
|
|
|
Fatbuddha2 wrote: but i am quite new to C# and asp.net and am still working on my first project
Best practice is to actually attain a novice level of expertise as a software developer BEFORE engaging in your first project. Novice level includes basic fundamental skills like knowing how to debug etc.
led mike
|
|
|
|
|
well I recently did a msc in information systems, which included one module on c# prgramming and databases, at the end of the course I had to do a 3 month work placement, hence beginging my first proper project, this project continued after i finished my msc it is just in the final stages of compleation and this is the last part of the project, i have been thrown in at the deep end and had to learn alot on the job, with no expert help.
i've generally been fine with debugging, but am having trouble unterstanting exactly how the try and catch steps work.
|
|
|
|
|
Fatbuddha2 wrote: but am having trouble unterstanting exactly how the try and catch steps work.
See if this helps[^]
led mike
|
|
|
|
|
ok, i've read up on exception handling, and yes i see how catch woks, but i still don't see how i can find out which email is in the wrong format. so the error is caught but it could still be any of the addresses, how do i know how far the while loop has got?
|
|
|
|
|
so you got an IT degree and worked for months now, but you fail to understand try-catch?
I strongly suggest you read up on exception handling and hurry applying it everywhere.
IMO it is the shortest route to creating reliable applications.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|