The invention provides a code reuse method and device. According to the method, after a code reuse command is received, a code reuse module corresponding to a code identifier in the code reuse commandis acquired from a pre-established code reuse library, and the code reuse module is loaded. By inputting the code reuse command, a code needing to be reused can be found, and the code is loaded afterbeing converted according to designated rules; and since the operation of manually copying the code does not exist, the problem that a compiling error is caused by omission of a part of the code in the copying process is avoided, simple operation of code reuse and improvement in writing efficiency are realized, code reuse is centralized into the code reuse library, centralization of data is realized, and the situation that the data is distributed in all programs and is uneasy to manage and retrieve is avoided. Code styles are unified in the code reuse library, one modification can be used atmultiple positions, and maintenance cost is reduced.