3.3. Beginning tips for Debugging
Debugging a program is a different way of thinking than writing a program. The process of debugging is much more like being a detective. Here are a few rules to get you thinking about debugging.
- Everyone is a suspect (Except Python)! It’s common for beginner programmers to blame Python, but that should be your last resort. Remember that Python has been used to solve CS1 level problems millions of times by millions of other programmers. So, Python is probably not the problem.
- Find clues. This is the biggest job of the detective and right now there are two important kinds of clues for you to understand.
- Error Messages
- Print Statements
Phải biết nghi ngờ mọi thứ (ờ tất nhiên là trừ python nhé)
phải biết lần theo dấu vết của nóthông qua
1. thông điệp về lỗi - lỗi ở đâu?
2. Báo cáo in ra (đéo hiểu lắm) - chắc là vấn đề được in ra
Nhận xét
Đăng nhận xét