习惯于从wiki中查找一些计算机专业用语的定义,以下为我找到的对hardcode的相关定义,利于理解
Hard coding (also, hard-coding or hardcoding) refers to the software development practice of embedding input or configuration data directly into the source code of a program or other executable object, or fixed formatting of the data, instead of obtaining that data from external sources or generating data or formatting in the program itself with the given input.
还有一个从网上摘录的定义:
举个例子,对于n-皇后的问题,如果,你在编写程序的时候,制定queen_number =6,那么你的程序就是hard coding;
然而,如果,你的程序的queen_number需要用户输入的,例如cout<<"please input queen number"<
>queen_number;这样就不是hard coding。,也好像是#definie NUMBER 6这样的用法
不知道是否理解正确,请大家指正^_^
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/228401.html原文链接:https://javaforall.net
