Session 05¶
Topic 1: Interfaces¶
- terminal
- SSH
- Zsh
- editors
- Git
- AI 👈
Today¶
AI¶
- AI coding assistants
- AI agents
- AI hands-on
AI coding assistants¶
Why use AI for coding?¶
- real-world codebases are large, complex, and interdisciplinary
- data scientists spend more time:
→ debugging / refactoring
→ gluing libraries together / reading unfamiliar code - AI changes how we interact with code – not just how fast we type
→ Most of your time is not spent inventing algorithms. It’s spent making code work.
LLMs for coding (ChatGPT, Claude)¶
Large Language Models (LLMs) are trained on:
- programming languages
- documentation
- common coding patterns
you chat with them:
- ask questions
- generate code
- explain errors
Example prompts¶
- “Explain this pandas function”
- “Convert this NumPy code to PyTorch”
- “Why does my training loop blow up?”
What AI is great at¶
💬
- understanding unfamiliar code
- generating predictable code (
boilerplate) - translating ideas to code
- debugging error messages
When AI fails¶
💬
- can be wrong without a clue about it 🙃
- invents functions or APIs that don’t exist 👻
- cannot distinguish what’s correct and what’s not 🥴
- follows patterns 🐜 – not logic 🧠
- lacks hidden assumptions 🫣
- gets overwhelmed by long project structure 😬
→ AI is a powerful junior collaborator – not an oracle – it never replaces expertise.
AI agents¶
AI Coding Agents¶
AI agents don’t just answer questions, they:
- read your codebase
- modify your files
- run commands (in the terminal)
- iterate until a task is done
→ AI agent = autonomous junior developer
Example tools:
- Claude Code
- GitHub Copilot
- OpenCode
- Mistral Vibe
What can AI coding agents do?¶
- implement features across files
- refactor entire modules
- add tests
- fix failing tests
- migrate APIs or libraries
Example prompts:
- “Refactor this notebook code into a Python package”
- “Add logging and config files”
- “Turn this prototype into production-ready code”
Why this matters for data scientists¶
| Before 🧓 | Now 🧑 |
|---|---|
| write every line yourself | specify intent |
| optimize syntax | evaluate correctness |
| memorize APIs | guide architecture decisions, understand trade-offs |
New skills¶
- prompting with constraints
- reviewing AI-generated code (👋
git diff) - designing experiments and tests
- knowing what to ask and what to distrust
Best practices (and survival guide)¶
Do: 🚦
- treat AI output as a draft
- write tests first (or ask the agent to)
- ask why, not just what
- use Git and keep commits small & reviewable
Don’t: ⚠️
- blindly trust generated code
- let agents run unchecked on critical systems
- confuse productivity with correctness
AI amplifies thinking.
AI hands-on¶
AI four ways¶
- in the browser
- in the browser with split screen
- in the terminal
- in the editor
AI - 1st way¶
the traditional way is to open a chat in the browser
open https://chatgpt.com
Demo - Example prompt¶
“Implement a to-do list manager in Python with a command-line interface.”
AI - 2nd way¶
still in the browser: split screen with chat and code
open https://claude.ai
Demo¶
- let’s repeat the same prompt as before
- then request some change to the generated code
AI - 3rd way¶
in the terminal: now files in current working directory are used as context
opencode
# we'll look into how to install this tool in the bonus material
Demo¶
- in the terminal, go to the root folder of a codebase
- open AI agent CLI; then ask to explain the codebase
- instruct to modify a particular code in a file
AI - 4th way¶
in the editor: also uses files as context
Demo¶
- in VS Code, open the root folder of a codebase
- ask in the chat window of GitHub Copilot (e.g. to explain the codebase, or modify a file)
Bonus¶
Install OpenCode on Matrix¶
The steps are described in the wiki → OpenCode.
Key takeaways¶
AI as a force multiplier, not a shortcut
your human judgment still defines:
- goals
- correctness
- ethics
the best data scientists will be:
- strong conceptual thinkers
- excellent at reviewing
- effective collaborators with humans and machines
Looking ahead¶
New topic: The Go language¶
Go’s philosophy:
Don’t communicate by sharing memory; share memory by communicating.