Friday 11 July 2014

UNIT 20 P3 - Explain the Fundamentals of Scripting Language



UNIT 20 P3 - Explain the Fundamentals of Scripting Language




INTRODUCTION
A computer program is created with the use of a specific language, most Microsoft products would use Visual Basic and their BASIC language, some software’s will interpret CSS. Websites also adhere to the use of a language for it to be used, we know that the basis of a website would use HTML, this code would be enough to show the most simplest of things or even go more in-depth, but it looks boring and not very appealing. The use of CSS will make this of what we see of WebPages on the World Wide Web. CSS will need the use of scripting language, this language type allows for scripts to be used and so colour, movement placing and general settings can make a webpage that little bit better.

Scripting language is unique in that it can be examined and understood in a different file, this is clearly seen when you use external CSS, where you would place the scripting language on a separate CSS style sheet and then link it to whichever page would require the CSS, other languages you would find they would need to be placed within an executable file to work. The use of scripting language allows for vast interaction including Java scripting which makes for a whole new way of using WebPages. 



VARIABLES
Variables is something that will always change, it can never stay constant, depending on which programming the language is used and which software it is used for, a variable can be a beneficial add-on. Take the use in scripting language, in a script you are able to use JavaScript which can use variables, if you look at the example above, a variable can be described to be a container that holds a value. You can then assign the variable a certain name, when you use the variables together like the example above adding, you get the end result being the correct value. If you take it in Algebra terms, the boxed labelled “number1” can represent A, “number2” can be B, the “answer” box can be C. You would then apply coding to make it so that a + b = c, this would then allow for greater development chances, you don't have to do numbers but you can say implement the use of variables in website for say creating forms, two filled fields can then auto fill other fields. 


LOOP
Just as it is named, loops are continuous. In programming terms they are too the same although they loop until a task/limit is reached the program sequence ends and an event occurs. So if you look at the diagram above, it shows what will happen during the sequences, as the process starts you will reach a speed bump where the program will check to see if the condition the sequence is in currently is still there, then the sequence will loop back and constantly do this still at the point of the speed bump, the condition has been met and the sequence and loop can end. The condition can be 2 ways, there is a loop called the “do/while” loop. This loop requires the sequence to run continuously until a set limit has been met, for example if the sequence is a calculation which will keep adding itself with say the previous number has been made, and you want that sequence to end after a certain value then that can happen. The other loop is called “for/else”, this loop will require a set number set by the programmer to occur, it will then do it automatically depending on the set loops it has told to do, for example if the sequence was told to loop 5 times and multiply each number by 2, then it will loop the five times multiplying 2 by each number constantly, which would then leave an answer of 32. Loops are a good programming fundamental because it allows for a event to happen on its own without the need of a user being on hand to control it, you put in the details and it does the rest.


DECISION MAKING
A program is able to be developed in such a way that it is non linear and can go off in multiple parts. Sometimes programs are set to do a single job and that would be it, a more advanced program would be able to perform multiple tasks depending on how the user got to the stage.  The figure above is a good example of what a decision type of program is able to be made. This is all done through the use of a simple statement dubbed the “if” statement. The “if” statement suggests that when asked a question, if there is a corresponding event that can sway the result then it is that, that become the eventual result. With a program you are able to use multiple “if” statement o create a number of branches and thus creating lots of different events and end results. The logic of this structure will check the environment to see if it meets a requirement and then correspondingly create an outcome depending on that. It will go down a list of the set “if” statements and see which one matches the requirement and follow it down like a tree, it is this that can separate a simpler program to a more complex one. This is greatly used in websites because if you look at forms that people might need to fill in, some fields may require a person to fill in, if for some reason doesn't match the requirements such as not being filled in, the designed can then set an event like a message or page reload with a message  to notify the user.



