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

#1 2010-05-01 05:57:00

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

How do 1 sprite 1 script projects teach BAD programming habits?

I'm just wondering.

For example, in AS2 you're basically running a loop over and over with a starting function and some functions that you can set.

And a 1 sprite 1 script project is kinda like that, apart from the lack of functions (or broadcasts in scratch).

So why does it teach bad programming habits?

Wouldn't a bad programming habit be using the wait block?

Last edited by juststickman (2010-05-01 05:57:16)


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#2 2010-05-01 08:54:52

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: How do 1 sprite 1 script projects teach BAD programming habits?

I don't think it teaches bad programming habits. In fact, using 1s1s projects encourages creativity with different types of projects, and actually teaches a good lesson in programming given that it has limits and all programming has limits. Trying to get around the limit is what programming is all about!

Offline

 

#3 2010-05-01 11:24:59

Phi_Lho
Scratcher
Registered: 2010-03-22
Posts: 75

Re: How do 1 sprite 1 script projects teach BAD programming habits?

I won't necessarily say it is bad programming habit, I would judge on code itself... :-)
But what is seen as good programming habits by today standards is to break down a program in smaller units easy to understand, and to bring them together to do a complex task.
Apparently these 1S1S projects seem hard to manage and maintain, but hey, they look like fun and challenging, which is, after all, among the main purposes of Scratch, no?


http://i241.photobucket.com/albums/ff159/PhiLho/KM150.pnghttp://i241.photobucket.com/albums/ff159/PhiLho/PhiLhoLogo.png

Offline

 

#4 2010-05-02 10:36:19

laser100
Scratcher
Registered: 2009-12-04
Posts: 100+

Re: How do 1 sprite 1 script projects teach BAD programming habits?

I don't think it is a bad programming habit. But for new users, they should get used to using simple scripts, and build their way to awsomeness.

Offline

 

#5 2010-05-02 15:30:18

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: How do 1 sprite 1 script projects teach BAD programming habits?

You can't compare it with AS2 because AS2 lets you properly control everything from the main stage and scratch does not.

In some programs using 1sprite & 1script is acceptable because that is all that is needed. It teaches bad habits when you use 1 sprite and 1 script when you have to make something that requires specific workarounds. Some projects like platformers can be made more simple and efficient with many scripts/sprites. If you learn how to make projects that are more efficient with many scripts and sprites using 1 sprite/script then you are developing bad habits.

Last edited by archmage (2010-05-02 15:31:26)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#6 2010-05-02 15:43:26

wildplayer
Scratcher
Registered: 2008-08-01
Posts: 100+

Re: How do 1 sprite 1 script projects teach BAD programming habits?

you an do alot with 1s1s if you want to cram everything into one script

Offline

 

#7 2010-05-06 16:22:15

Ratty1967UK
Scratcher
Registered: 2007-05-16
Posts: 88

Re: How do 1 sprite 1 script projects teach BAD programming habits?

I've worked in IT for over 20 years on countless different programming languages and love Scratch for it's wonderful simplicity and that it lets my kids do stuff quickly without them sitting there scatching their heads (sic) trying to decipher stupid compiler errors or figuring out how to call some convoluted graphics API.

Now then... in commercial IT... the equivalent of a 1s1s would definitely be a no-no... one long piece of code with if-then-else blocks nested to the n'th degree is almost impossible to maintain.

Small discrete units of code that you know will work and can pretty much be forgotten about once they've been written and tested is the way forward

1s1s projects are an interesting academic exercise but don't teach you anything useful

Offline

 

#8 2010-05-06 16:41:19

demosthenes
Retired Community Moderator
Registered: 2008-02-19
Posts: 1000+

Re: How do 1 sprite 1 script projects teach BAD programming habits?

Ratty1967UK wrote:

I've worked in IT for over 20 years on countless different programming languages and love Scratch for it's wonderful simplicity and that it lets my kids do stuff quickly without them sitting there scatching their heads (sic) trying to decipher stupid compiler errors or figuring out how to call some convoluted graphics API.

