- Learning to Program—The stages of programming
- Learning to Program – Some Terms You Should Understand
- Learning to Program – IPO Charts (Stage 1)
- Learn to Program- Flowcharting (Stage 2)
- Learning to Program – Flowcharting (Stage 2). — Decisions and Loops
- Learning to Program—Flowcharting (Stage 2) – Case Statements
- Learning to Program (Stage 2)—Flowcharting – Methods and Classes
- Learning to Program – Structure and Spaghetti Code
- Learning to Program – Pseudocode (Stage 3) an overview
- Learning to Program – Stage 3 Pseudocode commands and reserved words
- Learning to Program—Stage 3 Pseudocode examples Part 1
- Learning to Program – Stage 3 Psuedocode (Arrays)
- Learning to Program – Stage 3: Pseudocode—Methods
- Learning To Program—Stage 3.5 (UML Diagrams)
- Learning to Program – (Stage 4) Coding
- Learning To Program—Stage 5 Testing
- Learning to Program—Stage 6 (Documentation)
- Learning to Program – Stage 7 (Maintenance)
- Learning to Program—Random Thoughts with a Theme
- Learning to Program- Two Main Types of Errors
- Learning to Program – Integrated Development Environments (IDE’s)
- Learning to Program
I’m learning how to program in Java, and at the same time I’m tutoring students in Visual Basic. So, as I learn things, and as I help them to learn things, I plan on posting them here. I will identify the subject as Java or Visual Basic (or if it’s applicable to both equally, I won’t identify it).
The most important thing to know is that you need to make sure you find out the preferred standards for the language you are learning. Although I would like to see a standard naming convention, you won’t find a totally standard one yet. The closest thing is the Berkley style.
Some examples of needing to know how the language prefers things are listed below.
In Visual Basic:
Variable names start with a three letter prefix denoting their data type. dbl for Double, str for String, cnst for Constant (yes I know it’s four letters), int for integers. This also applies to objects and classes. For example, lbl for label, txt for textbox, cls for class, or btn for butons.
You declare variables using a DIM statement. The syntax is Dim variablename As datatype. For example, Dim intNewNumber As integer
The variables are required to be declared before the first line of code (in the declarations section).
You don’t use prefixes in your variable names. However, you still use the camelCase and make the variables descriptive.
The declaration is type variable = new type;. For example, Integer newNumber = new Integer;
The variables should (but are not required to) be declared before the first line of code. They are required to be declared before you use them the first time. It’s good practice to declare them at the top, so you don’t have them scattered throughout the application (especially if it’s a long application).
Visual Basic is typically taught as a GUI (Goo-ey) type of application. This is because it’s designed to resemble Windows applications. There are some non-GUI apps (such as asp.net webpages), and it does use behind the scenes stuff.
Java is originally a console type of application (read command prompt). It does have the GUI capability, but you don’t see that very often. The most common use for Java is “Server side” applications, which are presented in a web browser. Hopefully as more people discover the functionality of the GUI in Java, we will see more apps created for it. This is especially beneficial, since Java runs on virtually any platform—where Visual Basic mainly runs on Windows-based platforms (not withstanding mono or other attempts to port it to Linux or other platforms).
It should be noted that I use Visual Studio 2008 for Visual Basic, and Netbeans 6.7 or 6.8 for Java. You can get these from http://www.microsoft.com/visualstudio or http://www.netbeans.org respectively.
Have a great day:)