Chapter 7 First let us know how to do things well
- To Create Extraordinary code, you must not only have skilled programmers, but also have useful tools and flexible tools.
- By using tools, you can see whether you can be called a really productive programmer. In extreme cases, these tools can provide simplified operations that determine whether your project is successful or not, the software factory's relentless advances require you to seize any tool that can help you write better code and write code faster and more reliably.
The tools we use to build software are diverse and may vary in the following aspects:
- Complexity: some tools are well-designed environments with many features and incredible configurability, while others are small tools designed for personal purposes.
- The frequency of use, some tools are used very frequently, and we cannot live without them, but some tools are used for a long time, but when you need them, they will find their value even.
- Interface, some tools have a very beautiful GUI, while some are just CLI interfaces.
- Integration. Some tools are suitable for large tool chains and are often included in an integrated development environment for graphical interfaces. Independent Command Line tools are mainly used as a data filter, tends to generate plain text output, and its output format is suitable for input by other tools.
- Cost: many free tools are excellent, but generally, the free tool documentation is poor and supports less.
- Quality.
- Get to know your frequently-used tools as much as possible. A little time invested to get familiar with these tools will soon reap some benefits.
- Tools not do what we should do for us, but make us have the ability to do our work. The quality of software is always dependent on the ability of programmers.
- One of the prerequisites for becoming a mature programmer is to understand that different solutions are required under different circumstances and apply the right tools to the right jobs.
- Treat software tools with a practical perspective-use them only when they make your life easier.
- We need to understand the types of available tools and make sure that you know where to live these tools, even if you do not need them now.
- Understand what it can do. Find out what its functions are, that is, what it can do, rather than what you think it should do.
- Learn how to control it. Just because you didn't make any mistakes when running a tool, it doesn't mean that it completes the work according to your requirements. You must understand how to use it correctly, but you can make it execute your command. Find the best way to use each tool.
- Understand what task it is suitable. Understand how each tool is integrated into the environment of other available tools, use the appropriate tool in the appropriate task, do not take the ox knife to kill chicken.
- Check whether it is available. Everyone may be the victim of a bad tool at a time. It is very useful to have the source code of your tool to diagnose any problems you encounter.
- Find more information. You don't have to worry about everything. The key is to get to know people you understand.
- Find out when the new version appears.
- The number of tools is staggering, and the speed of growth is fast. What tools are included in your toolkit depends on your job type.
Source code editing tools include:
- Source code editor. It may be your most important tool, more important than the compiler. You should select an editor that is comfortable to use and can complete your tasks.
- Source code processing tool.
- Source code browsing tool.
- Version control.
- Source code generation tool.
- Source code beautification tool.
Code building tools include:
- Compiler.
- The linker. For Java and C #, the linker is combined with the runtime environment.
- Build Environment,
- Test tool chain. A test tool is a code build tool, not a debugging tool.
Debugging and investigation tools include:
- Debugger. Having a high-quality debugger and learning how to use it can save you a lot of development time for tracking unexpected behavior. All IDE and tool chains have their own debuggers.
- Analyzer. Analyzer is used to analyze the running time of each part of the code and identify the bottleneck.
- Code validator. There are two types of code validators: Static and Dynamic. The former organizes the code in a way similar to the compiler and checks your source files to determine the areas where problems may occur and the language is incorrectly used, for example, Lint; the latter modifies and installs the code when the code is compiled, and then performs a check at runtime, such as the memory allocation/Boundary checker.
- Measurement tool. They generate statistical evaluations on code quality to effectively point out the most vulnerable code areas, which are usually collected based on functions. The most basic metric data is the number of lines of code, the second is the ratio of comments to codes.
- Decompile the program.
- Defect tracking. Provides a shared database that contains tracking records of bugs found in your system.
Language Support Tools include:
- Programming language. Language itself is also a tool. When you have mastered several languages, each language will teach you a different way to solve the problem, consider the language as a tool, and select the most appropriate language for each task.
- Runtime and interpreter. Most languages cannot be used without the required runtime support.
- Components and libraries.
Other tools include:
- Document tools. Good documentation is very valuable and is a key part of well-designed code. Documents must be written and read. A good online help system is very important.
- Project Management. You can report and track the progress of your work, manage defects, and monitor the performance of your team.
- When we cannot find the right tool for a task, but it seems sometimes impossible to do it manually, we can use a self-designed tool if the task repeats, short-term tool development can save you a lot of time in the long term.
Tools can be created in the following ways:
- Combine existing tools in a new way.
- Use the script language.
- Create a complete program from scratch.
When writing a tool, consider the following factors:
- Users' expectations.
- Whether an existing tool can be expanded.
- Any programmer should have the following minimal tool sets: 1. Some form of editor; 2. required minimum language support; 3. Computers that run these tools.
- An efficient toolbox for programmers generally includes at least: 1. Code version control system; 2. A set of better libraries; 3. A build tool.
- A professional and responsible attitude towards your toolbox will make you a better programmer.
- Excellent programmers: 1. willing to learn how to use an appropriate tool at a time, rather than repeatedly performing a tedious task; 2. understand different tool chain models, and each of them feels comfortable to use. 3. use tools to make their lives easier, but they will not become slaves of tools; 4. use everything they use as a tool, a tool that can be replaced; 5. very efficient, because they are second-nature to the use of tools.
- Bad programmers: 1. measure the test taker's knowledge about how to use some tools and view all the differences from these tools. 2. fear of spending time learning new tools; 3. I have been using a development environment from the very beginning, and I have never tried to change it, or even try to understand other development environments. 3. when encountering a valuable new tool, it is not added to their toolbox.