Several aspects that need to be paid attention to when publishing Delphi code
I have been learning Delphi for a long time, and one of the important ways is to read other people's code. This inevitably means downloading the source code from the Internet. But when I downloaded it, I found that there was such a large and excessively compressed package. It makes people laugh and cry. The following is Here are my personal opinions on what you should pay attention to when publishing code:
1.Documents must be complete.
This is the basic requirement for publishing code. You must ensure that others can open and use it after downloading it. If you download a copy of the code, it is either missing controls, missing modules or missing databases. Haha, no one should be happy. So in Before compressing and uploading, you must ensure that you can open, compile and run the file smoothly. However, the completeness here does not include bugs. If there are bugs that you are not aware of, I believe everyone will point them out. And if you think there are technical problems If there is an unidentified bug, you might as well post it so everyone can discuss it.
2. Reduction of unnecessary files.
While it is complete, it needs to be streamlined. A few tricks may be involved here.
After writing the Delphi source code, you can take a look. A large number of backup files with the extension ".~*" will be generated in the saving directory. If such files appear in your compressed package, it is really a waste. Responsible behavior. Although this kind of file is usually not very large, after all, not everyone uses broadband to access the Internet (sorry, I have never seen a cat, so I won’t say more here)!
Generally speaking, you can follow the following laws:
In the directory where the project is saved, any icons that are not recognized by Windows will be deleted.
The following files are generally retained:
.dPR
.pas
.dfm
Of course, if there are files you need in your file, they must be kept. Such as the database mentioned below. Then there are the resource files used and the required ini files, etc. And the icons and pictures used in the program It is generally not necessary because Delphi will be saved in the dfm in binary form. If you still keep it, it will just take up a certain amount of space.
As for whether to keep the generated exe file or delete it, it depends on your personal opinion. For example, when I look at a presentation document, I usually like to look at its exe first. If it is worth looking at, I will look at its code, otherwise I usually It will go to the recycling bin to wait for the end of its life.
3. "Peripheral equipment" is fully equipped.
If you use a third-party control, and this kind of control is not so commonly used or even unknown (of course, you may not need to bring it at the level of flatstyle), then you must bring it in the compressed package. .Of course, you can change it appropriately, as the original control Delete the help.demo etc. that can be deleted to ensure the compactness of the compressed package. Another example is the source code of the database. If there is no explanation, you should bring the mdb, db, etc. used. But it is not recommended that you maximize your own That is compressed to prevent too much saliva from being pressed along with the mail.
4. It is best to have a brief description.
This is a matter of habit. A brief description can help readers better understand the content, key points, etc. of the example. For the included content, please refer to:
Instance name
author
Completion year and month
platform environment
Example introduction
Technical characteristics
Files included in the compressed package
Copyright statement
Contact information
Wait wait wait
Of course, no one objects to you bringing a little bit of advertising (the kind that promotes yourself or public service announcements).
5. The last thing is safety.
The last thing I say is not the least important, on the contrary. You must ensure the security of the compressed package. If possible, you should kill the virus separately on two computers that are not connected to the Internet. Anyway, I suffered a completely low level. It’s painful, so I advise everyone to put safety first! Everything you download must also be carefully disinfected.