HACKER Q&A
📣 fdeage

How to Teach Refactoring?


I am teaching programming to people with little to no programming experience. The course uses Python.

I find very difficult to provide the students with a general method of refactoring, or good examples.

Do you know of a small-ish (500-3000 lines) codebase example, that is both poorly written _on purpose_ and easy to understand?


  👤 ilaksh Accepted Answer ✓
Refactoring is not a beginner skill. Ask Claude 3 or ChatGPT to give you a few examples with like 5-15 lines of code. But don't give them that until they have some experience.

Code isn't easy to understand for beginners. They need practice reading code.

Giving a beginner 1500 lines of code to refactor is ludicrous.