• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A couple of things about coding
#1
Different types of variables

Global Variables (Class variables)
Global variables are the same as class variables; they just have a different name. Global variables sit at the top of the program and remain there so different events can use the variables, at different times. Sometimes the data contained within the global variables are required in different events; this is why a global variable is used.

Global variables allow them to be used throughout the whole program, not just in sections. Global variables also allows for variables to be updated through out the program such as e.g “a total cost variable”. It may need to be updated by different events. Variables are good to use when it comes to storing information, global variables can be changed and manipulated during the execution of the program.

Local Variables
Local variables are variables that are used within one specific event. Local variables can’t be accessed through different events; the local variables hold data that only that event will need. Local variables will store information, and can be called upon when needed. Local variables are good for temporary data which needs to be held, such as a calculation conclusion. Once the event has finished then the variable will be lost, meaning another event can use variables with the same name.

Constants
Constants are used when the value won’t change throughout the program when executed. Constants can be used within the program over and over, as many times as is required. Constant variables should be used instead of hard coded values when a default value is required, this could be for a calculation.

Differences between low-level and high-level languages

Low level programming languages means more computerised coding such as using just numbers such as 0’s and 1’s like machine code. At the other end you have high level coding languages such as C#, which is very much like plain English. High level coding languages means not as much knowledge is required from the programmer, compared to low level coding languages such as machine code. For low level programming languages the user would have to know the internal workings of the computer, compared to high level where none is required. The internal workings is what takes the most time to learn. The programmer would have to code and decode hundreds of lines of 0’s and 1’s which is also very time consuming.

Low level - Machine code
Low level programming such as machine code was used at the very start, this was the only known way of coding at the time. The coding taken ages and was hundreds and hundreds of lines long. Machine code just including 0’s and 1’s and taken ages to decode, and to learn to program. It takes ages to learn how to program low level programming because you need to know the internal workings of the computer which is very time consuming.

Medium Level – Assembly Code
Assembly code then came along which shortened down the coding as it was new then, this saved the programmer a lot of time. Assembly code was created to save time. Also the programmers understand the code much easier as specific letters or phrases are used for specific things only. The programmer doesn’t have to decode just lots of numbers.

High level – C#
High level programming then got introduced where most of the code was in plain English. This means the programmer doesn’t need as much knowledge at all. This also means it saves the programmer’s time when they come to edit the code, because they can just read the code in English. High level programming was invented so that normal every day people can learn to program without a lot of technical knowledge required.

Overview of a few different languages

C# - The purpose of C# is to be able to create applications, both small and large with not a lot of coding knowledge. C# makes it simple and easy to code with. The purpose of C# is to be used when creating event driven applications.

PHP – The purpose of PHP is to be used with online applications. PHP is a high level programming language and is also designed to be used with databases.

JAVASCRIPT – JavaScript is used with online applications, this allows the user to be able to interact with the website. JavaScript was created so that more dynamic websites could be created with more functionality.

LOGO – logo is used to help children prepare for programming, it’s very simple and teaches children the fundamental rules of programming that can be built on.

CSS - CSS is a programming language that is used to style web pages. It is similar to html but a little harder to learn. CSS has a downside which is making the web page cross-browser compatible.

Please note: I havn't had time to check over what i have written, please excuse me if there is a couple of mistakes.

Craig Confuseduperman
  Reply


Messages In This Thread
A couple of things about coding - by Craig - 05-10-2010, 12:08 AM

Forum Jump: