Go to Post We discovered this problem on the ship day (sure, when else?) - Manoel [more]
Home
Go Back   Chief Delphi > Technical > IT / Communications
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-11-2007, 23:31
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Visual Basic

I'm not exacly sure where to put this thread but....

Does anyone here program Visual Basic and have any tips. Microsoft Visual Basic 2005 Express is free and it's awesome. I've been developing for about half a year now. Also Coding4Fun (an msdn blog) is a great place to start.
  #2   Spotlight this post!  
Unread 13-11-2007, 00:37
jee7s jee7s is offline
Texan FIRSTer, ex-frc2789, ex-frc41
AKA: Jeffrey Erickson
FRC #6357
 
Join Date: Nov 2007
Rookie Year: 1997
Location: Dripping Springs, TX
Posts: 308
jee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond repute
Re: Visual Basic

Though I might not agree with all of what Microsoft does, they do bring new meaning to RTFM. One of the better benefits of the Visual Studio system is the help. Basically, if you want to do something, search the help, and more than likely there's already something in the .NET framework ready for you to use.

If you can learn to read the documentation that Microsoft provides and learn to implement what they give you, you should have a pleasant VB experience.

However, VB has limitations...the professional CS types tend to use Java, C++ or C#, which give greater control over the processes.

Java is platform independent, meaning it will run on a Mac, Linux, or Windows computer, provided it has the Java software (VM) from Sun.

C++ allows you to program at low levels, even in assembly (think: controlling the processor step by step).

C# is something of a blend. The syntax is c-style (as opposed to VB-style), but it is like VB with regard to the ease of use.

That should give you a brief picture of what is going on.
  #3   Spotlight this post!  
Unread 13-11-2007, 05:58
Chief Pride's Avatar
Chief Pride Chief Pride is offline
<3
AKA: James Kiefer
no team
 
Join Date: Sep 2007
Rookie Year: 2007
Location: Kalamazoo, MI
Posts: 653
Chief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond repute
Re: Visual Basic

i agree with the above, learning visual basic before any other languages should be avoided, it will teach you bad habbits that are hard to break when you move to a new language, such as c++
  #4   Spotlight this post!  
Unread 13-11-2007, 07:16
Robostang 548's Avatar
Robostang 548 Robostang 548 is offline
I can program the future...
AKA: Don
FRC #0548 (Robostangs)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Northville Mi
Posts: 69
Robostang 548 is on a distinguished road
Send a message via AIM to Robostang 548 Send a message via MSN to Robostang 548 Send a message via Yahoo to Robostang 548
Re: Visual Basic

I suggest that you familiarize yourself with the .net framework namespaces. It took me a while to get used to using the .net namespaces instead of the vb6 ones. Also, try playing around with the serial port class and your RC. I made a vb.net program that takes sensor data printf'd to the serial port graph on my laptop.

-Don
__________________

Team 548:
Attending National Championship, Genesee District, Detroit District 2, West Michigan District, Michigan Championship?


  #5   Spotlight this post!  
Unread 13-11-2007, 08:48
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: Visual Basic

well, i agree with u guys somewhat but ive been programming visual basic for a year and love it! i have to admit running programs is a bit slow but, meh!
i also have a BasicX microcontroller which programs on visual basic and the BasicATOM programs with basic as well

as for C and C++ i know the basics of (how can i be on a robotics team without at least knowing easyC) and im not screwed up by anything, i also know HTML, Javascript, CSS and im still not screwed up

oh and by the way im sure a lot of you will agree but in c++ or sometimes C i hate those semicolons ;;;;;;
  #6   Spotlight this post!  
Unread 13-11-2007, 12:20
whitetiger0990's Avatar
whitetiger0990 whitetiger0990 is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Earth
Posts: 157
whitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of light
Re: Visual Basic

"It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration."

I'm not one to argue with Edsger Dijkstra. =)
__________________
print$q=chr(ord($q)+$1)while("7443-0201-8465130105-12-03135-82482113-06-7672-070208-0613-70"=~/(-?\d\d)/g);
  #7   Spotlight this post!  
Unread 13-11-2007, 14:54
jee7s jee7s is offline
Texan FIRSTer, ex-frc2789, ex-frc41
AKA: Jeffrey Erickson
FRC #6357
 
