Recently, i have been learning Java programming and there was one feature that I thought would be VERY helpful when doing collabs.
Scratch needs something like the way .class files communicate with each other.
For those of you who don't know, java is more advanced programming language. Minecraft is made in java and I believe scratch is too, but i might be wrong. It is made up of .class files, each containing more lines of code. The way they "talk" to each other is by referencing methods, which are the different lines of code within each .class (think of methods like jelly beans. You have the red ones, the blue ones and the yellow ones. Each one tastes differently.) You would reference a method, and the .class it was in would be opened and the method carried out.
Are you still confused about methods and .class files?
Imagine this:
You are a principal at a elementary school. You are the main method, the one that it starts with. You are doing a study on kids lunches. You go to the 3rd graders (they the a .class file) and you pull out Jimmy (Jimmy is your method). Jimmy tells you what he likes to eat for lunch.
How is this handy? Why not just write it all in one line of code?
Well, two reasons. One: If you wrote all of this in one line of code it would get hard to find the lines you needed and
Two: Imagine you are at a professional company (like Apple). You and Bob (your co-worker) are working on a program. You can write one part of the code while Bob writes the other, at the same time.
Ok, how would this work in scratch?
My idea is that if a project was in the same gallery, it could say
Take (spritename) from (projectname)
I think that would help collab projects allot.
Offline
While this would help kids learn more complicated languages, it would be WAY too complicated to implement in a language designed for people who have no experience with programming whatsoever. Also, it just doesn't fit in Scratch's model.
Offline
i definitely like the idea of classes and think it would be a much better way to go about the idea of cloning, but i'm not really sure how they would implement that well.
Offline
jvvg wrote:
While this would help kids learn more complicated languages, it would be WAY too complicated to implement in a language designed for people who have no experience with programming whatsoever. Also, it just doesn't fit in Scratch's model.
I think I may have overcomplicated this. It is simply a way to bring sprites and scripts across projects. Please explain how this does not fit scratches model.
Offline
benjamindragonpants wrote:
jvvg wrote:
While this would help kids learn more complicated languages, it would be WAY too complicated to implement in a language designed for people who have no experience with programming whatsoever. Also, it just doesn't fit in Scratch's model.
I think I may have overcomplicated this. It is simply a way to bring sprites and scripts across projects. Please explain how this does not fit scratches model.
I think I misread the original post.
After re-reading it, I kind of like this idea.
Offline
benjamindragonpants wrote:
Recently, i have been learning Java programming and there was one feature that I thought would be VERY helpful when doing collabs.
Scratch needs something like the way .class files communicate with each other.
For those of you who don't know, java is more advanced programming language. Minecraft is made in java and I believe scratch is too, but i might be wrong. It is made up of .class files, each containing more lines of code. The way they "talk" to each other is by referencing methods, which are the different lines of code within each .class (think of methods like jelly beans. You have the red ones, the blue ones and the yellow ones. Each one tastes differently.) You would reference a method, and the .class it was in would be opened and the method carried out.
Are you still confused about methods and .class files?
Imagine this:
You are a principal at a elementary school. You are the main method, the one that it starts with. You are doing a study on kids lunches. You go to the 3rd graders (they the a .class file) and you pull out Jimmy (Jimmy is your method). Jimmy tells you what he likes to eat for lunch.
How is this handy? Why not just write it all in one line of code?
Well, two reasons. One: If you wrote all of this in one line of code it would get hard to find the lines you needed and
Two: Imagine you are at a professional company (like Apple). You and Bob (your co-worker) are working on a program. You can write one part of the code while Bob writes the other, at the same time.
Ok, how would this work in scratch?
My idea is that if a project was in the same gallery, it could say
Take (spritename) from (projectname)
I think that would help collab projects allot.
... add id tags too!
Offline
benjamindragonpants wrote:
Recently, i have been learning Java programming and there was one feature that I thought would be VERY helpful when doing collabs.
Scratch needs something like the way .class files communicate with each other.
For those of you who don't know, java is more advanced programming language. Minecraft is made in java and I believe scratch is too, but i might be wrong. It is made up of .class files, each containing more lines of code. The way they "talk" to each other is by referencing methods, which are the different lines of code within each .class (think of methods like jelly beans. You have the red ones, the blue ones and the yellow ones. Each one tastes differently.) You would reference a method, and the .class it was in would be opened and the method carried out.
Are you still confused about methods and .class files?
Imagine this:
You are a principal at a elementary school. You are the main method, the one that it starts with. You are doing a study on kids lunches. You go to the 3rd graders (they the a .class file) and you pull out Jimmy (Jimmy is your method). Jimmy tells you what he likes to eat for lunch.
How is this handy? Why not just write it all in one line of code?
Well, two reasons. One: If you wrote all of this in one line of code it would get hard to find the lines you needed and
Two: Imagine you are at a professional company (like Apple). You and Bob (your co-worker) are working on a program. You can write one part of the code while Bob writes the other, at the same time.
Ok, how would this work in scratch?
My idea is that if a project was in the same gallery, it could say
Take (spritename) from (projectname)
I think that would help collab projects allot.
Sounds good, but one small point. Scratch isn't written in Java. I know it's not an important point but say someone wanted to mod scratch and read this then they might go and learn java specifically for modding and have wasted their time.
Offline
Ask yourself: "Would a 7-year-old understand this?" If not, no.
Scratch is targeted toward people who have no sense of programming at all. If it's too complicated, it's not going to be added.
Offline
firedrake969_test wrote:
Ask yourself: "Would a 7-year-old understand this?" If not, no.
Scratch is targeted toward people who have no sense of programming at all. If it's too complicated, it's not going to be added.
I don't see what's so hard about getting a sprite from another project...
Offline
benjamindragonpants wrote:
Recently, i have been learning Java programming and there was one feature that I thought would be VERY helpful when doing collabs.
Scratch needs something like the way .class files communicate with each other.
This is a kid's language. This could be way complicated.
For those of you who don't know, java is more advanced programming language. Minecraft is made in java and I believe scratch is too, but i might be wrong You are, it's made of Flash and Squeak. It is made up of .class files, each containing more lines of code. The way they "talk" to each other is by referencing methods, which are the different lines of code within each .class (think of methods like jelly beans. You have the red ones, the blue ones and the yellow ones. Each one tastes differently.) You would reference a method, and the .class it was in would be opened and the method carried out.
Are you still confused about methods and .class files?
Imagine this:
You are a principal at a elementary school. You are the main method, the one that it starts with. You are doing a study on kids lunches. You go to the 3rd graders (they the a .class file) and you pull out Jimmy (Jimmy is your method). Jimmy tells you what he likes to eat for lunch. Good analogy
How is this handy? Why not just write it all in one line of code?
Well, two reasons. One: If you wrote all of this in one line of code it would get hard to find the lines you needed and
Two: Imagine you are at a professional company (like Apple). You and Bob (your co-worker) are working on a program. You can write one part of the code while Bob writes the other, at the same time. ...since when does Apple use Scratch? They would use Objective-C, which has classes, I believe...
Ok, how would this work in scratch?
My idea is that if a project was in the same gallery, it could say
Take (spritename) from (projectname)
I think that would help collab projects allot. It would, but it's still too complicated. Maybe in BYOB sometime.
Offline
You could already implement a rough prototype oriented programming paradigm using the clone blocks.
Instance methods could be implemented by expanding the concept broadcasting through "personal broadcasts". It could be called "telling" (can't come up with anything better):
when gf clicked
[tell [Sprite v]: [message v]]
when I'm told [message v]
[say [Hi!]]
Easy to understand, and useful though as you all may know by now, there's many workarounds for this.
Offline
Would this help or am I on the wrong page?
'From MIT Squeak 0.9.4 (June 1, 2003) [No updates present.] on 30 March 2013 at 6:15:42 pm'! !ScratchFrameMorph methodsFor: 'menu/button actions' stamp: 'BC 3/30/2013 18:13'! fileMenu: aMenuTitleMorph | menu | menu _ CustomMenu new. menu add: 'New' action: #newScratchProject. menu add: 'Open' action: #openScratchProject. menu add: 'Save' action: #saveScratchProjectNoDialog. menu add: 'Save As' action: #saveScratchProject. menu addLine. menu add: 'Export Class' action: #class. menu add: 'Import Class' action: #importScratchProject. menu add: 'Export Sprite' action: #exportSprite. menu addLine. menu add: 'Project Notes' action: #editNotes. Sensor shiftPressed ifTrue: [ "developer menu" menu addLine. menu add: 'Write Project Summary' action: #writeSummaryFile. menu add: 'Write Multiple Project Summaries' action: #writeMultipleSummaries. menu addLine. fillScreenFlag ifTrue: [ menu add: 'Exit User Mode' action: #fillScreenOff] ifFalse: [ menu add: 'Enter User Mode' action: #fillScreenOn. menu add: 'Save Image in User Mode' action: #saveImageForEndUser]]. menu addLine. menu add: 'Quit' action: #quitScratch. menu localize. #(2 4 5 6 7) do: [:n | menu labels at: n put: ((menu labels at: n) copyFrom: 1 to: (menu labels at: n) size - 1), ScratchTranslator ellipsesSuffix]. menu invokeOn: self at: aMenuTitleMorph bottomLeft + (0@10). ! ! !ScratchFrameMorph methodsFor: 'file read/write' stamp: 'BC 3/30/2013 18:14'! class | fName result | self closeMediaEditorsAndDialogs ifFalse: [^ self]. self stopAll. fName _ ScratchFileChooserDialog saveScratchFileFor: self. (fName size = 0 or: [fName = #cancelled]) ifTrue: [^ self]. [(result _ ScratchFileChooserDialog confirmFileOverwriteIfExisting: fName) = false] whileTrue: [ fName _ ScratchFileChooserDialog saveScratchFileFor: self. (fName size = 0 or: [fName = #cancelled]) ifTrue: [^ self]]. (result = #cancelled) ifTrue: [^ self]. self updateLastHistoryEntryIfNeeded. fName _ (self nameFromFileName: fName), '.class'. projectDirectory _ FileDirectory on: (FileDirectory dirPathFor: fName). projectName _ FileDirectory localNameFor: fName. projectInfo at: 'author' put: author. self updateHistoryProjectName: projectName op: 'save'. self writeScratchProject. ! ! !ScratchFrameMorph methodsFor: 'file read/write' stamp: 'BC 3/30/2013 18:15'! importScratchProject "Allow the user to select a project to open, then merge that project's sprites with the current project." | response | self closeMediaEditorsAndDialogs ifFalse: [^ self]. self stopAll. response _ ScratchFileChooserDialog chooseExistingFileType: #project extensions: #(.class) title: 'Import Class'. response ifNil: [^ self]. self importSpriteOrProject: response. ! !
Offline
machinespray wrote:
Would this help or am I on the wrong page?
Code:
'From MIT Squeak 0.9.4 (June 1, 2003) [No updates present.] on 30 March 2013 at 6:15:42 pm'! !ScratchFrameMorph methodsFor: 'menu/button actions' stamp: 'BC 3/30/2013 18:13'! fileMenu: aMenuTitleMorph | menu | menu _ CustomMenu new. menu add: 'New' action: #newScratchProject. menu add: 'Open' action: #openScratchProject. menu add: 'Save' action: #saveScratchProjectNoDialog. menu add: 'Save As' action: #saveScratchProject. menu addLine. menu add: 'Export Class' action: #class. menu add: 'Import Class' action: #importScratchProject. menu add: 'Export Sprite' action: #exportSprite. menu addLine. menu add: 'Project Notes' action: #editNotes. Sensor shiftPressed ifTrue: [ "developer menu" menu addLine. menu add: 'Write Project Summary' action: #writeSummaryFile. menu add: 'Write Multiple Project Summaries' action: #writeMultipleSummaries. menu addLine. fillScreenFlag ifTrue: [ menu add: 'Exit User Mode' action: #fillScreenOff] ifFalse: [ menu add: 'Enter User Mode' action: #fillScreenOn. menu add: 'Save Image in User Mode' action: #saveImageForEndUser]]. menu addLine. menu add: 'Quit' action: #quitScratch. menu localize. #(2 4 5 6 7) do: [:n | menu labels at: n put: ((menu labels at: n) copyFrom: 1 to: (menu labels at: n) size - 1), ScratchTranslator ellipsesSuffix]. menu invokeOn: self at: aMenuTitleMorph bottomLeft + (0@10). ! ! !ScratchFrameMorph methodsFor: 'file read/write' stamp: 'BC 3/30/2013 18:14'! class | fName result | self closeMediaEditorsAndDialogs ifFalse: [^ self]. self stopAll. fName _ ScratchFileChooserDialog saveScratchFileFor: self. (fName size = 0 or: [fName = #cancelled]) ifTrue: [^ self]. [(result _ ScratchFileChooserDialog confirmFileOverwriteIfExisting: fName) = false] whileTrue: [ fName _ ScratchFileChooserDialog saveScratchFileFor: self. (fName size = 0 or: [fName = #cancelled]) ifTrue: [^ self]]. (result = #cancelled) ifTrue: [^ self]. self updateLastHistoryEntryIfNeeded. fName _ (self nameFromFileName: fName), '.class'. projectDirectory _ FileDirectory on: (FileDirectory dirPathFor: fName). projectName _ FileDirectory localNameFor: fName. projectInfo at: 'author' put: author. self updateHistoryProjectName: projectName op: 'save'. self writeScratchProject. ! ! !ScratchFrameMorph methodsFor: 'file read/write' stamp: 'BC 3/30/2013 18:15'! importScratchProject "Allow the user to select a project to open, then merge that project's sprites with the current project." | response | self closeMediaEditorsAndDialogs ifFalse: [^ self]. self stopAll. response _ ScratchFileChooserDialog chooseExistingFileType: #project extensions: #(.class) title: 'Import Class'. response ifNil: [^ self]. self importSpriteOrProject: response. ! !
I'm pretty sure you're on the wrong page.
Offline
jvvg wrote:
While this would help kids learn more complicated languages, it would be WAY too complicated to implement in a language designed for people who have no experience with programming whatsoever. Also, it just doesn't fit in Scratch's model.
Hey, my friend is young and he knows java!
Offline
joshuaho wrote:
jvvg wrote:
While this would help kids learn more complicated languages, it would be WAY too complicated to implement in a language designed for people who have no experience with programming whatsoever. Also, it just doesn't fit in Scratch's model.
Hey, my friend is young and he knows java!
But kids learning programming using Scratch most likely don't.
Offline
kayybee wrote:
joshuaho wrote:
jvvg wrote:
While this would help kids learn more complicated languages, it would be WAY too complicated to implement in a language designed for people who have no experience with programming whatsoever. Also, it just doesn't fit in Scratch's model.
Hey, my friend is young and he knows java!
But kids learning programming using Scratch most likely don't.
Yeah
I started learning Java (but switched to PHP) AFTER learning Scratch
Offline
kayybee wrote:
machinespray wrote:
Would this help or am I on the wrong page?
Code:
'From MIT Squeak 0.9.4 (June 1, 2003) [No updates present.] on 30 March 2013 at 6:15:42 pm'! !ScratchFrameMorph methodsFor: 'menu/button actions' stamp: 'BC 3/30/2013 18:13'! fileMenu: aMenuTitleMorph | menu | menu _ CustomMenu new. menu add: 'New' action: #newScratchProject. menu add: 'Open' action: #openScratchProject. menu add: 'Save' action: #saveScratchProjectNoDialog. menu add: 'Save As' action: #saveScratchProject. menu addLine. menu add: 'Export Class' action: #class. menu add: 'Import Class' action: #importScratchProject. menu add: 'Export Sprite' action: #exportSprite. menu addLine. menu add: 'Project Notes' action: #editNotes. Sensor shiftPressed ifTrue: [ "developer menu" menu addLine. menu add: 'Write Project Summary' action: #writeSummaryFile. menu add: 'Write Multiple Project Summaries' action: #writeMultipleSummaries. menu addLine. fillScreenFlag ifTrue: [ menu add: 'Exit User Mode' action: #fillScreenOff] ifFalse: [ menu add: 'Enter User Mode' action: #fillScreenOn. menu add: 'Save Image in User Mode' action: #saveImageForEndUser]]. menu addLine. menu add: 'Quit' action: #quitScratch. menu localize. #(2 4 5 6 7) do: [:n | menu labels at: n put: ((menu labels at: n) copyFrom: 1 to: (menu labels at: n) size - 1), ScratchTranslator ellipsesSuffix]. menu invokeOn: self at: aMenuTitleMorph bottomLeft + (0@10). ! ! !ScratchFrameMorph methodsFor: 'file read/write' stamp: 'BC 3/30/2013 18:14'! class | fName result | self closeMediaEditorsAndDialogs ifFalse: [^ self]. self stopAll. fName _ ScratchFileChooserDialog saveScratchFileFor: self. (fName size = 0 or: [fName = #cancelled]) ifTrue: [^ self]. [(result _ ScratchFileChooserDialog confirmFileOverwriteIfExisting: fName) = false] whileTrue: [ fName _ ScratchFileChooserDialog saveScratchFileFor: self. (fName size = 0 or: [fName = #cancelled]) ifTrue: [^ self]]. (result = #cancelled) ifTrue: [^ self]. self updateLastHistoryEntryIfNeeded. fName _ (self nameFromFileName: fName), '.class'. projectDirectory _ FileDirectory on: (FileDirectory dirPathFor: fName). projectName _ FileDirectory localNameFor: fName. projectInfo at: 'author' put: author. self updateHistoryProjectName: projectName op: 'save'. self writeScratchProject. ! ! !ScratchFrameMorph methodsFor: 'file read/write' stamp: 'BC 3/30/2013 18:15'! importScratchProject "Allow the user to select a project to open, then merge that project's sprites with the current project." | response | self closeMediaEditorsAndDialogs ifFalse: [^ self]. self stopAll. response _ ScratchFileChooserDialog chooseExistingFileType: #project extensions: #(.class) title: 'Import Class'. response ifNil: [^ self]. self importSpriteOrProject: response. ! !I'm pretty sure you're on the wrong page.
It is a patch that allows you to import and export things like classes in the java program.
Offline