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

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

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

Автор: Wallace Wang

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

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

Серия:

isbn: 9781119884422

isbn:

СКАЧАТЬ multiple files simultaneously.

      Hardly anyone reads software manuals, so when people need help, they typically turn to the program’s help file for answers. This help file is essentially the software manual organized as miniature web pages that you can view and click to see similar (linked) information.

      Almost every program has a help file, but creating a help file can be tedious and time-consuming. So, to simplify this process, many programmers use special help file creation programs.

      Just as a word processor makes it easy to write, edit, and format text, help file creators make it easy to write, edit, organize, and link text together to create a help file.

      Before anyone can use your program, they need to install it. Some programs are simple enough that the user can simply copy it where they want to store it. However, most programs consist of multiple files that may require creating new folders to store data or allow access to the Internet.

      Installation programs simply automate the process of storing a program on a computer to make the process as simple and easy as possible. This may include adding shortcuts or icons to the computer for faster access to running the program.

      Even if a program is simple enough to be copied as a single file, it’s usually best to use an installation program to install that program instead. That way you can be certain all files are copied in the correct location.

      A disassembler acts like a reverse compiler. A compiler converts your program (written in any programming language, such as C++ or Swift) into machine language; a disassembler takes an executable file (which contains machine-language code) and converts it into assembly language.

Disassemblers can’t convert machine language back into its original source code language (such as C++) because disassemblers can’t tell which programming language was originally used. An executable file created from a C++ program looks no different from an executable file created from a Kotlin or Swift program. Therefore, disassemblers can only convert machine language into assembly language.

      Disassemblers have both honorable and shady uses. On the honorable side, antivirus companies use disassemblers to dissect how the latest viruses, worms, and Trojan horses work. After they know how these nasty programs work, they can figure out how to detect, stop, and remove them.

      On the shady side, many companies use disassemblers to tear apart their rivals’ products and see how they work. After you know how a competitor’s program works, you can copy those features and use them in your own program.

      Programming languages, such as C#, Java, and Visual Basic .NET, get compiled into bytecode format; therefore, a disassembler can reverse-compile a bytecode file into its original source code. So, if you compile a Java program into bytecode format, a Java disassembler can convert the bytecode file into Java source code. Likewise, if you compile a C# or Visual Basic .NET program, you can disassemble that bytecode file into its original C# or Visual Basic .NET source code.

      To protect their bytecode files from disassemblers, programmers use another program called an obfuscator. An obfuscator essentially scrambles a bytecode file. The bytecode file can still run, but if other people try to disassemble an obfuscated bytecode file, they can’t retrieve the original source code.

      

If you use a programming language that compiles into bytecode (such as C#, Java, or Visual Basic .NET), consider using an obfuscator to protect your source code from prying eyes.

      At the bare minimum, all you need is an editor (to write programs) and a compiler (to convert your programs into executable files). However, most programmers use a debugger, version control software, and an installer. Although most programmers are happy when they can get their programs to work, some programmers use a profiler to help them speed up and optimize their program.

      Finally, some programmers use disassemblers to peek inside the inner workings of other programs, such as viruses or rival software. Disassemblers are never necessary for creating a program, but they can prove useful for legal and not-so-legal purposes.

      The tools of a programmer are highly subjective. Some programmers swear by certain tools, such as their favorite editor or compiler, whereas others are happy with whatever tool is available. Just remember that programmer tools can help you write faster and more reliable programs, but the best tool in the world can never substitute for decent programming skills in the first place.

      Programming Basics

      1  Chapter 1: How Programs Work Using Keywords as Building Blocks Organizing a Program Dividing a Program into Subprograms Dividing a Program into Objects Creating a User Interface

      2  Chapter 2: Variables, Data Types, and Constants Declaring Variables Using Different Data Types Storing Data in a Variable Retrieving Data from a Variable Using Constant Values Defining the Scope of a Variable

      3  Chapter 3: Manipulating Data Storing Data with the Assignment Operator Using Math to Manipulate Numbers Manipulating Strings Finding Strings with Regular Expressions Using Comparison Operators Using Boolean Operators Converting Data Types

      4  Chapter 4: Making Decisions by Branching СКАЧАТЬ