Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Add comments to code
Old
josborne
Guest
 
Status:
Posts: n/a
Default Add comments to code - 04-02-2007, 12:37 PM

I was going to require that my students document their code but I could not find a mechanism for adding comments, e.g., in Phrogram "// This is a comment".

How do I add comments to the code?
   
Reply With Quote
Old
gabe
Administrator
 
gabe's Avatar
 
Status: Offline
Posts: 461
Join Date: Jul 2005
Location: Pittsburgh, PA
Default 04-02-2007, 02:01 PM

There is a comment tile below the method editor at the far end. See image below.
Attached Images
File Type: jpg comment.jpg (31.9 KB, 102 views)
   
Reply With Quote
Watch out for comment length
Old
DickBaldwin
Guest
 
Status:
Posts: n/a
Default Watch out for comment length - 04-02-2007, 03:19 PM

TIP: In case you are going to also require your students to turn in printed source code generated using the item on the File menu that reads something like "Export code for printing," be careful of the length of the comments. Otherwise, they will wrap in a very ugly way. Depending on the indentation level of the comment, they need to be fairly short to very short in order to avoid wrapping in the HTML output created by this menu option.

Another TIP: In case your students are going to go into a Java or C++ programming environment after they master Alice, and if you are going to have them generate source code as described above, you may want to consider having them select preferences on the edit menu, and then select the option for Java format in color, or words to that effect. The printed output still isn't pure Java, but it is much closer than the default Alice format.

Dick Baldwin
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.