Computer programming (coding) is indispensable for researchers across disciplines, yet it remains challenging to learn and time-consuming to carry out. Generative AI, particularly large language models (LLMs), has the potential to transform coding into intuitive conversations, but best practices and effective workflows are only emerging. We dissect AI-based coding through three key lenses: the nature and role of LLMs in coding (why), six types of coding assistance they provide (what), and a five-step workflow in action with practical implementation strategies (how). Additionally, we address the limitations and future outlook of AI in coding. By offering actionable insights, this framework helps to guide researchers in effectively leveraging AI to enhance coding practices and education, accelerating scientific progress.
翻译:计算机编程(编码)对于跨学科研究人员而言不可或缺,但其学习难度大且执行耗时。生成式人工智能,特别是大语言模型(LLMs),有潜力将编码转变为直观的对话过程,然而最佳实践与高效工作流程仍在形成中。我们通过三个关键视角剖析基于人工智能的编码:大语言模型在编码中的本质与作用(动因)、其提供的六类编码辅助功能(内涵),以及一个包含具体实施策略的五步实践工作流程(方法)。此外,我们探讨了人工智能在编码领域的局限性与未来展望。通过提供可操作的见解,本框架旨在引导研究人员有效利用人工智能以优化编码实践与教育,从而加速科学进步。