Join Date: Nov 2007
Rookie Year: 1997
Location: Dripping Springs, TX
Posts: 308
jee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond repute
Re: Visual Basic

Actually, those semi-colons are really useful in C/C++/C#. In all three cases, you can write several lines of neatly formatted code (a long string or calculation for instance) without needing to do an actual concatenation.

Also C/C++/C# allows for "fall through" switch/case statements. which are valuable. Conditional statements are also more concise, since C/C++/C# all interpret the value 0 for byte, int, long , etc as a false bool. This, along with the ?: operator in C# allows for this:

int i = 0;
string str = (!i) ? "Is Zero" : "Is Not Zero";

which would look like this in VB:

Dim i as Integer
Dim str as String
i = 0
If(i == 0)
str = "Is Zero"
Else
str = "Is Not Zero"
End

As you can see, the C# code is much more concise than the VB code.

Also, you may love doing VB for now, when it's all for play, glitz, and glam. However, if you pursue CS or EE as a profession later on, you will quickly learn that VB is "programming for business majors." (i.e. there is no rigor to it) Real (professional) programmers and engineers pay a great deal of attention to data structure, argument passing, type casting, etc...all of which VB is very loose with.
  #8   Spotlight this post!  
Unread 13-11-2007, 17:39
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 6,979
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Visual Basic

Quote:
Originally Posted by basicxman View Post
i have to admit running programs is a bit slow but, meh!
Heh, it's just a problem of insufficient hardware

Quote:
Originally Posted by whitetiger0990 View Post
"It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration."
BASIC is not Visual Basic; VB has more in common with C++ than with BASIC.

That being said, if you can teach yourself (or get taught) regular old C, you'll have a foundation that will pay you well for the rest of your life.

Not a bad return for a High School student...

Don
__________________

I am N2IRZ - What's your callsign?
  #9   Spotlight this post!  
Unread 13-11-2007, 22:45
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Visual Basic

Quote:
Originally Posted by Robostang 548 View Post
I suggest that you familiarize yourself with the .net framework namespaces. It took me a while to get used to using the .net namespaces instead of the vb6 ones. Also, try playing around with the serial port class and your RC. I made a vb.net program that takes sensor data printf'd to the serial port graph on my laptop.

-Don
I totally agree. The .net framework is huge, and the best way to learn it is to write code.

Quote:
Originally Posted by jee7s View Post
Also C/C++/C# allows for "fall through" switch/case statements. which are valuable.

...

As you can see, the C# code is much more concise than the VB code.

Also, you may love doing VB for now, when it's all for play, glitz, and glam. However, if you pursue CS or EE as a profession later on, you will quickly learn that VB is "programming for business majors." (i.e. there is no rigor to it) Real (professional) programmers and engineers pay a great deal of attention to data structure, argument passing, type casting, etc...all of which VB is very loose with.
By switch/case statments do you mean something like this?
Code:
        'VB.net code'

        Dim i As Integer = 10
        Select Case i
            Case 1
                DoSomething()
            Case 10
                DoSomethingElse()
        End Select
Also, add this to the top of your .vb file, to get the "strictness" of C#.
Code:
Option Explicit On
Option Strict On
Quote:
Originally Posted by basicxman View Post
well, i agree with u guys somewhat but ive been programming visual basic for a year and love it! i have to admit running programs is a bit slow but, meh!
If you're running VB.net code the performance will be identical to C#, since they're both copiled to the same IL(Intermediate Language), using the same .net framework, running on the same CLR(Common language runtime).

---------

I know some people will say I'm insane, or stupid, but I'll say this anyways.

I am equally capible of proramming in C# and VB.net. I also have some experiance with C++ on windows, and C on the RC, but .net is what I really have experiance with.

Now, this is what some people won't believe. I am more effecient in VB! The background compilation, LINQ to XML(in vs2008 Beta 2), case-insensitivity, ect., make me much more productive than C#.

EDIT: As languages I have no preference between VB and C#, but the IDE features of VB.net are far superior of C#. Just my opinion.

Tips for people interested in .net.
Read these blogs:
Coding Horror
Coding4Fun

Listen to these podcasts:
.Net Rocks!
HanselMinutes

Use these sites:
CodeProject
__________________
Eric Haskins KC9JVH

