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),有潜力将编码转变为直观的对话过程,然而最佳实践和高效工作流程仍在形成中。我们从三个关键视角剖析人工智能辅助编程:大语言模型在编码中的本质与作用(动因),其提供的六类编码辅助(内涵),以及一个包含五步流程并配有实践实施策略的行动方案(方法)。此外,我们探讨了人工智能在编码领域的局限性与未来展望。通过提供可操作的见解,此框架旨在引导研究者有效利用人工智能以改进编码实践与教育,从而加速科学进步。