Now then... in commercial IT... the equivalent of a 1s1s would definitely be a no-no... one long piece of code with if-then-else blocks nested to the n'th degree is almost impossible to maintain.

Small discrete units of code that you know will work and can pretty much be forgotten about once they've been written and tested is the way forward

1s1s projects are an interesting academic exercise but don't teach you anything useful

This point completely sums up my feelings on the matter, I can't describe it more clearly and concisely.


I've taken a long hiatus, but I still visit sometimes. Give me some time to answer any messages you post on my projects!

Offline

 

#9 2010-05-06 20:22:25

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: How do 1 sprite 1 script projects teach BAD programming habits?

Ratty1967UK wrote:

I've worked in IT for over 20 years on countless different programming languages and love Scratch for it's wonderful simplicity and that it lets my kids do stuff quickly without them sitting there scatching their heads (sic) trying to decipher stupid compiler errors or figuring out how to call some convoluted graphics API.

Now then... in commercial IT... the equivalent of a 1s1s would definitely be a no-no... one long piece of code with if-then-else blocks nested to the n'th degree is almost impossible to maintain.

Small discrete units of code that you know will work and can pretty much be forgotten about once they've been written and tested is the way forward

1s1s projects are an interesting academic exercise but don't teach you anything useful

I see what you mean. I especially agree with that last point - you've got me convinced! I never particularly tried for a 1 sprite 1 script project and the only times it ever came about happening was if it was a simple engine and only needed 1 sprite and 1 script.

Offline

 

#10 2010-05-07 12:14:13

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: How do 1 sprite 1 script projects teach BAD programming habits?

wildplayer wrote:

you an do alot with 1s1s if you want to cram everything into one script

That isn't very helpful. I know you can do a lot, have you even been reading this thread? My question is why does it teach bad programming habits?


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#11 2010-05-14 19:51:41

12three
Scratcher
Registered: 2008-06-12
Posts: 1000+

Re: How do 1 sprite 1 script projects teach BAD programming habits?

It teaches bad habits and good habits, because it requires you to think outside the box on how to make your game or other thing work, but it can also teach bad habits, because of the simplicity. I still don't think this is a strong reason, because I like making simplistic projects, and simplistic projects have some of the best on scratch, like Fall Down by M44. The simplicity of FMT's Snake Maze also makes it simple, but fun. I really don't think there are any bad things that come out of 1s1s, besides the thing I mentioned above, but that is still a weak reason.

Offline

 

#12 2010-05-14 21:56:32

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: How do 1 sprite 1 script projects teach BAD programming habits?

juststickman wrote:

That isn't very helpful. I know you can do a lot, have you even been reading this thread? My question is why does it teach bad programming habits?

I don't think it teaches bad programming habits at all! Of course, it doesn't make sense to do in a "real" project, but it makes you think about the efficiency of your programs. I think if anyone had a gripe against this style of programming it would be because it suppresses some features of Scratch. With one sprite and one script you can't use broadcasts, which are an important part of many languages. Also, it's always a good idea to make your programs modular by putting different functionalities in different places where they're easy to access (like on a broadcast script!) You compared Scratch to AS2 in your first post, and I see what you mean, it's sort of like having a single onEnterFrame function to work with. (side note: one way I used to avoid this when using AS2 was to create a function that returned a new empty MC each time it was called.)

Code:

var count:Number=0

function evtListener():MovieClip
{
    var m:MovieClip = this.createEmptyMovieClip("hello_"+count,count)
    count++
    return m
}

evtListener().onEnterFrame = function()
{
    trace("Hello numero uno!")
}

evtListener().onEnterFrame = function()
{
    trace("Hello numero dos!")
}

Last edited by fullmoon (2010-05-14 22:19:23)


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#13 2010-05-14 23:43:33

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: How do 1 sprite 1 script projects teach BAD programming habits?

In actionscript the code would ideally be in separate classes. Trying to maintain 500+ lines of code all bunched up is not practical.

Reasons why this 1sprite 1script projects develop bad habits have already been explained in earlier posts.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

Board footer