logoalt Hacker News

aidenn0yesterday at 11:28 PM1 replyview on HN

One corollary:

Your students will be mad right away if you teach them the terse syntax, but mad later if you teach them the verbose syntax.


Replies

Jtsummerstoday at 1:31 AM

This is why you should (generally) teach them both at the same time, or in close succession. If you're teaching Rust (to continue the example in the submission) you should show the verbose form, then the concise form with ?, and explain why you may want to leave something in the verbose form and how to transform code between the two forms. Maybe the explicit match becomes important to use, how do you go from ? to it so you can add more code than ? itself provides? Or code gets simplified and now your match is reduced to exactly what ? provides.