This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-01-11 21:20:02

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

5 simple steps to improve your scripting skills!

It's easy to be a good programmer, all you have to do is know what you want to accomplish, and you can do it. A lot of people aren't sure how to be a good programmer, so I'll show you how. There are example questions, the answers to which are at the end of the post, if you are interested in them.

1. A good programmer knows his/her resources.

If you want to be effective, you need to know what your resources are, and how to use them. Go through the scratch blocks, click the help button to learn what they are, and remember which division they are in. Even more experienced scratchers are still learning how to effectively use some of these blocks, and may never learn their true potential. Programming requires constant learning, why not get a head start? If you don't do this, effective programming is difficult.

A1. A good programmer has a plan.

A plan is always a helpful thing to have when programming. Think through your game and its components. Determine what makes sense to script first, and what should be saved till last. An example would be a game with three major components, the game, achievements as an extra feature, and a menu. Try to put these in logical order.

2. A good programmer uses logic.

All you need to figure out a tough scripting problem is to think it through logically. Think about the components of what you want to accomplish. Let's say I want to make Sprite A hide when it touches Sprite B, a simple task. I will think through the components I need for Sprite A, I need a hide block to make it hide, obviously. But what about the other components? They aren't quite as obvious. But if I think logically, I remember that an if block checks whether or not a condition is true, and know that I can use it to aid me. I'll let you try and finish this problem, but hopefully you get the point.

3. A good programmer knows what to use when.

A good programmer will know, or try to find out, which method of doing something is more efficient, and will use that method, even if it's different than what they're used to. An example would be broadcast vs. variables. There are advantages to both, but which you should use is dependent on the situation. Thinking logically comes into play here too, so see if you can figure it out. An example situation to solve would be a game that is running slowly. Do we use the variable checker trigger method, or a simple broadcast? Remember though, don't be afraid to try whichever one works best! I'll let you decide which one works best for this scenario.

4. A good programmer knows when to look for help.

A good programmer knows when he/she needs help. Getting other people's opinions and knowledge can be a real time saver on a tough question. That's what these forums are for, after all.

4b. A good programmer also knows when to just do it themselves.

A good programmer also will know when relying on others is not the thing to do. Although others can be a real help on a tough question, some questions are better off answered by the one asking the questions. Normally, getting through a tough one by yourself will provide you with more knowledge than asking for help. In all of your failed attempts, you have given yourself more insight into the language of your choice. You not only now know many ways to not do something, but ways to do other things as well. That can only help you in the future.

5. A good programmer will help others.

A good programmer will sometimes need help. But other times, he/she can help others. If you see someone with a problem you know how to fix, share your knowledge! Who knows, maybe they'll help you out one day too!

Answers:
Question 1, from guideline A1. Thinking logically, the menu will come first. If it doesn't, you may have some rescripting to do after you make the game, to make the game start when the appropriate button is pressed, instead of when the green flag is clicked.
Second will be the game itself. You can't very well test achievements if you can't do the things you need to do to get them can you?
Last will be the achievements, as they are the only thing left to do.

Question 2, from guideline 2. Continuing logically, we know we need a sensor block to make the if block function, and a forever loop to keep it checking constantly. We also need a hat block to start the script. Eventually, we come up with this.

when gf clicked
forever
if <touching [Sprite B v]?>
hide
end
Nothing fancy, just logic. This script could be improved upon, but for our purposes, it's fine.

Question 3, from Guideline 3. The answer is broadcasts. The more experienced scratchers who see this will mock, but it's true. Variable checker triggers are generally less responsive than broadcasts, and they can slow down your game dramatically if used in excessive quantities. With broadcasts, which does use variables by the way, only the scripts that need to be running will be running at any given time, as opposed to all scripts running at the same time. Although use of the variable checker method is highly vaunted, and broadcasts looked down upon, broadcasts are usually the way to go.

That's the end of my brief guide, I hope it helps you in the future! If you have suggestions for more steps, let me know, I'll consider adding them.

Last edited by sonicfan12p (2013-02-01 12:45:05)


Why are the secret organizations getting all the attention?  mad

Offline

 

#2 2013-01-13 23:26:01

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: 5 simple steps to improve your scripting skills!

It would be great if this was stickied, but why did you not itopic it?


http://blocks.scratchr.org/API.php?user=KrIsMa&amp;action=onlineStatus&amp;online=http://i49.tinypic.com/2pzic0m.png&amp;offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#3 2013-01-14 12:04:03

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: 5 simple steps to improve your scripting skills!

Am I allowed to itopic my own threads? I thought mods were supposed to do that.

Last edited by sonicfan12p (2013-01-14 12:04:18)


Why are the secret organizations getting all the attention?  mad

Offline

 

#4 2013-01-14 12:15:14

mythbusteranimator
Scratcher
Registered: 2012-02-28
Posts: 1000+

Re: 5 simple steps to improve your scripting skills!

And a good programmer plans everything in advance.


http://www.foxtrot.com/comics/2012-04-01-fdb37077.gif
clicky

Offline

 

#5 2013-01-14 12:36:01

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: 5 simple steps to improve your scripting skills!

mythbusteranimator wrote:

And a good programmer plans everything in advance.

True, a good programmer needs a plan. I'll add that, thanks.  smile


Why are the secret organizations getting all the attention?  mad

Offline

 

#6 2013-01-18 12:15:25

firedrake969_test
Scratcher
Registered: 2012-08-08
Posts: 500+

Re: 5 simple steps to improve your scripting skills!

A good programmer is not afraid to try something different.

A good programmer is always learning.


Alt of Firedrake969.

Offline

 

#7 2013-01-18 12:23:51

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: 5 simple steps to improve your scripting skills!

