How to build widgets?

I’m looking for educational resources on how to build widgets. My hope is that I can find a theme that works with Buddypress and Multisite and the homepage is fully widgetized so I can constantly customize what content is on the homepage.

My thought is that if I have a theme that is fully widgetized I can figure out how to layout the homepage the way I want with custom widgets and various plugins without getting too deep in the code.

Thoughts/resource suggestions on building widgets? Am I headed in the right direction?