Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Swift Functions and Optionals Optionals Exercise: isDivisible function

Does the unwrapping process outlined in this course feel a bit ugly?

My instinct would be to continually try and create an extra function to unwrap the thing.

Yes, the fact that there are 16 questions associated with this one video/lesson seems to indicate that others had some issues with the way Amit tried to do things as well.

Personally I think it's one of those "I'm just using this as a teaching example,

but you probably won't be doing anything like this in a production environment"

sort of things.


Here's some links to other related Treehouse threads

that had alternative code to what Amit was using:

https://teamtreehouse.com/community/isdivisible-function-exercise-improvement

https://teamtreehouse.com/community/is-this-a-better-or-worse-way-to-do-this

https://teamtreehouse.com/community/would-the-following-code-also-work-2


I really wish there was a way that students could upload "alternative approach" working code

as a zip and attach it to specific videos/lessons.