AgentSkillsCN

Programming and Development Teaching Principles

当创建编程教育内容时,请使用此技能。提供代码优先学习、渐进复杂度、错误驱动教学和适合水平内容的教学原则。触发短语包括“教学原则”、“如何教学”、“教学方法”、“教育最佳实践”。

SKILL.md
--- frontmatter
description: Use this skill when creating programming education content. Provides pedagogical principles for code-first learning, incremental complexity, error-driven teaching, and level-appropriate content. Trigger phrases include "teaching principles", "how to teach", "pedagogical approach", "educational best practices".

Programming and Development Teaching Principles

General pedagogical principles for teaching programming, software development, and systems programming.

Core Teaching Philosophy

1. Code-First Learning

Programming is learned by writing and running code, not just reading about it:

  • Provide working, compilable code examples
  • Show the complete build-run-output cycle
  • Encourage experimentation and modification
  • Build confidence through successful compilation and execution
  • Learn from compiler errors and runtime failures

2. Mental Model Development

Help students build accurate mental models of how code executes:

  • Visualize memory layout and data flow
  • Trace execution step by step
  • Understand the stack, heap, and program lifecycle
  • Connect high-level code to low-level behavior
  • Make the "invisible" visible through diagrams and examples

3. Incremental Complexity

Build understanding step by step:

  • Start with minimal working examples
  • Introduce one concept at a time
  • Build on previously learned patterns
  • Avoid overwhelming with edge cases upfront
  • Progress from "what" to "why" to "when"

4. Error-Driven Learning

Compiler errors and bugs are learning opportunities:

  • Show common errors and how to interpret them
  • Teach debugging strategies and tools
  • Normalize mistakes as part of learning
  • Build pattern recognition for error types
  • Connect symptoms to underlying causes

5. Professional Practice Integration

Connect learning to real-world development:

  • Version control from the start
  • Testing as a development tool
  • Code review and readability
  • Documentation and comments
  • Build systems and toolchains

Content Structure Guidelines

For Chapters

  1. Start with working code - Show what success looks like
  2. Explain the building blocks - Break down each component
  3. Introduce variations - Show different ways to achieve similar goals
  4. Address common pitfalls - What can go wrong and why
  5. Practice with exercises - Hands-on application
  6. Connect to bigger picture - How this fits into larger programs

For Code Examples

  1. Complete and runnable - No pseudo-code without real implementation
  2. Well-commented - Explain non-obvious parts
  3. Idiomatic - Follow language conventions and best practices
  4. Progressive - Build from simple to complex
  5. Error examples included - Show what broken code looks like

For Exercises

  1. Clear specifications - Unambiguous requirements
  2. Scaffolded difficulty - From guided to independent
  3. Real compilation required - Not just "write on paper"
  4. Testing provided - Help students verify their solutions
  5. Extension opportunities - For students who finish early

For Slides/Presentations

  1. Live coding focus - Demonstrate in real-time
  2. Build incrementally - Add code piece by piece
  3. Show compiler output - Make the feedback loop visible
  4. Include think-alouds - Model problem-solving process
  5. Interactive elements - Have students predict outcomes

Level Differentiation

Beginner Developers

  • Assume minimal programming experience
  • Explain every keyword and symbol
  • Provide extensive scaffolding
  • Focus on "making it work" before optimization
  • Use simple, relatable examples
  • Celebrate small victories

Intermediate Developers

  • Assume familiarity with basic concepts
  • Focus on language-specific features
  • Introduce design patterns and idioms
  • Compare with other languages they know
  • Include more complex real-world examples
  • Emphasize code organization

Advanced Developers

  • Assume strong foundation
  • Focus on performance and optimization
  • Deep dive into language internals
  • Advanced patterns and techniques
  • System-level understanding
  • Research and industry best practices

Language-Specific Guidance

For Systems Languages (C, C++, Rust)

  • Memory management is central - Teach allocation, deallocation, ownership
  • Compilation matters - Explain the build process
  • Performance awareness - Discuss efficiency implications
  • Safety considerations - Bounds checking, undefined behavior
  • Low-level concepts - Pointers, references, memory layout

For Managed Languages (Python, Java, C#)

  • Abstraction appreciation - What the runtime handles
  • When to go lower - Understanding what's "under the hood"
  • Framework navigation - Working with large ecosystems
  • Performance considerations - Garbage collection, JIT

For Web Development Languages (JavaScript, TypeScript)

  • Async model understanding - Event loop, callbacks, promises
  • Browser vs Node.js - Different runtime environments
  • Toolchain complexity - Build tools, bundlers, transpilers
  • Ecosystem navigation - Package management, dependencies

Framework Inclusion Guidelines

When Teaching WITHOUT Frameworks

  • Focus on fundamentals - Raw language and standard library
  • Build things from scratch - Understand underlying mechanisms
  • Appreciate what frameworks do - Creates motivation for later
  • Complete control - Every line is intentional and understood

When Teaching WITH Frameworks

  • Framework as amplifier - Build on fundamentals
  • Convention understanding - Why the framework works this way
  • Escape hatches - How to go beyond the framework when needed
  • Multiple frameworks - Principles transfer between tools

Assessment Philosophy

Code-Based Assessment

  • Compilation required - No partial credit for non-compiling code
  • Automated testing - Objective evaluation of correctness
  • Code review component - Style, readability, efficiency
  • Debugging exercises - Find and fix bugs in given code

Understanding Assessment

  • Trace exercises - What does this code output?
  • Error prediction - What's wrong with this code?
  • Design questions - How would you structure this?
  • Comparison questions - Trade-offs between approaches

Common Pitfalls to Avoid

  1. Too abstract too soon - Build intuition before theory
  2. Perfect code only - Show messy first drafts too
  3. Ignoring errors - Errors are teaching moments
  4. One right way - Usually multiple valid approaches
  5. Skipping the boring parts - Setup, configuration matter
  6. Assuming IDE familiarity - Teach the tools too
  7. No debugging practice - Essential professional skill
  8. Disconnected theory - Always connect to practical use