Need to write a messaging\alert app which language should I use\learn C# or VB.Net?

TheKub

Golden Member
Oct 2, 2001
1,756
1
0
To inform users and to lower duplicate service desk calls we send out an email to users when there is a downtime (server crash, network issue, etc). a significant portion of our users use generic task worker PCs, these PCs do not have our email client installed on them (licensing cost). Users have the ability to check their mail via WebMail but only do this periodically. As such many users are unaware of downtime notices that are sent so there is a request to develop a messaging\alerting solution which will work in concert with the email notice.

I did some searching for any open source messaging solutions that might be able to fit the bill but was not able to find something that fit. I came across a notification system called Snarl which makes short work of poping up little bits of information in a non-obtrusive way. It looks like a good endpoint for the users but will require me to write the business end to check for alerts and drive Snarl. Which leads me to the question of which language I should use to implement this.

I am not a programmer but I have done a handful of projects using PHP and VBScript and with this job I use WinBatch alot for creating deployments\mass PC management tasks. Snarl has includes for both VB.Net and C# so I will probably wind up using one of those. I was wondering if either one had the edge as to the how fast one can pick up the language. Functionality wise I do not believe this will be a very complicated task. I imagine it would constantly be running in the background and would read settings from a ini\registry and query a database to see if there is a pending message for the given user. If the user acknowledges the popup it will delete the record from the server. There will be a handfull of housecleaning\validation bits that shouldnt be too bad write.

I tried looking up some of the differences between the 2 languages but many of the differences I saw I don't fully understand the impact of it having\missing the particular feature means. The only thing that jumped out at me was that VB.Net is not case sensitive which might be a little more newbie friendly. I figured I'd throw this question out there take my licks and get some insight from those that are in the know.

Thanks
 

tatteredpotato

Diamond Member
Jul 23, 2006
3,934
0
76
VB.NET and C# are (afaik) kept 1:1 as far as features are concerned, but I think C# syntax >>>>>>>>>>>>>>>>>>>>> VB.Net syntax. Of course VB might be easier for you to pick up if you haven't used C syntax before.
 

Cogman

Lifer
Sep 19, 2000
10,283
134
106
C#, just because VB needs to DIAF.

On problem you will run into. How will the messaging server know where all the clients are? You can either
A. Have a list of all clients stored on the server (prone to error)
or
B. Have the clients check if the server is up every 10 mins or so (higher bandwidth, and if the server goes down so does the message)

There might be some other solution (IE, bit-torrent like tracker for the client and have clients relay to other clients a server message).
 
Last edited:

PhatoseAlpha

Platinum Member
Apr 10, 2005
2,131
21
81
They're essentially the same language, with different syntax. As you can no doubt see, opinions on those difference run strong.

I use VB - can code in C# without any actual problem. But the VB intellisense is helpful in situations where the C# one isn't (declaring local variables in functions, for instance. VB: Dim A as then pops up a list of all valid class. C#....well, since there is no DIM keyword, doesn't help you at all. Plus, case sensitivity.....I still say that's a feature for pricks.

That said, you'll find many more C# tutorials online then VB ones, so you should probably go where the community can help you.
 

Cogman

Lifer
Sep 19, 2000
10,283
134
106
They're essentially the same language, with different syntax. As you can no doubt see, opinions on those difference run strong.

I use VB - can code in C# without any actual problem. But the VB intellisense is helpful in situations where the C# one isn't (declaring local variables in functions, for instance. VB: Dim A as then pops up a list of all valid class. C#....well, since there is no DIM keyword, doesn't help you at all. Plus, case sensitivity.....I still say that's a feature for pricks.

That said, you'll find many more C# tutorials online then VB ones, so you should probably go where the community can help you.

curly brackets FTW!
 

tatteredpotato

Diamond Member
Jul 23, 2006
3,934
0
76
They're essentially the same language, with different syntax. As you can no doubt see, opinions on those difference run strong.

I use VB - can code in C# without any actual problem. But the VB intellisense is helpful in situations where the C# one isn't (declaring local variables in functions, for instance. VB: Dim A as then pops up a list of all valid class. C#....well, since there is no DIM keyword, doesn't help you at all. Plus, case sensitivity.....I still say that's a feature for pricks.

That said, you'll find many more C# tutorials online then VB ones, so you should probably go where the community can help you.

Yes, C# has the same features with superior syntax ;)
 

TheKub

Golden Member
Oct 2, 2001
1,756
1
0
Thanks for the input guys. Up until earlier this weekend I really didnt know much about either language nor did I know the heated debates each side had. Now knowing about this drama I came accross a thread that had a post that got me chuckling:

FWIW, ctrl + spacebar works just as well in C#. It even corrects the
capitalization, which is quite handy. Actually I consider myself both a VB
programmer and a C# programmer, which leaves me in the odd position of
feeling that I'm better than myself.

As for the backend mechanism I was planning to have the alert control panel populate the messages into our consolidated DB environment (which if it ever goes down we have far FAR bigger problems) and the clients would check in every ~15 min. The other option was to send the message to every subnet with the intended groups embedded and leave it up to the client to determine if the message should be displayed or not. Im leaning towards the first one mainly becasue I believe it will be quicker to implement (also it will have the ability to recall a message if needed). This project came up early Q1 and has come up and went away a number of times. I figure the faster we can get it done the more likely we are to get it off our list rather than it spending a bunch of time in limbo. If we have it in place and it works but there is business reason for a more efficent and streamlined version we can work that into a revision. At this point we still dont officially have a scope of what the app should do, the features we have are our interpretations of the problem.
 

Kr@n

Member
Feb 25, 2010
44
0
0
Dim A as then pops up a list of all valid class. C#....well, since there is no DIM keyword, doesn't help you at all.

VS2010 (and VS2008 before that) pops up an list of classes (along with keywords and existing variables) when typing the first char of an instruction (the first word of the instruction is likely to be a keyword or a variable declaration). And like previously said, intellisense is just as good in VB and C#.

One thing where C# is much stronger that VB is Lambda Expression, LINQ integration, type inference (var str = new String(); is so much shorter than Dim str As String = New String() ...). I also don't know if it is possible to declare multiple variables with initializers within a single Dim statement, which you can do in C# ( int i = 0, j = 0, k = 1; )

As for case, I used to check and recheck case in my VB3-6 code because I can't stand when case is not proper (keyword auto-casing was a nice feature IMO). In C#, no problem anymore : if case is not right, it does not compile (and VS displays a red wave below the offending word) ...


I can see another big advantage of C# : it is more in line with other C-like languages (PHP, JavaScript, Java, Pascal, etc.), which makes the efforts to learn such language much more useful.
 
Last edited:

PhatoseAlpha

Platinum Member
Apr 10, 2005
2,131
21
81
You can actually do Dim Str as New String(), and have been able to since VS2005. And in vb.net, it will determine case insensitive declaration by context and then correct the casing to match the relevant declaration, meaning you'd only ever have to check you casing once.
 

Kr@n

Member
Feb 25, 2010
44
0
0
You can actually do Dim Str as New String(), and have been able to since VS2005.

Did not know that.


And in vb.net, it will determine case insensitive declaration by context and then correct the casing to match the relevant declaration, meaning you'd only ever have to check you casing once.

Yup, that's what I referred as auto-casing (and I think identifier casing corrections were performed since VB6, but I'm not sure - I did not really code in VB since that time, so if I remember it, it must have been in VB5 or VB6). Though I can't remember if auto-casing corrected identifiers on return (like keywords) or only on completion.
 

KIAman

Diamond Member
Mar 7, 2001
3,342
23
81
If you are really concerned about intellisense list of available classes, you can always instantiate a new Object type, it is the ultimate base class of all other classes.
 

Cogman

Lifer
Sep 19, 2000
10,283
134
106
Plus, case sensitivity.....I still say that's a feature for pricks.

Ok, couldn't let it drop.

Real developers ARE pricks :p. At least the mentality of being very picky and specific doesn't hurt when being a developer. (think of it as a weed out tool. Real developers gravitate to case sensitive languages because they are more consistent with naming. Psuedo-developers love VB for no case-sensitivity.)

:awe:
 

PhatoseAlpha

Platinum Member
Apr 10, 2005
2,131
21
81
If liking not ever seeing "Error: you type Class when you meant class" is wrong, I don't want to be right.



If you are really concerned about intellisense list of available classes, you can always instantiate a new Object type, it is the ultimate base class of all other classes.

Wouldn't that screw up the intellisense when I then try to use the object, as I've declared it as an object?
 

tatteredpotato

Diamond Member
Jul 23, 2006
3,934
0
76
:) They make it so you can have more then one statement on a line, because we all need to be able to do that!

Actually I like it because it's easier to span multiple lines with one statement (without underscores of whatever VB uses these days).

Whitespace ignorance FTW!
 

Cogman

Lifer
Sep 19, 2000
10,283
134
106
Actually I like it because it's easier to span multiple lines with one statement (without underscores of whatever VB uses these days).

Whitespace ignorance FTW!

Ah, that to (that is actually a useful feature.) I can remember inserting the stuff _ in VB well.
 

PhatoseAlpha

Platinum Member
Apr 10, 2005
2,131
21
81
Yes, that is actually a very nice feature. Though, I'm pretty sure they added implicit line continuations to VB in VS2010.
 

SearchMaster

Diamond Member
Jun 6, 2002
7,791
114
106
I work in a pretty large code base, about 1.2M LOC, and have been with the company since line 1. All VB.NET. I've always wished we'd chosen C# instead for various reasons but generally have no problem with either language. This week I've been working on customizing a C# package, and I must say I like Intellisense on VB.NET better than C#. Otherwise I couldn't really care less, it's like saying Spanish is superior to French or vice-versa and I've always found C# snobs who turn their nose up toward VB.NET to be annoying.
 

Kr@n

Member
Feb 25, 2010
44
0
0
I do think C# is a better language to learn (mostly because of the C/C++ resemblance). But obviously the more known languages the better ...

I think VB.NET improved leaps and bonds with VS2008 and VS2010, but I remember VB.NET in VS2003 (.NET 1.1) and it was not pretty. VB was so much more verbose at the time (and let's face it, it still is). But since there is feature parity and it compiles exactly the same pseudo-code, it is a cosmetic preference at most.

Note : I would certainly not rewrite a 1.2M loc program just to make it C# (maybe that's what awaits us in hell ? :D)
 

SearchMaster

Diamond Member
Jun 6, 2002
7,791
114
106
Well, we're certainly not going to convert to C# any time soon, that's for sure. The thing I'm working on is more of a one-off.

There are a few things C# does much better than VB.NET but they're relatively trivial IMHO. I don't love VB.NET by any means, the language you use is just a tool in the toolbox, every developer I've hired except one has had zero VB.NET experience, and only one of them hasn't worked out (guess which one?).

When we first converted our existing C++/VB6 app to .NET (in the early days of .NET 1.1), I absolutely hated VB6 and while C++ was not an easy language to develop with, it was what I'd generally used in the past. VB.NET corrected the things that I really hated about VB6 and I didn't miss C++. If you want to get picky and say it takes 10% fewer keystrokes to write in C# than VB.NET, fine but that in and of itself is not impactful on productivity IME (over 20 years as a degreed developer).
 

Cogman

Lifer
Sep 19, 2000
10,283
134
106
Well, we're certainly not going to convert to C# any time soon, that's for sure. The thing I'm working on is more of a one-off.

There are a few things C# does much better than VB.NET but they're relatively trivial IMHO. I don't love VB.NET by any means, the language you use is just a tool in the toolbox, every developer I've hired except one has had zero VB.NET experience, and only one of them hasn't worked out (guess which one?).

When we first converted our existing C++/VB6 app to .NET (in the early days of .NET 1.1), I absolutely hated VB6 and while C++ was not an easy language to develop with, it was what I'd generally used in the past. VB.NET corrected the things that I really hated about VB6 and I didn't miss C++. If you want to get picky and say it takes 10% fewer keystrokes to write in C# than VB.NET, fine but that in and of itself is not impactful on productivity IME (over 20 years as a degreed developer).

Honestly, I haven't done any development with VB.NET, only VB6.. So that is where my bias is coming from.