Basics and Introduction
View Code
Making
- Program
- a file that gives instructions to the hardware of a computer
- Source File
- the file containing the programming language code
- Compile
- to translate source file into machine language
- Executable File
- a file that is a computer program
Language
- Machine
- ones and zeroes that the computer understands for instruction
- Assembly
- a programming language that strongly resembles machine language
- Low Level
- a programming language that computer jargon and English
- High Level
- a programming language that greatly resembles English
Errors
- Syntax Error
- an actual error in the written program
- These are the actual buggers that prevent a program from running.
- They can be as simple as leaving out a comma, or big as incorrect
declarations of classes.
- Not only that they chain react and add a $%*# more errors--my max was
1572.
- Just take them one at a time and starting from the top of the list.
- Logical Error
- the program run but has a logical error and does not do what you want
- These are tricker to spot.
- Usually in compilers they are given as possible errors.
- Fix all possible error.
- Then check in the blocks of code with logic, such as loops and if
statements.
- Make sure your code does what you want.
- Compile Time Error
- the program will shut down during compilation error
- This usually occurs when syntax errors exist.
- Or when the compiler messes.
- Some mess ups are memory, existing files, and files in use.
- Run Time Error
- the program will shut down (or never stop) when it is working and running
- A logical error often causes this.
- Sloppy coding also promotes this because the program does not deal
with all conditions.
Value and Memory Change
- Typecast
- surrounding a variable with a variable type and parenthesis to promote it
to the desired type
- Useful when mixing two different but similar variable types, such as
int and float.
- Promotion
- a variable will be treated as another with more memory for operation,
passing as parameters, and type casting
- This occurs when two different types are mixed and no type casting is
used.
- Truncation
- the cutting off of decimal values due to type casting or passing as
parameters
Operation
- Integer Division
- arithmetic division between two numbers in which only the whole number
part of the quotient is the answer
- E.g. 10 INTDIV 3 = 3, 20 INTDIV 9 = 2
- Modulus Division
- arithmetic division between two numbers in which only the remainder is
the answer
- E.g. 10 INTDIV 3 = 1, 20 INTDIV 9 = 2
First Writings
- Comments
- lines of code which are not translated
- These are often used to help explain coding to other computer
scientists.
- Elegant programming is not only code but comments to explain it. All
of my example code make use of comments.
- Hello World
- a program in which displays the message "Hello World!"
- This is the first program every one learns to write. It is a classic.
Prev --
Back to Portal --
Next