|
|
Today is as devoid of thermal excitation as the dextro-mamamry of a female necromancer. *
* I may have Leslied myself - but the day started at about -10C and windy with serious gusts off the ocean @ roughly 60-65 k/h
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
You forgot the enormous copper and zinc alloy lingerie.
|
|
|
|
|
I have to do so much processing to the codedom just to get VB to choke it down.
Why? The language is STUPID. That's why. There's no more succinct and accurate way to put it.
The grammar is stupid.
The runtime is stupid.
The language overall, is stupid.
You have two different equality operators you have to use depending on whether you're comparing reference types or value types. Because of that I have to visit every damned == and != in the tree, do type resolution on both sides of the expression (slow) and then based on that determine whether I should say "=" or "is"
Stupid.
You have to explicitly name your public implementation types for a method. So if i want to implement IEnumerator<t>.Current I have to also have Implements IEnumerable(of T)
This means for every public method you declare i have to go through all the base types of its declaring class, resolving each one (slow) to see if it matches the method signature (slow) of the declared method, so i can add Implements.
Stupid.
And don't get me started on the bugs in the VB codedom
It has taken me 2 hours just to fix all that crap
Angry honey.
/rant
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the codewitch wrote: You have two different equality operators you have to use depending on whether you're comparing reference types or value types.
Not quite.
You use Is to compare for reference equality, and = to use the overloaded equality operator. But unlike C#, VB.NET won't fall back to using reference equality if the equality operator hasn't been overloaded.
Reference type vs value type is irrelevant, other than the fact that reference equality for value types will always be False .
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
That's not what the compiler told me but okay. I don't trust it either.
Anyway, I'm doing ValueType checks now and it works.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
|
Sure, but the example you gave has no way to compare equality.
The closest thing you could do would be like Equals() or ReferenceEquals() at that point, and honestly i'm not sure how those will behave exactly on such a struct though i imagine ReferenceEquals() ends up comparing the stack pointers or something. I think Equals() would just forward basically to ReferenceEquals() in that case.
The other possibility is equals does a memberwise compare. That's about 50/50 likely but on such a struct they would always be equal since they have no fields. Hmmm
I'd have to research it all to be sure, but it gives me something to think about and look into.
Although it would be nice for VB to manufacture a way to do equality checks on such a structure, it's not very useful in practice. I wonder if i don't mind breaking in that case?
Considering that case uses = it gives you the opportunity to fix by overloading=
Unfortunately, you cannot overload operators in slang because CodeDOM won't render operator overloads. but you can overload a class that it references the binary of.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the codewitch wrote: I wonder if i don't mind breaking in that case?
Probably a sensible option - C# won't let you use == on a struct which doesn't implement an equality operator either.
You're right about ReferenceEquals , which obviously wouldn't work for value types.
The default Equals implementation for a value type uses reflection to compare the value of all of the fields:
Reference Source[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard Deeming wrote: The default Equals implementation for a value type uses reflection to compare the value of all of the fields:
Reference Source[^]
Aha. I remember reading that years ago. It does a memberwise compare, using Reflection.
Ugly.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Easy: Simply ignore VB
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
I'd love to honestly. It's not a "real" language AFAIAC. However, the CodeDOM dictates target languages. I don't. The fact is, despite me complaining about VB there are probably N other languages like Python that have weird quirks so I really did need to correct for all this (except for the bugs in VBCodeProvider) for my stuff to work as advertised with all languages - or at least all languages that support a reasonable amount of the CodeDOM
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
So your complaint isn't about VB itself. It's about a buggy code generator.
|
|
|
|
|
That's pretty much my opinion of C# too, except for the details.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
I don't know. C# grew on me. I look at the grammar of it as like a serious subset of C++, with some sugar added so you don't have to worry about . vs. ->
although latter versions like C#8 are getting ugly.
Still, my main gripe with C# is lack of source level templates and lack of multiple inheritance, but especially the templates. Generics just don't cut it. You can't do things like partial template specializations or traits with generics.
I come from a C++ background but these days I code in C# a lot. I like the fact that it's "cheaper" in terms of effort and debugging than C++. It's like if Java were something I could stand. Which is nice.
Although I'll add, while the grammar is simple, it's highly ambiguous and requires extensive type information in order to parse it. That really bugs me. My parser has to do serious backtracking and then i spend ages in CPU cycles fixing the parsetree i get back by injecting type information into it and correcting it based on that. It's nasty.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Yes, I know it's heresy, but that's what I dislike so much about it. There is far too much going on under the hood for my tastes.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
I don't mind that it wraps so many things. I mind that there's no way to get at stuff without it. Less of a problem in VB.NET then VB6, admittedly.
Edit: I lost the plot. You were talking about C#. I get what you mean, with anonymous methods and iterators awaitable methods and such it can be really difficult to know what's going on.
But you don't *have* to use that stuff. I could say the same honestly about STL with C++. There's way too much voodoo happening for my tastes. But it's the game.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
modified 19-Dec-19 17:39pm.
|
|
|
|
|
Rick York wrote: That's pretty much my opinion of C# too
Booooo! Hisssss!
So what language DO you prefer?
|
|
|
|
|
Quote: Booooo! Hisssss!
Yeah! That's telling him. How dare he?
|
|
|
|
|
Why would you support VB?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
It's more principle than anything. I want to support as many languages as possible. Actually supporting VB makes that possible because of how much work it was.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Different cars handle differently, too.
And if you want to drive a train or a truck or a motorbike or an aeroplane, you have to learn a whole lot of different stuff.
Funnily enough, each of the transportation items mentioned have advantages over the others.
Vive le difference!
(Haters don't really gotta hate -- they just want to.)
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
You're talking about VB.NET like it's a different language than C# or that you can do things with it you can't in the other.
That's not all that true.
Syntax differences aside, there isn't much different between the two, particularly in terms of overall capability.
I can literally translate code from C# to VB programatically
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
The Fiat cinquecento and the Ferrari Roma are both cars, and what you do with them can be "translated" from one to the other "programmatically", by your brain -- steering wheel, gears, pedals, etc. all perform the same basic functions, with relatively small differences.
99.999% (+/- 001%) of complaints about programming languages amount to no more than "I use this language, therefore it's the best!"
If you don't like using VB, fine. Just say you don't like using it. Saying that a language is "hateful" because it doesn't do a few things in precisely the way you're used to doing them is hardly productive.
e.g. VB is by far the quickest and most efficient language for making mock-ups of different options, to use when making decisions about which way to go (IMO, based on having to do that many times), and the fact that background functions can be quickly added to, imported into, or called by the mock-ups makes it a sheer joy.
Is C# therefore "hateful", because you can't do that as quickly and efficiently with it?
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
C# and VB have the same engine under the hood. Your analogy is a non-starter.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|