Friday, 21 November 2014

Benefits Of Data Types (Unit 06)

There are many different data types that are available for programmers to use and I will explain and give examples of why some of these data types are useful to programmers.

String - This is a very useful data type as it can hold multiple characters without having to use the data type char for every character, when using the data type String you must use quotation marks.

String sName=”Bob”;  <----- The string is Bob

Integer - This is one of the most commonly used data types, the definition of an integer is a whole number. Using integers in programming can prove to be useful when writing programs as a lot of programs are used to perform mathematical sums.

int iAge=10; <---- The integer is 10

Char - This data type holds a single character, this can be used if you want to search for single characters rather than a sequence of characters creating a string. When using char you must use quotation marks.

char cFirstLetter=”B”; <---- The char is B

Double -  This data type is normally the default choice for decimal values. This means it is similar to the integer data type however it has a decimal afterwards.

double dDecimalNumber=10.53;

Boolean - This data type can be used for creating a true or false statement as those are the two values a boolean can have. This tracks true/false conditions and represents one bit of information.

boolean b1 = true

Choosing A Programming Language (Unit 06)

Factors that may influence the choice of a programming language


There are different factors in programming language, such as; organisational policy, suitability, availability of staff, reliability, development, expandability and maintenance costs.

Organisational policy - Companies have an organisational policy as to what programs they are going to use. It is also important to think about platforms that the language can run on. For example, Apple industries have a policy to only use Apple software.

Suitability (Features & Tools) - Different programming languages offer different features and tools, this is due to each language having it's own integrated IDE. Certain tools and features can benefit and speed up programming so it is best to choose the programming language that best suits your needs.

Reliability - When choosing a programming language it is best to think about how reliable it is and the possibility of it crashing. A language that is not very dependable is unlikely to be chosen as it is best to have a reliable program. Depending what environment the program is being used the reliability of the programs being used may vary, an example of this is on an airplane. Programs being used on an airplane are required to be as reliable as possible as failures could cause death for passengers.

Availability of trained staff - It is important to consider the fact that there may be existing staff that have previous training in certain programming languages. This is important because if they were to ignore this and choose a different language it would lead to extra costs that may not have been necessary. 

Costs - When programming you should be immediately aware of the costs. These costs can consist of development costs, maintenance costs, wages, software price and time. The cost of developing a program can vary vastly depending on what programming language the programmer has chosen, when considering the costs one should take into account the IDE of a programming language as the program with the better IDE for the situation is likely to be better and more cost efficient.

Expandability - When choosing a programming language it is important to consider the size of the organization you are creating the program for. Some programming languages cannot support many simultaneous users whereas other can support thousands. 




Application and Limits (Unit 06)

Application and limitations of Procedural, Event Driven and Object Oriented programming


Procedural

This is programming that is structured and it works step by step, it requires a sequence of steps in order to make it work. This allows it to tell the computer when certain steps need to be done and in what order. Examples of procedural programming languages are C, Pascal and BASIC.

Application: Procedural programming can be used to help solve calculations for scientific and engineering uses.

Limitation: Once details have been modified it can be very difficult to change those details due to the layout. This requires you to go through the whole program to find what you are looking for.

Event Driven

This is programming which allows programs to respond to many different events. The flow of the program is determined by the events that occur. These events can occur due to input devices, sensors and timers. These can generally be made using any programming language but benefit certain programming languages more than others.

Application: Event driven programs are interactive programs which are very important for user based programs as most modern GUI programs use event driven programming.

Limitations: Event driven programs often require large amounts of processing power due to constantly active loops.


Object Oriented

This form of programming is based around objects rather than actions, data and logic. These objects are data structures that contain data in the form of fields. An objects procedures can access and modify data within fields. Most object oriented languages are class-based which means that objects are instances of classes  which typically determine their type.

Application: It is easier to change codes and modify them. This encourages programmers to code in classes so the code is less directly accessible by the computer system. The data is accessed by calling specially written functions which are methods.

Limitations: Object oriented programs are typically larger in file size due to a large amount of code needed to make standard applications. This means they are likely to run slower and require more memory.