Beginning Programming All-in-One For Dummies. Wallace Wang

Beginning Programming All-in-One For Dummies - Wallace Wang


Скачать книгу
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

      The two most important tools a programmer needs are an editor and a compiler. An editor lets you type and save language commands (called the source code) in a plaintext file. (Unlike a word processor file, a plaintext file doesn’t contain any formatting, like italics or fonts.) A compiler converts your source code into machine code and stores those machine code commands in a separate file (often called an executable file). After you store your program in an executable file, you can sell and distribute that executable file to other people.

      An editor and a compiler are absolutely necessary to write and distribute programs. However, most programmers also use a variety of other tools to make programming easier. To help them track down bugs (problems) in a program, programmers use a special tool called a debugger. To help them identify which parts of a program may be making the entire program run too slow, programmers can use another tool, called a profiler.

      For distributing programs, programmers often use a help file creator and an installer program. The help file creator makes it easy for the programmer to create, organize, and display help that the user can read while using the program. The installer program makes it easy for users to copy all the necessary files on to their computer so the program runs correctly.

      In many cases, programmers use an integrated development environment (IDE) that combines the features of an editor with a compiler and a debugger. That way, they can just use a single program to write, debug, and compile a program, instead of relying on two or more separate programs.

      

Programmers often get so attached to their favorite programming tools that they argue the merits of their favorite editor or compiler with all the passion of a religious fanatic. Just as there is no single programming language that’s the best language to use at all times, there is no single programming tool that’s the best tool to use all the time.

      No two compilers work exactly the same, even compilers designed for the same language, such as two competing C++ compilers. It’s perfectly possible (and quite common) to write a program that works perfectly with one compiler but doesn’t run at all under another compiler without minor (or massive) changes.

      When Microsoft wrote the Mac


Скачать книгу