There are several pieces I've come across that explain VB is not VB.Net and that .Net is preferred. AdamSpeight2008 (in a piece I can find the link to at the moment Mentor Edit:This One ) suggested cutting the VisualBasic resource loose from a solution as a way to check for VB only code and (I think) then eradicate it. It makes sense to me. If I'm programming using Visual Basic Express 2010, I should still use .Net over VB because it's more efficient to program for the framework rather than the language. I think this is so because it will make it run faster and it will get along nicer with any other .Net application it has to talk to. I am clearly cloudy on this.
Strings:
I'm in the middle of a little thing I'm working on decided to take the test. I unchecked visualbasic and cut it loose. No sweat, except that I had fifty lines of code with the ugly crooked lines telling me there's no such thing as strings.anything. No other issues. Just the strings. Pretty good I thought, I'll just use the .Net equivalent to do the same stuff. Someday I'll figure out what that is.
Numbers:
I want my stuff to be perfect: fast, concise, sound, efficient, elegant all this stuff. To this end, in the project I am working on I decided I absolutely needed to know the best way to store a number. The user enters it and it is first captured in a string. I then thought, "okay what now?" Well, Microsoft tells me that in Visual Basic the numerical data type that is processed with the greatest efficiency is the Integer. Perfect. Unless the number at hand is too large, I can use Integer and know I am satisfying my desire to code perfectly. But in the next instant I found myself paralyzed yet again. Integer is of course a VisualBasic type. The .Net equivalent is Int32, which is not as fast as using Integer. Or is it? Did the Microsoft guy who wrote the statement "Arithmetic operations are faster with integral types than with other data types. They are fastest with the Integer and UInteger types in Visual Basic" (see Numeric Data Types ) really mean that or did he mean "They are fastest with the Integer and UInteger types (or their .Net equivalent) ..?"
Further,
I read in another spot that if any values are going to be passed to a COM component, that where possible Short should be used instead of Integer because life is different outside the .Net framework (I don't recall the explanation with any more accuracy than that I'm afraid).
So, if I am in pursuit of storing any given number (let's say 32000) in the perfect data type, is it Integer, Int32, Short or Int16?
Or am I spinning my wheels for nothing over an instance whereby for all practical purposes the subtle (and not so subtle) differences are irrelevant unless I am developing a complex application? I really don't think this would be the case, coding isn't horseshoes whether it's Hello World or the new engine for the WOPR. If these 4 possibilities were all the same, there wouldn't be four of them.
Perhaps it is a case where each has its pros and cons and it's up to me to evaluate them and make a decision?
Any informed guidance on this matter will be much appreciated. And any other commentary will be much enjoyed.
This post has been edited by AdamSpeight2008: 17 November 2011 - 02:00 PM

New Topic/Question
This topic is locked



MultiQuote









|