Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Basics Perfecting the Prototype Reviewing Our Feedback

Learning coding
seal-mask
.a{fill-rule:evenodd;}techdegree
Learning coding
Front End Web Development Techdegree Student 9,937 Points

In the video Craig wrote "insert exit code" in a comment. Why did he do that?

I thought that a comment was for making notes for yourself, or other programmers and not for coding. So why was "inserted exit code" written in the comment?

2 Answers

Alexander Nikiforov
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 Points

You should put comment when "making notes for yourself, or other programmers" or when looking by code it is not easy to understand what code is doing, you are right about that.

In that particular case, he just wanted for you to know what is going on. It is like writing a purpose first, and then write a code.

Also consider that as a hint. If you want to try coding yourself, you can pause video, and try to write the code yourself, then press play and check how Craig did.

This way you can practice more and check. You will see a lot of comments like this in a numerous courses to come.

I suggest you do just that : that helped me a lot.