📢
16

I started testing my code right away, but is it too soon for beginners?

I used to write code without any tests and kept running into bugs. After a while, I made myself test each small function before moving on. It took more time at first, but I caught mistakes early. Some people say testing is too complex for new coders and slows down learning. Others think it's a good habit to build from the start to avoid big issues later. For me, it helped make my code work better and saved hours of fixing errors. Do you think beginners should learn testing early or wait until they know more?
3 comments

Log in to join the discussion

Log In
3 Comments
raym68
raym681mo ago
Start testing early even if it's just basic checks for small functions. Honestly, getting used to running your code often to see if it does what you expect builds good habits right away. It makes the whole idea of tests less scary later when you need to do more complex stuff. Tbh, it's way better than debugging a huge mess because you waited.
5
anna_hill
anna_hill1mo ago
Early testing can just become a crutch though. Sometimes you learn more by building the whole thing first and fixing the mess.
1
taragibson
taragibson1mo ago
Spent two weeks debugging one function, so I can't believe waiting is better than @raym68's early checks.
5