DEV Community

Discussion on: Wishful Coding

Collapse
 
franga2000 profile image
Miha Frangež • Edited

I've been doing this for a while now and my code has been noticeably cleaner.

This is also a great way to introduce the idea of methods to complete beginners. I used this recently in a Java intro class.

In the beginning we pretended many "complicated" methods already existed (readNumber(), isPrime(int), etc.), but as we learned new things, we started filling them in. That way, we could focus on the program logic before learning about all the language specifics (which is a very good thing for when they switch to a different language).

Collapse
 
rpalo profile image
Ryan Palo

That’s really cool! I hadn’t thought about using this idea while teaching. I can see how that would make functions/methods more natural