• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Beginning Visual Basic programming -- were you confused at first?

Nocturnal

Lifer
I get confused often when I read something that says:

dim noc as long

noc = fat()

if fat = noc24 then

noc = noc 24

else

if

end
 
I get confused when I look at that syntax at all.


I guess it's supposed to be something like this in normal languages?

declare some variable noc;

noc = fat();
if(fat == noc24){
noc = noc 24;
}
 
I first started taking VB and Java at the same time. It was pretty confusing cause the syntax is very similar.
Heh I was getting mixed up cause I would be doing vb and then all of a sudden I'd be programming it in Java.. not good.

I like VB alot better than Java though, if it's any consolation to you.
 
Ya i do not think VB & Java syntax are similar.
Java syntax is like C/C+
VB syntax is like... Basic?

Anyways back to the original question:
No I was not confused by VB syntax, but I do not like VB syntax.
Probably most people who learned C/C++ or Java first will not like VB syntax.
The one thing I like about VB is how simple it is to create a good looking GUI.
 
Well I'm used to old skool BASIC and even I still get confused with VB sometimes as I'm primarily used to C++. The things that trip me up the most are nested if statements and function calling, parameters and return values.

Those areas are really different in C++ and I think that C++ does them in a cleaner and more efficient way. Personally I wouldn't bother with VB at all if it weren't for the fact that building Microsoft Access systems is a major part of my job.

but I fail to see how the syntax is similar to Java.
Same here. C++ and Java are very similar but VB is completely different.
 
VB syntax is pretty normal; however, as I have said in many VB-related threads, it simply has more syntactic salt. For those that don't know what syntactic salt is, consider the following examples:

Dim firstname As String
firstName = "Blah"

Contrast that with a language like C/C++/Java/C# which allows initialization with declaration:

char firstName[] = "Blah";
String firstName = "Blah";
string firstName = "Blah";

etc..

It's syntactic salt because you have to jump through proverbial hoops in order to accomplish a given task. VB's syntax is not abnormal, it's simply more verbose. Another example:

Dim isSuccessful As Boolean
isSuccessful = False

If isSuccessful And Not isVBStupid() Then...

In the above, the conditions will not "short circuit" as they do in other (normal) languages. isVBStupid() will ALWAYS be called. This is highly undesirable in most cases.

But, to answer your question: no, I never found VB confusing. I'm an advocate of VB for its value, not for its syntax.
 
That's all I meant about it being similar to Java. I was just starting with two new languages, and I would forget to put the ; at the end of a line in my java, or I would put it in my VB, and when I would use certain functions in VB they seemed to be very similar to ones in java. Heh I guess it's the associations that I mistook when I was doing both at the same time cause they were new to me.

Yes, Java is more similar to C/C++ cause it is derived from them, except it is a safer way of programming cause you don't get into the danger with memory allocations as much.
 
Back
Top