FUNCTIONS
Functions are used to create a sequence that a person has to carry out to get an end result. It can be found in normal programs, each button clicked or even in an GUI operating system such as Windows, you would be faced with functions created by developers. There are a fair bit of functions that can be used, one is “calling”. This function is one that is typically seen and JavaScript can also benefit from this, what it does is it allows a person to initiate a click or action that will then correspond with a response like a popup window such as the one in the picture above. There are a number of websites who use this in order to get an event that the user is able to see take action on. Again this is useful when a person is using a website and the creator needs them to understand something if they have done something such as incorrectly filling a form, the popup can make the person take action seeing that come up face.


<DIV ALIGN="LEFT"> HANDLING EVENTS </DIV>


A typical program contains elements, this is something that is programmed to create an event when handled. This is easily noticed on WebPages with scripts, with WebPages you are able to script certain events. Take a navigation bar on WebPages, you would find that these are HTML elements that are anchor tags linked to various pages of the websites. When you proceed to click each of them, you could find that they might change colour when clicked or even when you just place your cursor over the button, you could find a change that happens. One noticeable change that Windows have incorporated is that the mouse cursor will change to a significant point type with a hand, like you would be handling events. The image above also shows a add-on of the browser Mozilla Firefox, a person has created through scripts the ability to pop-out images on the popular Facebook website. Any image on that webpage will be subject to the event, as a person who would have downloaded/installed the add-on and were to go on Facebook, any image they just simple hover over would produce a pop-out of the image in larger form.



METHODS 
Programming can be done in many different ways, it all depends on the creator and how they feel comfortable, the good thing is a program can be created in multiple ways but still come out with the same result. There are different ways in which a programmer can make their program used, you may need to write something in for the program to work, or use a mouse to click or even to select. A programmer would have to create his software from the ground up, this means that they understand their code more better then anyone else, sometimes a programmer would take other people into consideration so that if something were to happen, an equal know ledged programmer would understand through comments and naming elements with certain ID or names. Having this can also reduce problems, if there were to be a mistake a simple comment suggesting this might need to change in the future can be something that would reduce time needed having to actually go and find the problem. Naming helps with the CSS parts in WebPages, a designer would typically pick external CSS and apply every page to link with it, if every element is named properly then the whole situation becomes easier and more CSS can be applied.



1 comment:

  1. πŸπŸš‘NaM πŸšœπŸš“πŸš›πŸš•NaM πŸššπŸš—πŸŽπŸšœπŸš“πŸNaM πŸš•πŸšœπŸš•πŸš›πŸš•πŸššπŸš—SORRY FOR TRAFFIC NAM πŸš•πŸšœπŸš•πŸš“πŸš›πŸŽπŸš‘πŸš’NaM πŸš“πŸπŸš“πŸšœNaM 🏎🏎🚜NaM πŸŽπŸšœπŸš“πŸšœNaM πŸš‘πŸš‘NaM πŸš—πŸš—πŸššNaM πŸš—πŸŽπŸŽπŸššπŸš›NaM πŸš“πŸšœπŸš•πŸšœπŸš™πŸNaM πŸš™πŸπŸšŒπŸš²NaM πŸšŒπŸšπŸšŒπŸš’NaM πŸšŽπŸš’πŸš™πŸš•πŸš•πŸš‘πŸπŸš“πŸšœπŸš›NaM πŸššπŸššπŸš—πŸš—πŸšœπŸš“NaM πŸš‘πŸš’πŸš‘πŸš²πŸš’πŸš²NaM πŸšŽπŸπŸšŒπŸšœπŸš™πŸš›πŸš•πŸššNaM πŸš•πŸššπŸš—πŸŽπŸπŸš“πŸπŸš“πŸš“πŸš“πŸπŸš’NaM πŸš’πŸš•πŸš•πŸššπŸššπŸŽπŸšœNaM πŸš“πŸš“πŸš“πŸπŸš‘πŸš‘πŸš’πŸšŒπŸπŸšœ

    ReplyDelete