|
Scripts are individual sequences of actions created to automatically perform a task. If there is no ready-made script, the user performs these steps manually, with associated time costs and the possibility of errors.
To write scripts, special programming languages are used, which are called scripting languages. Accordingly, a scripting programming language is a set of lexical, semantic and syntactic rules for creating and editing scripts. The synonymous name “scripting language” is also correct.
History of script development
Let's take an example of the history of the development of the most common scripting language, JavaScript. It is with its help that many solutions for user interaction with websites are implemented and the wide capabilities of interactive pages are programmed.
In 1995, Netscape offered a special language called LiveScript for its popular browser at that time, Netscape Navigator 2.0. At that time, the language capabilities were very meager, and many simply did not understand what a script was in a browser. Then he could check and process the data that the user left on the site page through the form. This check made it possible to control the correctness of the entered data and avoid submitting the form without the necessary information. Soon the name of this language was changed to JavaScript.
After some time, Netscape's well-known competitor, Microsoft Corporation, created its own version of JavaScript. Despite the fact that this scripting programming language had slightly different functions, it successfully took root and received its own name JScript. It began to be used in the Internet Explorer browser starting with version 3.0. After some time, other browsers began to support JavaScript.
Over time, the language has developed and improved, and now it can be used to successfully solve much more complex problems. The JavaScript interpreter is a built-in element of all modern browsers.
Despite fierce competition, Microsoft and Netscape, along with the most reputable developers of Internet software, worked in the W3C organization. As a result, uniform standards and recommendations were prepared. But still, the JavaScript and JScript languages have certain differences that must be taken into account in their work.
Basic principles of scripts
The JavaScript interpreter is built into all popular browsers. That is why any browser understands what a script in this language is. These codes are successfully executed at the moment when the user accesses the site pages. But the same scripts can work successfully on the server if a JavaScript interpreter is installed on it. Scripts can be executed either on the client side, in the browser, or directly on the server.
The scripts have the following purposes:
• SEO scripts (templates) for website promotion. Typically, they operate specialized programs to automate this process. The most famous are ZennoPoster, Human Emulator;
• systems for collecting visit statistics (attendance counters). These scripts are most often created using JavaScript;
• scripts for accessing databases. PHP is the leading language here;
• scripts for operating guest books and creating comments on posts. The most commonly used combination is PHP and JavaScript;
• scripts for dynamic display of sites. In this case, the scripting language is determined by the CMS writing language;
• scripts for changing part of a website page without reloading it. Ajax technologies are used for implementation. In this case, asynchronous JavaScript and XML come to the fore. Web applications exchange data with the server in the “background”; changes on site pages occur without completely reloading them. Users usually don't notice such changes, and they don't need to understand what a scripting programming language is to interact well with the site.
Benefits of scripts
1.
Their use makes it possible to make program changes without fear of destroying the entire system. If the script is written with an error, then when it is executed they will be displayed as a result. At the same time, the site will remain operational.
2.
Using scripts makes it possible to obtain a problem-oriented set of commands. In this case, one line of script can perform the same amount of actions as a program of many dozen lines in a compiled language. This example clearly shows what a script is in programming and how its use speeds up problem solving.
3.
Using scripts, cross-platform execution of tasks is successfully implemented. An excellent example is JavaScript - the same scripts in this language can be executed without problems in browsers on different operating systems.
Disadvantages of scripts
1. Noticeably longer execution time. In almost all cases, interpreted scripts require much more time and computer resources to complete.
2. Until now, a high-quality IDE-level development environment has not been created for such languages.
3. Insufficient funds are invested in the promotion and advertising of these languages. Paradoxically, the relative accessibility and conditional freeness of scripting languages lead to the fact that developers simply do not have enough funds for marketing and advertising. Therefore, for many large money projects, Java or C# are chosen.
Types of scripts
Based on their speed, they are divided into dynamic parsing languages (sh, COMMAND.COM) and those requiring preliminary compilation, such as Perl. Scripting languages are also divided into several large groups based on application.
• command-script (JCL, sh, bash, csh, ksh, AppleScript, COMMAND.COM and cmd.exe, VBScript);
• applied (AutoLISP, JScript, JavaScript, ActionScript, Game Maker Language, VBA, etc.);
• universal scripting (Tcl, Lua, Perl, PHP, Python, REBOL, Ruby).
Examples of scripting languages
The most famous: PHP, Perl, Python, AngelScript, JavaScript, JScript and others. All of them are high level. By their mechanism of action, scripting languages are usually interpreted rather than compiled.
Using JavaScript in contextual advertising
Back in 2012, the Google AdWords advertising system introduced into its interface the ability to use scripts to automate the management of an advertising campaign. This management method is much faster than using the API.
In addition, it does not require the use of complex programming languages. Script-based tasks run according to a schedule. They ensure regular account checking, make it possible to analyze advertising statistics and make any desired changes.
At the same time, you can automatically monitor the quality of advertisements, disable ineffective advertising channels and connect effective ones.
|