Having more textbooks with solutions to the exercises would probably help a lot with this, especially if you used the solutions judiciously. I think the fact that this isn't more common sadly has a lot to do with their role in undergraduate teaching: every exercise that has a solution in the back of the book is one that college students can very easily cheat on. I definitely agree that it's frustrating that the product has to be made worse for everyone else just because some people would misuse the better version. Far from the only such case in the world!
The reason I do this is because grades matter so much to students that even if they care to learn material they are incentivized to cheat (and subsequently cheat themselves). I think a lot of academics still don’t get this and are resistant to change (it is a lot of work to create a class but not to much once you worked everything out).
I think this confidence thing is also something that needs to be learned in every subject. Even in CS the compiler, type checking, and even unit tests aren’t enough (though they are extremely useful).
I should also say, one unfortunate thing I find in academic teaching of coding is we often don’t look at code. There’s not enough time. But to me this feels like trying to grade a math proof by looking only at the first and last lines. I think this builds lots of bad habits and over confidence
I think the main difference between learning provisioning and math is a compiler. To learn either you can only learn by doing. Reading and lectures aren’t enough. What is hard to learn in math is to be the compiler yourself. To be able to verify “programs” (do I even need quotes here?). This is a very powerful tool to add to your tool belt and one I think even helps in programming.
I hope others can add advice here and words of encouragement. The struggle is real, but it is part of the process, for better or for worse.
• Real Analysis: A Long-Form Mathematics Textbook
• Proofs: A Long-Form Mathematics Textbook
• Mathematical Logic Through Python
• A Course in Calculus and Real Analysis
• A Course in Multivariable Calculus and Analysis
• Differential Equations With Applications and Historical Notes
• Probability and Random Processes (Grimmet)
• Probability Through Problems
• Fifty Challenging Problems in Probability with Solutions
• The Simple and Infinite Joy of Mathematical Statistics
• An Introduction to Error Analysis