Last edited by EHaskins : 13-11-2007 at 23:21.
  #10   Spotlight this post!  
Unread 13-11-2007, 22:58
jee7s jee7s is offline
Texan FIRSTer, ex-frc2789, ex-frc41
AKA: Jeffrey Erickson
FRC #6357
 
Join Date: Nov 2007
Rookie Year: 1997
Location: Dripping Springs, TX
Posts: 308
jee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond repute
Re: Visual Basic

Yes, that's a switch-case statement. However, a fall-through switch case statement is a little different:

int i,x,y,z;

switch(i)
{
case(1): x = 4;
case(2): y = 4;
case(3): z = 4;
break;
default: x = y = z = 0;
break;
}

This code sets:
x,y,z to 4 if i = 1
y, z to 4 if i = 2
z to 4 if i = 3
x, y, z to 0 else

It's called "fall through" because there are no break statements in the early set of cases. This means that the case i == 1 falls through to i == 2 which in turn falls through to i == 3. There are many situations where this is useful, especially if the cases for i are not mutually exclusive.

From my understanding of VB, the above block would have to be coded this way:

Select(i)
case(1):
x = 4
y = 4
z = 4
case(2):
y = 4
z = 4
case(3):
z = 4
default:
x = 0
y = 0
z = 0
End Select

I might be wrong about that VB switch statement, but I'm pretty sure it doesn't support the fall-through idea.

de KG2OV
  #11   Spotlight this post!  
Unread 13-11-2007, 23:07
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Visual Basic

Quote:
Originally Posted by jee7s View Post
Yes, that's a switch-case statement. However, a fall-through switch case statement is a little different:

I might be wrong about that VB switch statement, but I'm pretty sure it doesn't support the fall-through idea.

de KG2OV
Thanks for the clarification. I should have know that, but I don't remember ever seeing that in practice.

However, after reading your post i decided to try that in C#, and as far as I can tell C# dosn't support that either.

This code:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int i = 10;
            switch (i) {
                case (1):
                    Debug.Print("1");
                case (2):
                    Debug.Print("2");
            }
        }
    }
}
generates these errors:
Error 1 Control cannot fall through from one case label ('case 1:') to another C:\Users\Eric Haskins\Documents\Visual Studio 2008\Projects\ConsoleApplication1\ConsoleApplicati on1\Program.cs 15 17 ConsoleApplication1
Error 2 Control cannot fall through from one case label ('case 2:') to another C:\Users\Eric Haskins\Documents\Visual Studio 2008\Projects\ConsoleApplication1\ConsoleApplicati on1\Program.cs 17 17 ConsoleApplication1

Am I being stupid again, or is this a limitation of all .net languages?

EDIT: I found my own answer. http://msdn2.microsoft.com/en-us/lib...28(VS.90).aspx That seems slightly old VBish.
EDIT: More info http://blogs.msdn.com/abhinaba/archi...15/492866.aspx
-Eric
__________________
Eric Haskins KC9JVH

Last edited by EHaskins : 13-11-2007 at 23:18.
  #12   Spotlight this post!  
Unread 13-11-2007, 23:43
jee7s jee7s is offline
Texan FIRSTer, ex-frc2789, ex-frc41
AKA: Jeffrey Erickson
FRC #6357
 
Join Date: Nov 2007
Rookie Year: 1997
Location: Dripping Springs, TX
Posts: 308
jee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond repute
Re: Visual Basic

I really meant my fall through explanation to be focused on C/C++. Frankly, I have never used it in a C# application, but I assumed the C-style syntax would support it...I was apparently wrong.

So, let's apply my previous post to C/C++ only.

Also, the link you posted is a good work around for a fall through. However, as a practice, GOTO statements violate OOP principals, and I try to avoid them at all costs.

P.S....I've been itching for a correlary to __asm (from C++) in C#. Perrhaps __cpp, or __C++, or __cplusplus to allow for inline C++ code in C#. I suppose I'll never see it.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic help needed. Cody Carey Programming 1 25-02-2007 15:06
Visual Basic Scouting Problem Jeffel Programming 7 11-02-2005 19:30
Visual Basic dddriveman Programming 12 20-03-2004 13:03
Visual Basic 6 Dashboard LBK Rules Programming 1 22-01-2003 13:06


All times are GMT -5. The time now is 10:51.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi