Why VB.Net blah blah... [modified]
-
I am going to advocate the opposite position. ;P Reserved words are the scourge of a programmer. There shouldn't be any at all. Languages like Algol 60 had no reserved words; language constructs were represented by symbols, e.g. the if symbol was not the word 'if' even if the compiler writer decided to use the letter 'i' and 'f' concatenated to represent the symbol because the hardware of the day did not have a native if symbol. Half a century later, that forward thinking philosophy has gone out of the window (no pun intended). Why should I be restricted in my choice of words - if there is a word that accurately and succintly describes what I want, what right has some anonymous progam language designer got to ban me from using it? For example, if I have a method to stop a task that is running, what could be more natural than calling the method
Stop
? It should not matter that the language designer has also realised thatStop
is a good way of saying stop doing something. I never thought I'd say this but "Well done, VB designers". The language should free you to express your thoughts and ideas, not contain you to some restrictive speech patterns. This is not 1984. No Orwellian Newspeak here, please. -
I'm using a web site that converts. For the most part, it does an okay job, but Linq statements tend to freak it out. I have a LOT of linq statements. I hate pretty much everything about VB, so this makes me hate my job. I updated my resume last night. I think my boss doesn't want to learn C#. I recognize that VB abnd C# are pretty much the same, but the differences are infuriating, and I simply don't like coding in it. NOTHING will change my outlook regarding VB. It has no redeeming features.
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001 -
I wasn't ready for this:
Dim [step] as String
I was shocked and appalled to find out that VB allows you to do this kind of thing - using reserved words as variable names... Not only freakin' amazing, but amazingly bad practice... And you guys should just go ahead and brace yoourselves - after coding our Silverlight project in C# since March (and that is between 90 and 95% completed), my boss had a fit and decided he wanted it converted to VB because that's what everything else in the shop is coded in (and he was the one that okayed C# to begin with). I am (and I think understandably so) quite upset/annoyed/pissed off about it. Expect to see more posts like this as I progress through the conversion. IMHO, VB is a scourge on mankind.
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001modified on Thursday, November 18, 2010 9:55 AM
Actually this "feature" helps me tremendously. My application deals with PLATFORMS that are grouped into TYPES that are grouped into CLASSES. The ability for me to define my own classes for "TYPE" and "CLASS" prevents me from having to name them something that doesn't match up directly with the requirements. Sweet.
-
I'm a government contractor - the contract doesn't end until net October, and there's no real schedule to speak of. Cost isn't an issue. He's got guns too. At least it would be a somewhat fair fight (if you can really apply the word "fair" to a gunfight).
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001 -
Yes John BUT 1. It blows up your whole argument about the so called superiority of your language 2. You VB Haters make me sick. It's just syntax and what you know 3. It seems to me that you are as unreasonable and pig headed about it as your boss - more so if all other programs in the shop are in VB.net... 4. The golden Rule applies "the man with the gold makes the rule" 5. And Finally "Nyah, Nyah....Nyah,Nyah,Nyah!
While I have to agree that VB haters tend to flourish as much as Microsoft haters (sometimes blind to the issues with whatever language or company they bow to) there are two important points here: 1. Why does ANY language (VB or C#) allow such bad practice? 2. Regardless of whatever language may allow this type of behaviour, John is right - it's HORRIBLE practice to actually do it and anyone that does should be drawn and quartered... just because you "can" doesn't mean you "should" so why the hell would anyone EVER want to use a reserved word other than for its reserved purpose?
-
I'm a government contractor - the contract doesn't end until net October, and there's no real schedule to speak of. Cost isn't an issue. He's got guns too. At least it would be a somewhat fair fight (if you can really apply the word "fair" to a gunfight).
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001Lovely - "cost isn't really an issue" - because there are no taxpayer dollars going to waste on this. The real problem is that is how government IT views the costs - as not an issue, so they waste money. It's crap!
-
I wasn't ready for this:
Dim [step] as String
I was shocked and appalled to find out that VB allows you to do this kind of thing - using reserved words as variable names... Not only freakin' amazing, but amazingly bad practice... And you guys should just go ahead and brace yoourselves - after coding our Silverlight project in C# since March (and that is between 90 and 95% completed), my boss had a fit and decided he wanted it converted to VB because that's what everything else in the shop is coded in (and he was the one that okayed C# to begin with). I am (and I think understandably so) quite upset/annoyed/pissed off about it. Expect to see more posts like this as I progress through the conversion. IMHO, VB is a scourge on mankind.
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001modified on Thursday, November 18, 2010 9:55 AM
Whoa! Hold on their pard'ner... 1) VB.NET is as good as C# and I program in both fluently... However, given your circumstances Iw ould still discharge all my laser blasters in the general direction of your supervisor. Anyone who ok's development in one language and then changes his mind without a second thought to redo it in another language has got a few screws missing in the gray matter. But if this is government work... it figures.... 2) You can do the same thing in SQL Server where you can use system variable names as field names to a table...
Steve Naidamast Black Falcon Software, Inc. blackfalconsoftware@ix.netcom.com
-
I wasn't ready for this:
Dim [step] as String
I was shocked and appalled to find out that VB allows you to do this kind of thing - using reserved words as variable names... Not only freakin' amazing, but amazingly bad practice... And you guys should just go ahead and brace yoourselves - after coding our Silverlight project in C# since March (and that is between 90 and 95% completed), my boss had a fit and decided he wanted it converted to VB because that's what everything else in the shop is coded in (and he was the one that okayed C# to begin with). I am (and I think understandably so) quite upset/annoyed/pissed off about it. Expect to see more posts like this as I progress through the conversion. IMHO, VB is a scourge on mankind.
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001modified on Thursday, November 18, 2010 9:55 AM
Show him the project plan that he approved that says the team should use C#. Make sure he takes responsibility for the delay in the schedule. "I can do this stuff 'cause I don't care if I get fired. I'll just collect unemployment until I retire."
-
While I have to agree that VB haters tend to flourish as much as Microsoft haters (sometimes blind to the issues with whatever language or company they bow to) there are two important points here: 1. Why does ANY language (VB or C#) allow such bad practice? 2. Regardless of whatever language may allow this type of behaviour, John is right - it's HORRIBLE practice to actually do it and anyone that does should be drawn and quartered... just because you "can" doesn't mean you "should" so why the hell would anyone EVER want to use a reserved word other than for its reserved purpose?
G-Tek wrote:
so why the hell would anyone EVER want to use a reserved word other than for its reserved purpose?
Because, and I realise I'm opening myself to be shot down in flames here, it sometimes serves a purpose when you can't think of a more apt name for a variable. I must admit i've done it myself as the following short sub will testify. The ONLY reason I used [string] as a variable name was because I just couldn't think of anything better :-O But then again, I only code as a hobby, not as a career.
Private Shared Sub AddListViewGroupStringArray(ByVal groupName As String, ByVal value As Object, ByVal listViewCtrl As ListView)
Dim lvGroup As ListViewGroup = CType(listViewCtrl.Invoke(New AddItemGroup(AddressOf AddListViewItemGroup), New Object() \_ {listViewCtrl, groupName, groupName}), ListViewGroup) Dim stringArray As String() = CType(value, String()) For Each \[string\] As String In stringArray Dim lvGroupItem As New ListViewItem(lvGroup) lvGroupItem.SubItems.Add(\[string\]) listViewCtrl.Invoke(New AddItem(AddressOf AddListViewItem), New Object() {listViewCtrl, lvGroupItem}) Next End Sub
Nobody can get the truth out of me because even I don't know what it is. I keep myself in a constant state of utter confusion. - Col. Flagg
-
G-Tek wrote:
so why the hell would anyone EVER want to use a reserved word other than for its reserved purpose?
Because, and I realise I'm opening myself to be shot down in flames here, it sometimes serves a purpose when you can't think of a more apt name for a variable. I must admit i've done it myself as the following short sub will testify. The ONLY reason I used [string] as a variable name was because I just couldn't think of anything better :-O But then again, I only code as a hobby, not as a career.
Private Shared Sub AddListViewGroupStringArray(ByVal groupName As String, ByVal value As Object, ByVal listViewCtrl As ListView)
Dim lvGroup As ListViewGroup = CType(listViewCtrl.Invoke(New AddItemGroup(AddressOf AddListViewItemGroup), New Object() \_ {listViewCtrl, groupName, groupName}), ListViewGroup) Dim stringArray As String() = CType(value, String()) For Each \[string\] As String In stringArray Dim lvGroupItem As New ListViewItem(lvGroup) lvGroupItem.SubItems.Add(\[string\]) listViewCtrl.Invoke(New AddItem(AddressOf AddListViewItem), New Object() {listViewCtrl, lvGroupItem}) Next End Sub
Nobody can get the truth out of me because even I don't know what it is. I keep myself in a constant state of utter confusion. - Col. Flagg
Reads well to me - the brackets around [string] make it pretty easy to identify that it's not the keyword being used in the normal sense. Without the brackets I would start to dislike it. As a man, I could spend time and energy explaining how flawed evolution is for giving me useless nipples or I could go and write some useful code.
-
I wasn't ready for this:
Dim [step] as String
I was shocked and appalled to find out that VB allows you to do this kind of thing - using reserved words as variable names... Not only freakin' amazing, but amazingly bad practice... And you guys should just go ahead and brace yoourselves - after coding our Silverlight project in C# since March (and that is between 90 and 95% completed), my boss had a fit and decided he wanted it converted to VB because that's what everything else in the shop is coded in (and he was the one that okayed C# to begin with). I am (and I think understandably so) quite upset/annoyed/pissed off about it. Expect to see more posts like this as I progress through the conversion. IMHO, VB is a scourge on mankind.
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001modified on Thursday, November 18, 2010 9:55 AM
-
Actually this "feature" helps me tremendously. My application deals with PLATFORMS that are grouped into TYPES that are grouped into CLASSES. The ability for me to define my own classes for "TYPE" and "CLASS" prevents me from having to name them something that doesn't match up directly with the requirements. Sweet.
Actually, this doesn't prevent you from doing anything. It does allow you to name objects something that does match up directly with your requirements. I personally tend to agree with John's assessment that this is a bad practice. How does naming a class "ClassObject" NOT directly match up with your requirements?
-
I'm a government contractor - the contract doesn't end until net October, and there's no real schedule to speak of. Cost isn't an issue. He's got guns too. At least it would be a somewhat fair fight (if you can really apply the word "fair" to a gunfight).
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001John Simmons / outlaw programmer wrote:
I'm a government contractor - the contract doesn't end until net October, and there's no real schedule to speak of. Cost isn't an issue.
Yeah, government. Figures. Since the money belongs to someone else the cost isn't an issue. THAT pisses ME off. -Max
-
I'm using a web site that converts. For the most part, it does an okay job, but Linq statements tend to freak it out. I have a LOT of linq statements. I hate pretty much everything about VB, so this makes me hate my job. I updated my resume last night. I think my boss doesn't want to learn C#. I recognize that VB abnd C# are pretty much the same, but the differences are infuriating, and I simply don't like coding in it. NOTHING will change my outlook regarding VB. It has no redeeming features.
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001Converting a large project from one language to another just because the "boss" thinks it's cool (regardless of what direction you're going) is absolutely nuts. I don't blame you for polishing up your resume. I would do exactly the same thing. This reminds me of one time when I went away on sabbatical for a month back in '06. We had this "director of technology" that felt that my subsystem needed to be rewritten in C#. (It's about 100,000 lines of code that has been gradually migrated over a period of 10 years from C to VB6 to VB.Net. No particular reason - he just thought that it needed to be in C# because all of our new development was being done with C#. So, this turkey waits for me to be away for a month to try and "take it away" from me. (I'm the only developer that understands the business logic in the product). Anyway ... when I got back everything was pretty much as it was when I left - I didn't learn about the behind-my-back attempt until a year later. When the developer assigned to the "conversion" was leaving to go to another job he told me about it. The conversion failed because these guys could not make heads or tails out of the logic - just a straight language conversion wouldn't work. There's too much different between VB.Net and C# particularly since a lot of old legacy VB6 techniques are still in use in that code. The "conversion" attempt was nothing more than a political move on the part of that "director" to wrest control of that part of the product from someone he must not have liked. It had nothing to do with technology or making it work better. From that point I refused to work for that VP any longer - I wouldn't even attend his meetings. I had the rare privilege (after slaving on that code close to 10 years and becoming - essentially - the owner of the product) of being able to literally wag the dog. That director wound up getting fired about a year later. AMF. Since you're working for a government agency there's NO telling what the reasoning is behind this "conversion" they want you to do but I can tell you from experience it has NOTHING to do with making your product better. Get outta there if you can. -Max :D
-
Converting a large project from one language to another just because the "boss" thinks it's cool (regardless of what direction you're going) is absolutely nuts. I don't blame you for polishing up your resume. I would do exactly the same thing. This reminds me of one time when I went away on sabbatical for a month back in '06. We had this "director of technology" that felt that my subsystem needed to be rewritten in C#. (It's about 100,000 lines of code that has been gradually migrated over a period of 10 years from C to VB6 to VB.Net. No particular reason - he just thought that it needed to be in C# because all of our new development was being done with C#. So, this turkey waits for me to be away for a month to try and "take it away" from me. (I'm the only developer that understands the business logic in the product). Anyway ... when I got back everything was pretty much as it was when I left - I didn't learn about the behind-my-back attempt until a year later. When the developer assigned to the "conversion" was leaving to go to another job he told me about it. The conversion failed because these guys could not make heads or tails out of the logic - just a straight language conversion wouldn't work. There's too much different between VB.Net and C# particularly since a lot of old legacy VB6 techniques are still in use in that code. The "conversion" attempt was nothing more than a political move on the part of that "director" to wrest control of that part of the product from someone he must not have liked. It had nothing to do with technology or making it work better. From that point I refused to work for that VP any longer - I wouldn't even attend his meetings. I had the rare privilege (after slaving on that code close to 10 years and becoming - essentially - the owner of the product) of being able to literally wag the dog. That director wound up getting fired about a year later. AMF. Since you're working for a government agency there's NO telling what the reasoning is behind this "conversion" they want you to do but I can tell you from experience it has NOTHING to do with making your product better. Get outta there if you can. -Max :D
This sounds eerily familiar. I work on a small team which was owned by a British company (we are in Oz). We built a quick demo of our proposed new application in VB6, but quickly realised we would need something else for the full-blown thing (~200K lines), so we were working in C++. When our boss went on a long trip, the UK sent over a "project manager" who quickly decided that the re-write of some of the useful VB code was a waste of time and we should write it in VB.NET... He was with us for 3 months, managing a team of 5 and never worked out that we had ignored his directive completely. He was happy as long as he got his timesheets and project plans updated with (completely bogus) information. The product lives on (just putting it into VS2010) and we are owned by another company. Andy
-
While I have to agree that VB haters tend to flourish as much as Microsoft haters (sometimes blind to the issues with whatever language or company they bow to) there are two important points here: 1. Why does ANY language (VB or C#) allow such bad practice? 2. Regardless of whatever language may allow this type of behaviour, John is right - it's HORRIBLE practice to actually do it and anyone that does should be drawn and quartered... just because you "can" doesn't mean you "should" so why the hell would anyone EVER want to use a reserved word other than for its reserved purpose?
G-Tek wrote:
1. Why does ANY language (VB or C#) allow such bad practice?
The reason why .NET languages have something like this is simple: interoperability. Take this C# class:
public class C { public void Step(); }
VB needs
[]
to call the Step method. In the other direction, C# might have to consume a variableDim int As Integer
. It's impossible for the CLS rules contain a list of reserved identifiers from all .NET languages, as that list would be continuously changing as new languages get invented. So instead, the CLS requires all .NET languages to have a way to consume members members with the same name as reserved keywords. And you also need to be able to define such members, otherwise VB couldn't implement a C# interface containing 'Step'.