Translation notice
This page was translated with machine translation and may contain inaccuracies. If you can help improve it, please open an issue or submit a pull request.
Why is it not recommended to use command block development?
by Xuanyu1725
First of all, we might as well look at the command block objectively. It does have many advantages, such as simplicity, ease of use, and conspicuousness. The Bedrock version also comes with a delay function, which is undoubtedly a great help for beginners.
Indeed, it is very convenient to use command block when you are just learning, and no one will stop you from using it. However, as the complexity of the work increases, its shortcomings will inevitably be exposed. At this time, it is meaningless to emphasize its convenience. This is why I do not recommend it:
security
If your work is based on a large number of command blocks, then you definitely don't want your command blocks to be missing.
However, the command block is difficult to back up. Even for backup, you need to place the block in the world (if you are backing up commands in text form... then why don't you just use data pack). These blocks can be easily knocked out by others (or yourself). Unless you install a specific plug-in or module, this operation is difficult to restore.
I once participated in the development of a project with Ethan, and the planner rejected our proposal to use data pack because he did not understand data pack. So we used the command block for content production. However, during the production process, someone entered the server, knocked out all the command blocks, and then placed a "kill @e" loop command block, which invalidated all the previous content. Of course, in this case, if the server is good at backing up, or if we hold a copy of the command ourselves, we can avoid losses to a large extent. However, the maintenance efficiency of command block security is still far less than that of data pack. The latter can be easily replicated in an editing environment, or erroneous changes can be retracted, not to mention projects based on remote repository maintenance.
maintainability
The command block is not intuitive. Without installing a specific plug-in or module, you must open the command block to see its contents. Compared with data pack, where you can clearly see dozens of lines of instructions arranged in an orderly manner from top to bottom when you open the file, command block can almost be said to open a blind box. Many people will post notices on the command block as comments, but it is still difficult to "take ten lines at a glance". You have to move next to the command block to see the relevant comments. (Not to mention that the command block can only display a small part of the entire command sequence in the pure version)
In actual development, many authors choose to hide their command blocks, which creates problems such as the need to record the location of the command block and how to arrange the direction of the command block chain. Data pack can arrange your project in a clear file hierarchy. By naming it appropriately or using function tags (tick, load), other developers (including yourself) can easily find the entry and easily read the project logic.
At the same time, the command block must be loaded before it can be used, and it cannot be edited without opening the game. These various characteristics determine that the command block is not a stable development tool.

performance
As a blockentity with complex functions, the space occupation and performance consumption brought by the command block cannot be ignored (some authors even need to cooperate with a large number of redstone circuits to implement relatively complex logic). The performance consumption of the command block will become very significant when the project grows to a certain extent.
According to personal test results, the command block takes at least 80 times as much to run the scoreboard command as the data pack to run the same command (since the scoreboard command occupies a very small space, it is suitable for performance testing. I executed 10,000 virtual player bonus points commands per tick here), and a large number of command blocks will bring considerable rendering pressure.


(The red part in the chart represents the CPU time consumed by one tick, and the upper boundary of the white box represents the minimum time required to maintain the server at 20 ticks per second, less than 50ms)
portability
Command block is relatively difficult to transplant. Vanilla command block can be exported by using one-click command block technology or using structure block. The data pack can be easily exported, distributed and installed into different maps. You just need to compress/decompress the file. (Also, it is difficult to confirm the safety of command block transplantation. The only way is to hard-read the instructions of each command block in the one-click command block, or use the nbt browsing tool to check the structure)
Advantages of data pack
data pack - to be precise, the nature of the function determines that it has a series of functions that the command block cannot do. For example, features such as macro function, function tag, and line continuation characters, as well as merging executors by inheriting the instruction context to avoid the extra cost of repeatedly traversing the entity. Generally speaking, even if the consumption caused by the command block itself is ignored, the performance of the architecture based on the data pack design is often better than that based on the command block design. When developing some slightly complex logic, the development efficiency of using data pack is better than that of command block in most cases.
Application scenarios of command block
Of course, this does not mean that command blocks should be abandoned in all cases. The biggest advantage of command block is convenience. The scenario where I use the command block most often is when I need to immediately check whether a long command can get the expected results. Sometimes in some more casual scenarios, I will also use the command block as the entry point of the function, because in these scenarios, it is completely unnecessary to specifically arrange operations such as a data pack response button. Although command block has its convenience in some cases, in most formal development scenarios, data pack is still a better choice.