Discuss Scratch

LeadToGold
Scratcher
96 posts

Comment improvements

Comments are an important part of good software engineering practice. They can remind you of what you were thinking when you wrote a piece of code. They can tell others how something works or how to use it. I used to teach programming and commenting was one of the first things I mentioned before I sent the students off to write code.

I would like to have Scratch not only provide comment blocks but also encourage their use.

1. When a new sprite is created automatically generate a comment at the top of the sprite. That comment will be anchored to the top of the Scripts page for the sprite. The comment might even have some prompts - purpose, usage, global states, connections with other sprites. The comment could be deleted and added back when desired. Also collapsed as normal comments.

2. When a new block is created automatically generate a comment attached to the block header - again could provide default ideas for commenting.

There are also some general problems with comments today which may be bugs but could help with the adoption of better commenting.

Comments are not taken into account when the scripts window is ‘cleaned up’ Block comments overlap other blocks and open comments are left in place. The handling of comments attached to pieces of code has some issues. Sometimes they leave yellow bars on the window. Deleting the code occasionally leaves the comment floating and messing up the window position of the scripts.

Anyone interested?

s


set (TheQuestion) to <<(2b) = [0]> or <not <(2b) = [0]>>>
gravtest
Scratcher
100+ posts

Comment improvements

+1

jji7skyline
Scratcher
1000+ posts

Comment improvements

So comments would be automatically added to hat blocks? I'm not sure if I entirely support the idea, but it definitely is something to think about.
AonymousGuy
Scratcher
1000+ posts

Comment improvements

Well, I agree comments could be more organized. I don't know if making them automatic is the best improvement though…..
Exhelah
Scratcher
100+ posts

Comment improvements

Also, the way that the comments are placed when attached to a script isn't all that great. If you have a script where there's a really long block at the end, but the rest of it is all the same size, then a comment will extend past the boundary of the longest block, even if it's not even remotely touching it. I think it should be programmed to just extend past the blocks it is in direct contact with and leave the others alone (this could be applied to the “clean up” function as well.)

There are also several issued with the comment placement. If you have a comment just hanging onto nothing, it has a chance of attaching itself to a random nearby block, even when you don't want it to. And it's tricky to mouse a comment over a block and get it to attach; you have to do it with copying and pasting if you don't want to sit there for hours on end.

Finally, the text editor itself is flawed: You cannot edit stuff in the middle of the comment! You have to go straight to the end (there are easy glitches to get around this, but it's just stupid that you cannot do it without glitching.)

I give my full support.

Move along. Nothing to see here.
davidkt
Scratcher
1000+ posts

Comment improvements

+1

Remember when I looked like this? I still do.


Float, my Scratch 2.0 mod | My (somewhat under-construction) blog
mariobros406
Scratcher
500+ posts

Comment improvements

Support.

I only check in to Scratch from time to time to see what others have been up to. I don't really post anything anymore. I'll occasionally post a question in the AT forum if I can't find an answer anywhere else.

Powered by DjangoBB