• 请不要在回答技术问题时复制粘贴 AI 生成的内容
red13
V2EX  ›  程序员

你们撸代码还在 debug 调试吗?

  •  
  •   red13 · Oct 15, 2025 · 3072 views
    This topic created in 384 days ago, the information mentioned may be changed or developed.

    我在十年前主要写 java ,经常 debug , 在六七年前写过一段 C ,用 gdb debug 被搞得焦头烂额, 现在写 rust 和 nodejs ,几乎全都是 println 和 console.log 了,几乎不 debug 了

    dbit
    dbit
    Oct 15, 2025 via iPhone
    1
    nodejs debug 很方便
    Ackvincent
    Ackvincent
    Oct 15, 2025
    2
    console.log 也是 debug 的一种啊,又不是只有打断点才算。
    wniming
    wniming
    Oct 15, 2025
    3
    用啊, 比如调试 linux 上通过包管理器安装的层序可以不用自己编译, 而且 gdb 有 debuginfod, 连调试符号都帮你自动下载匹配好了.
    JYii
    JYii
    Oct 15, 2025
    4
    这不是一样吗,debug 断点看代码跳转、变量值,print 打印出来看而已。
    John0227
    John0227
    Oct 15, 2025
    5
    写 php 从来不 debug
    dog82
    dog82
    Oct 15, 2025
    6
    熟练使用调试器是合格程序员的标志,特别是调试多线程的复杂逻辑,有助于深刻理解代码的执行顺序。
    zsc8917zsc
    zsc8917zsc
    Oct 15, 2025
    7
    不 debug 了,扔给 AI ,跑不通就继续 AI ,直到跑通了为止
    catinsides
    catinsides
    Oct 15, 2025
    8
    nodejs 以前我也只用 console, 后来发现还是 debug 更方便
    AoEiuV020JP
    AoEiuV020JP
    Oct 15, 2025
    9
    log 意味着提前准备好打印可能有异常的点,
    前提是得知道可能出什么问题,
    排查原因不明的 bug 就很难用了,
    HojiOShi
    HojiOShi
    Oct 15, 2025
    10
    我搞 Android 的也不用。debug 非常容易跑飞,完全不如 print 。而且有些没法物理接触的客户设备没办法 debug 的也只能 print 。
    guanzhangzhang
    guanzhangzhang
    Oct 15, 2025
    11
    你现在不用 debug 是因为你的场景下遇到问题比较简单,比如你用 rust 写个 cli 工具,nodejs 写一些后端服务。如果你用 rust 写个 tcp server ,nodejs 写大项目,然后某些情况下才出现问题,你 print 怎么够用
    clemente
    clemente
    Oct 15, 2025
    12
    编译型语言 用 Debug
    解释型 用 print 其实也够用
    fortytwo
    fortytwo
    Oct 15, 2025
    13
    包的,只用打印比较难调试一些复杂的对象。

    而且出 bug 了,你要用多个语句测试具体的原因。我是 python 用的多,经常遇到变量类型的问题。
    打印调试的话,要话很多时间在重新运行上。
    exonuclease
    exonuclease
    Oct 15, 2025
    14
    能复现出来的 bug 你就偷着乐吧 碰到莫名其妙一个 crash dump 然后死活找不出来条件就老实了
    swananan
    swananan
    Oct 15, 2025
    15
    swananan
    swananan
    Oct 15, 2025
    16
    对了,推荐下我的这个刚启动的项目,自由的给线上服务打印日志: https://github.com/swananan/ghostscope
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5011 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 50ms · UTC 08:56 · PVG 16:56 · LAX 00:56 · JFK 03:56
    ♥ Do have faith in what you're doing.