firedrake969_test wrote:

A good programmer is not afraid to try something different.

A good programmer is always learning.

I revised sections one and three with this, good points!  smile


Why are the secret organizations getting all the attention?  mad

Offline

 

#8 2013-01-18 12:31:10

bullelk12
Scratcher
Registered: 2012-05-26
Posts: 100+

Re: 5 simple steps to improve your scripting skills!

A good programmer remembers many useful scripts that are valid in many different areas so they can be used at ease for ease.

And a good programmer tries to go simple if possible.

Last edited by bullelk12 (2013-01-18 12:34:29)


http://mag.racked.eu/cimage/i6000/Achievement++get%21/Scratcher+love+minecraft%21/mca.png

Offline

 

#9 2013-01-18 12:33:10

bullelk12
Scratcher
Registered: 2012-05-26
Posts: 100+

Re: 5 simple steps to improve your scripting skills!

You should check out some of my projects (mostly because they involve difficult scripts  hmm


http://mag.racked.eu/cimage/i6000/Achievement++get%21/Scratcher+love+minecraft%21/mca.png

Offline

 

#10 2013-01-18 12:48:49

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: 5 simple steps to improve your scripting skills!

bullelk12 wrote:

A good programmer remembers many useful scripts that are valid in many different areas so they can be used at ease for ease.

And a good programmer tries to go simple if possible.

I think these go along with #3.  wink

What was with the face of dissapointment in your other post though?


Why are the secret organizations getting all the attention?  mad

Offline

 

#11 2013-01-18 16:30:15

bullelk12
Scratcher
Registered: 2012-05-26
Posts: 100+

Re: 5 simple steps to improve your scripting skills!

lol, I was sort of being a hypocrite since my scripts were long and hard in one of my projects when I had just said you should try to make scripts simple.


http://mag.racked.eu/cimage/i6000/Achievement++get%21/Scratcher+love+minecraft%21/mca.png

Offline

 

#12 2013-01-21 13:59:04

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: 5 simple steps to improve your scripting skills!

excellently written


http://blocks.scratchr.org/API.php?user=KrIsMa&amp;action=onlineStatus&amp;online=http://i49.tinypic.com/2pzic0m.png&amp;offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#13 2013-01-28 12:56:21

CAA14
Scratcher
Registered: 2013-01-14
Posts: 1000+

Re: 5 simple steps to improve your scripting skills!

bullelk12 wrote:

A good programmer remembers many useful scripts that are valid in many different areas so they can be used at ease for ease.

And a good programmer tries to go simple if possible.

And as general as possible... But that really only applies to real programing...

Thanks for the guide, sonicfan!
I know i would have done my project better if i had known what I have learned from you and other people here then.

Well, thanks again.

CAA14


P.S. Please check out my "Mind Blowing Math!" projects, they are my best so far and they're pretty neat.

Offline

 

#14 2013-01-29 17:29:40

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: 5 simple steps to improve your scripting skills!

Bump!  smile


Why are the secret organizations getting all the attention?  mad

Offline

 

#15 2013-01-29 21:06:48

CAA14
Scratcher
Registered: 2013-01-14
Posts: 1000+

Re: 5 simple steps to improve your scripting skills!

Bump?


Regards,

CAA14

Offline

 

#16 2013-01-29 22:56:25

lalala3
Scratcher
Registered: 2008-10-03
Posts: 100+

Re: 5 simple steps to improve your scripting skills!

Hm...

4b. On the other hand, a good programmer also knows when not to look for help.

Depending on others to help you will get you nowhere. You need to think about what you're doing and actually gain something from the experience, rather than having others think for you. Remember, "if you give a man a fish he is hungry again in an hour. If you teach him to catch a fish you do him a good turn." --Anne Isabella Thackeray Ritchie, Mrs. Dymond

Last edited by lalala3 (2013-01-29 23:56:27)


http://img515.imageshack.us/img515/9374/signature2nt.png

Offline

 

#17 2013-01-29 23:16:59

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: 5 simple steps to improve your scripting skills!

A Good programmer is object-oriented?


http://blocks.scratchr.org/API.php?user=KrIsMa&amp;action=onlineStatus&amp;online=http://i49.tinypic.com/2pzic0m.png&amp;offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#18 2013-02-01 12:39:54

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: 5 simple steps to improve your scripting skills!

lalala3 wrote:

Hm...

4b. On the other hand, a good programmer also knows when not to look for help.

Depending on others to help you will get you nowhere. You need to think about what you're doing and actually gain something from the experience, rather than having others think for you. Remember, "if you give a man a fish he is hungry again in an hour. If you teach him to catch a fish you do him a good turn." --Anne Isabella Thackeray Ritchie, Mrs. Dymond

That's a good one, I'll add it!

Edit: Done!  smile

Last edited by sonicfan12p (2013-02-01 12:45:38)


Why are the secret organizations getting all the attention?  mad

Offline

 

#19 2013-02-01 13:31:37

BLU_Spy
Scratcher
Registered: 2012-01-05
Posts: 1000+

Re: 5 simple steps to improve your scripting skills!

A good programmer is not a bad programmer.


... What? That's not wrong at all...  tongue


I HAVE SWITCHED ACCOUNTS! My new username is NoxSpooth.

Offline

 

#20 2013-02-06 11:50:05

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: 5 simple steps to improve your scripting skills!

That's very true.  tongue


Why are the secret organizations getting all the attention?  mad

Offline

 

#21 2013-02-18 18:30:33

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: 5 simple steps to improve your scripting skills!

Bump.  smile


Why are the secret organizations getting all the attention?  mad

Offline

 

Board footer