JaedenRuiner
Well-known member
- Joined
- Aug 13, 2007
- Messages
- 340
- Programming Experience
- 10+
It has been one of those years, that well, VB.net is becoming more acceptable and so I must by dint of necessity of survival work within its confines, but it is utterly moronic.
Every language has a base "object" type. Now, granted in the older days of structured programming into the early days of the OOP revolution there were things called "simple" types, which had no need of the object overhead, as they were a byte or 8 in size and could easily be realized with registers or small stack pushes/pops. Byte, Char, Int, Word, Long, DWORD, Real, Single, Float, Double, you name it, those "simple" types were just that...simple.
however, with the advent of the further OOP design, I must say VB comes in dead last.
If everything is an object than everything is an object. VB seems to be designed so complete idiots (and i've met quite a few who've managed to obtain degrees) can program. It does all the work. The problem is that it doesn't allow a real programmer to actually program.
now this may seem a bit over kill, and in the past i defined something like this for many languages to handle a coding "standard":
it may seem pointless,but the idea is that if everything is an object, I can very easily determine if any of my reference types are valid to be dereferenced, and in the grand scheme of the JIT I would expect the optimizer to inline this extension function. However:
Brings up a "late binding" error. Why? An object is an object is an object. What the hell does it care what kind of object it is...What kind of type checking does it need to do to determine if an object has a reference? I'll tell you: none, vb is just moronic.
There are several "methods" that work on every object:
Equals(), GetHashCode, ReferenceEquals(), GetType(), and ToString()...and frankly, this little tiny extension method is the exact same as those, and if it is not, I demand the power to create it as such. An Integer type, which is supposed to be a simple type, can easily call Integer.GetHashCode() and hey, an Integer defined type can even call my little extension above, which is rather erroneous because an Integer type is rarely if ever set to "nothing", but it still can be done. So if every type can be set to Nothing, and thus every type subsequently inherits from object, then why the idiocy in not allowing a global extension that utilizes this universality?
So we can turn Option Strict off, which then causes a massive slow down in the application performance (which i've directly noticed since i turned it on) because of type checking it should never have been performing. as a programmer, if I (or you) don't know what type something is in our code then we don't deserve to be programming and should go back to fast food service.
It is ever so frustrating to call myself a programmer, and then to recognize that everything I know is utterly useless when dealing with a language like VB. Even java (for all its limitations) was better in handling these things, for unlike VB, at least in java, everything truly is considered to be an Object.
Every language has a base "object" type. Now, granted in the older days of structured programming into the early days of the OOP revolution there were things called "simple" types, which had no need of the object overhead, as they were a byte or 8 in size and could easily be realized with registers or small stack pushes/pops. Byte, Char, Int, Word, Long, DWORD, Real, Single, Float, Double, you name it, those "simple" types were just that...simple.
however, with the advent of the further OOP design, I must say VB comes in dead last.
If everything is an object than everything is an object. VB seems to be designed so complete idiots (and i've met quite a few who've managed to obtain degrees) can program. It does all the work. The problem is that it doesn't allow a real programmer to actually program.
now this may seem a bit over kill, and in the past i defined something like this for many languages to handle a coding "standard":
VB.NET:
<System.Runtime.CompilerServices.Extension()> _
Public Function IsValid(ByVal self As Object) As Boolean
Return (self IsNot Nothing)
End Function
it may seem pointless,but the idea is that if everything is an object, I can very easily determine if any of my reference types are valid to be dereferenced, and in the grand scheme of the JIT I would expect the optimizer to inline this extension function. However:
VB.NET:
dim x as object
if x.IsValid()
There are several "methods" that work on every object:
Equals(), GetHashCode, ReferenceEquals(), GetType(), and ToString()...and frankly, this little tiny extension method is the exact same as those, and if it is not, I demand the power to create it as such. An Integer type, which is supposed to be a simple type, can easily call Integer.GetHashCode() and hey, an Integer defined type can even call my little extension above, which is rather erroneous because an Integer type is rarely if ever set to "nothing", but it still can be done. So if every type can be set to Nothing, and thus every type subsequently inherits from object, then why the idiocy in not allowing a global extension that utilizes this universality?
So we can turn Option Strict off, which then causes a massive slow down in the application performance (which i've directly noticed since i turned it on) because of type checking it should never have been performing. as a programmer, if I (or you) don't know what type something is in our code then we don't deserve to be programming and should go back to fast food service.
It is ever so frustrating to call myself a programmer, and then to recognize that everything I know is utterly useless when dealing with a language like VB. Even java (for all its limitations) was better in handling these things, for unlike VB, at least in java, everything truly is considered to be an Object.