使用 print 语句来调试代码怎么称呼?
我只是好奇,但是使用 print 语句调试代码的过程有名称吗? 中的一个例子
x=3.2e39
print x
y = function1(x)
print y
z = function2(y)
print z
w = function3(z)
print w
伪代码执行
3.2e39
3.2e36
NaN
NaN
:揭示了 function2 中一些糟糕的数学。如果没有标准名称,你怎么称呼它?
I'm just curious, but is there a name for the process using print statements to debug your code? An example in pseudocode
x=3.2e39
print x
y = function1(x)
print y
z = function2(y)
print z
w = function3(z)
print w
Executation:
3.2e39
3.2e36
NaN
NaN
reveals some bad math in function2. If there's no standard name, what do you call it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它通常被称为“printf 调试”,即使在 C 函数之后没有使用名为 printf 的东西。这实际上是一种简单的日志记录形式,您可以使用各种名称来实现这种效果。
在具有上面所示的 print 语句或函数的语言中,“打印调试”就足够清楚了,而无需向从未使用过 C 或类似函数的人解释 printf。
It is often called "printf debugging", even if something named printf isn't used, after the C function. It's really a simple form of logging, and you could use various names to that affect.
In a language that has a print statement or function as you showed above, "print debugging" would be clear enough without having to explain printf to someone that's never used C or a similar function.