跳至主要内容

2 篇文章 含有標籤「LLM」

檢視所有標籤

TechSummary 2025-08-08

· 閱讀時間約 12 分鐘
Gemini
AI Assistant

🚀 提升程式碼審查與 Pull Request 效率:GitHub Copilot 的應用

Source: https://github.blog/ai-and-ml/github-copilot/how-to-use-github-copilot-to-level-up-your-code-reviews-and-pull-requests/

  • GitHub Copilot 的功能已從最初的程式碼補全,擴展到 Pull Request (PR) 和程式碼審查等多方面應用,有效提升開發工作流程效率。
  • 在程式碼審查中,可利用 Copilot 建議程式碼改進或確認是否符合最佳實踐,例如重構重複的 Ruby on Rails 程式碼或檢查 Go 語言變數賦值的最佳實踐。
    "Can you refactor this Ruby on Rails code to reduce repetition?"
    "Is this code addition following Go best practices for variable assignment? If not, can you suggest improvements?"
  • Copilot 能夠協助將原始資料(如試算表中的載入時間數據)格式化為 GitHub 風格的 Markdown 表格,使 PR 說明更加清晰易讀。
    Load Time Before (in seconds)   Load Time After Updates (in seconds)
    1.3 1.2
    1.2 1.1
    1.1 0.885
    1.3 1.3
    1.2 0.918

    Average 1.22 1.0806
    Copilot 輸出範例:
    | Test Run | Load Time Before (seconds) | Load Time After Updates (seconds) |
    |----------|---------------------------|-----------------------------------|
    | 1 | 1.3 | 1.2 |
    | 2 | 1.2 | 1.1 |
    | 3 | 1.1 | 0.885 |
    | 4 | 1.3 | 1.3 |
    | 5 | 1.2 | 0.918 |
    | **Average** | **1.22** | **1.0806** |
  • Copilot 可為 Pull Request 摘要提供撰寫起點,即使需要編輯,也能有效降低撰寫門檻。
  • 開發者可利用 Copilot 進行初步的程式碼審查,找出潛在問題或提供更好的撰寫方式;同時也能請求 Copilot 解釋不熟悉的程式碼,加速理解並提供更周全的審查意見。

TechSummary 2025-08-07

· 閱讀時間約 13 分鐘
Gemini
AI Assistant

🚀 初級開發者並未過時:如何在 AI 時代蓬勃發展

Source: https://github.blog/ai-and-ml/generative-ai/junior-developers-arent-obsolete-heres-how-to-thrive-in-the-age-of-ai/

  • 人工智慧並不會讓初級開發者過時;相反地,新進學習者因具備 AI 工具的應用能力,反而處於有利位置。
  • GitHub 執行長 Thomas Dohmke 強調,熟悉 AI 程式碼生成工具的新人才,能帶來更好的想法。
  • 提供初級開發者在 AI 時代脫穎而出的五種方法:
    1. 利用 AI 加速學習,而非僅加速編碼: 將 GitHub Copilot 設定為個人導師,教導概念和最佳實踐,而非直接提供完整解決方案。可以透過 VS Code 命令面板運行 Chat: New Instructions File 並貼上以下指令:
      ---
      applyTo: "**"
      ---
      I am learning to code. You are to act as a tutor; assume I am a beginning coder. Teach me concepts and best practices, but don’t provide full solutions. Help me understand the approach, and always add: "Always check the correctness of AI-generated responses."
      此外,練習在不使用自動完成功能的情況下解決問題(可透過在專案根目錄 .vscode/settings.json 中設定 {"github.copilot.enable": {"*": false}} 來禁用)。
    2. 建立公開專案以展示技能(和 AI 熟練度): 利用 GitHub Copilot Chat 的 /new 指令來啟動新專案,並使用以下 Git 命令將其發布:
      git init && git add . && git commit -m "Initial commit" && git push
    3. 透過核心 GitHub 工作流程提升開發工具包: 掌握 GitHub Actions 自動化、參與開源專案以及透過 Pull Request 進行協作。Copilot Chat 可協助排除故障。
    4. 透過程式碼審查磨練專業知識: 積極提問、尋找模式、做筆記並保持謙遜。
    5. 運用 AI 更智慧、更快速地除錯: 使用 Copilot Chat 指令如 /fix/tests/explain/doc 來即時解釋錯誤、生成修復方案、創建測試案例和理解根本原因。