Beginning Programming All-in-One For Dummies. Wallace Wang
Чтение книги онлайн.

Читать онлайн книгу Beginning Programming All-in-One For Dummies - Wallace Wang страница 36

Название: Beginning Programming All-in-One For Dummies

Автор: Wallace Wang

Издательство: John Wiley & Sons Limited

Жанр: Программы

Серия:

isbn: 9781119884422

isbn:

СКАЧАТЬ into a Word document at a specific time each day, and then save your document.

      Transferring data among multiple programs

      Built-in scripting languages can help you automate or customize a program, but what if you use a program that doesn’t include a scripting language? Or what if you need to transfer data between two or more programs, but neither program uses the same scripting language? In these cases, you’ll need to use a scripting language that isn’t tied to any particular program, such as JavaScript, Perl, Python, or Ruby.

      When scripting languages link two or more programs together, the scripting language programs are often referred to as glue. So, if you have a web page that lets users type in their names, addresses, and credit card numbers, and a database program that stores customer information, you could use a scripting program to glue the web page to the database. The user would type information into the web page, and the scripting language would then yank this data off the web page and shove it into the database.

      By gluing programs together, scripting languages let you combine existing programs to create custom applications. Because scripting languages are interpreted rather than compiled, they can run on any computer with the proper language interpreter. So, whether you use Linux, macOS, or Windows, you can still use the same scripting language (and programs) on different computers.

      Creating stand-alone programs

      If you wanted to create your own program, you could write everything from scratch. So, if you wanted to include features of a spreadsheet and a database, you would have to create your own spreadsheet and database.

      Obviously this would be difficult to do, so by using scripting languages within existing programs, you can create custom programs that rely on the features of an existing program like Microsoft Excel.

      Now instead of writing a spreadsheet from scratch, you can use the features of the Excel spreadsheet and create a custom program based on Excel. This lets you reuse proven features of an existing program while letting you focus solely on writing the features you need.

      Stand-alone programs, based on existing programs, can simply make that existing program much easier to use. For example, Microsoft Excel is a powerful spreadsheet that many people don’t know how to use. By creating a stand-alone program based on Excel, your stand-alone program can gently guide users into solving problems without forcing them to learn Excel.

      Programming languages, such as C++, are general-purpose languages because they can literally be used to create any type of program from operating systems and word processors to antivirus utilities and video games. However, in the business world, the most common type of custom programs needed are those that store and retrieve data, such as invoices, inventory, customer information, and so on.

      Although it’s possible to write a database program in C++, that essentially doubles the amount of work you need to do. You have to write your program’s UI and commands for manipulating data and write commands to store and retrieve data, essentially creating a database program from scratch.

      Instead of rewriting (and testing) your own database program, it’s much easier just to customize an existing database program. Many database programs include their own programming language. By using a database programming language, you just have to customize the appearance of the database program by designing a UI along with commands for manipulating data. The database program does all the work of storing, retrieving, and rearranging the actual data so you can focus on what your program should do with data and not with the technical details for how it should store data.

      One of the most popular Windows database programs, Microsoft Access, offers the VBA scripting language. Of course, Microsoft Access runs only on the Windows operating system, so if you need to create database applications that run on both Windows and macOS, you can choose Claris FileMaker (www.claris.com/filemaker).

      Like Microsoft Access, FileMaker offers a scripting language: ScriptMaker. Best of all, you can create stand-alone versions of your FileMaker databases and sell them to anyone who uses macOS or Windows.

      

Many specialized database programs, such as medical office management programs or multilevel marketing programs, have been created using FileMaker.

      With so many different programming languages available, the question isn’t “Which programming language should I study and use?” Instead, the real question is “How can I become a better programmer and choose the best language for solving a particular problem?”

      Programming languages just offer different ways to express your ideas, and depending on what you need to accomplish, sometimes a language like C++ is best and sometimes another language like LISP may be better. The goal is to choose the best language for the job.

      Unfortunately, it’s impossible to know and master every programming language, so it’s usually best to focus on mastering two or three languages instead. The more you know about using a particular language, the faster and more efficient you can write programs in that language.

      

A mediocre programmer using a programming language designed for a specific job is likely more efficient than an expert programmer using an inappropriate language for that same job. Assembly language might create the fastest and most efficient programs, but if you need to write a program quickly and you don’t care about efficiency, a scripting language like JavaScript may be much easier, faster, and less buggy. Sometimes, a program that gets the job done now is preferable to a program that works ten times as fast but takes a million times longer to write.

      Programming Tools

      IN THIS CHAPTER

      

Choosing a compiler and interpreter

      

Using a virtual machine

      

Working with editors, debuggers, toolkits, and profilers

      

Getting a handle on source code

      

Creating help files

      

Using installers and disassemblers

СКАЧАТЬ