• 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
#2
"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."


Like VB6 then? :roll
[Image: Bulbasaur_by_bigsharn.jpg]
As you do...
  Reply
#3
C# is actually somewhat of a combination of C++ and Java. C++ was standardized in the 80's and all it really is is C with objective based programming. C came out of AT&T labs back in the 70's and is what was used to write the first widely used form of Unix. I personally find C# a disaster(for many reasons beyond the scope of this) and so I personally never use it. I prefer C over all others but if I am doing code where classes are of benefit to use I will use C++.
Assembly code or ASM is actually the first language I learned and so it is dear to my heart. It is a bit tedious but understanding it has been instrumental in making me a good functional programmer. Most rootkits/antirootkits programs are written in C and ASM so I still to this day use it with a fair amount of frequency.
Machine language does not take "years" to learn, it just isn't a very efficient means of accomplishing most tasks. The biggest issue with machine code years ago used to be that there is no standardization. In other words each different processor/chipset had a different set of instructions that you had to be familiar with. Usually to lessen the length of the code hexadecimal code was preferred over straight binary. In other words a number like 1,445,000 in binary would be "101100000110010001000" in binary and 0x160C88 in hexa. To this day machine code is still used especially when building compilers. The two most widely used "code sets" are IA64 for Intel and AMD64 for as you would guess AMD's chip sets.
As to your constants often times in C "character constant macros" are used in for C programs when you have a value that is used throughout to save on runtime computation, so generally your ideas are correct.
Am I to assume you are taking a computer science course Craig? Best of luck to you, let us know how your progress goes.
[Image: icpn5k.jpg]
Trolls are the last thing you need to be concerned with.

VCD Wrote:// Forever more, count and reply, bitch.
  Reply
#4
What are your reasons for disliking C#? The reason i'm currently learning it is because of the demand for C# coders in my area. I think it's a great language although i have only touched the surface really.

Yes i'm on a computing course and have had to learn binary (oh what a joy lol). I'm currently involved in creating a online multilplayer game which i have set for my next project. I'll let you know how things progress.
  Reply
#5
I notice that you skipped over about 40 years' worth of computer language evolution, Craig.

Out here in the real world, we still use COBOL extensively, along with all that supports it (JCL on the mainframe, shell scripting of various sorts elsewhere), although .NET and Java have both been making inroads over the past 10 years.

Object oriented languages, such as C# and Java, started to appear in the 1980s, but really didn't start to come to the fore until the 1990s. Prior to that programming followed the procedural paradigm (think of a program as one class with all attributes and methods public). COBOL was king in the business world!

By the way, I have worked in IT for 26 years, although I never studied CS at university (my degree was in maths). I wrote my first computer program (in BASIC) somewhere around 1975 or 1976, I think.

Mark (.NET developer wannabe, and UNIX/COBOL developer).

P.S. I recall using logo on an Amstrad PCW8256 in the 1980s. Classic piece of kit!
  Reply
#6
I didn't intend for a full overview on the computer language evolution, i did however simply provide a few points about programming to help the noobies. I'm sure you can write a much more in-depth tutorial then to provide coverage on the 40 years i have missed out, but i just don't have the time.

This tutorial is a quick overview about a few different things. Yes you may use COBOL a lot but compared to other languages it is nowhere near as common as it use to be, even you have got to admit it. Well it's not here in Manchester anyways i know that for a fact.

+ Java is the future i believe, what's your opinion on it? I'm currently creating a multiplaying game as a project using Java and am really enjoying it so far.
  Reply


Forum Jump: