Discuss Scratch
- Discussion Forums
- » Suggestions
- » Code Scratch in Text
- -stache-
-
500+ posts
Code Scratch in Text
Because scratch was not designed to be a text-based language… A text-based language just wouldn't work…And why couldn't it be able to do that with text-based programming as well? Scratch is to help people to get rid of their fears of programming by making things big chunky and colorful.
What'd it do if you tried to “compile”
1^2-1+6
Would it follow the order of operations like “(1^2)-(1+6)” which few beginners understand, or something like “((1^2)-1)+6”? Also, would it just be like
say (theanswertotheequation)or would it do nothing?
- NoxSpooth
-
1000+ posts
Code Scratch in Text
“Why use X when you can use Y, which is way more powerful?” I think that @-stache-'s point was that if you are willing to learn text based scratch, just go ahead and learn a “real” text based language like Python or JS, which are both much more powerful than Scratch.
I don't necessarily agree with that statement because it can already be used against Scratch in general. If other programming languages are more powerful and already easy to use, according to -stache-, then why bother using Scratch at all?
The thing is, it's meant to introduce people to the programming environment. How would it be harmful in any way to assist younglings with the text-based environment as well?
- -stache-
-
500+ posts
Code Scratch in Text
lol younglings“Why use X when you can use Y, which is way more powerful?” I think that @-stache-'s point was that if you are willing to learn text based scratch, just go ahead and learn a “real” text based language like Python or JS, which are both much more powerful than Scratch.
I don't necessarily agree with that statement because it can already be used against Scratch in general. If other programming languages are more powerful and already easy to use, according to -stache-, then why bother using Scratch at all?
The thing is, it's meant to introduce people to the programming environment. How would it be harmful in any way to assist younglings with the text-based environment as well?
Because scratch already pushes people into bad programming habits.

For example,
switch(value) {
case "thisvalue":
dostuff...
break;
case "thatvalue"
dootherstuff...
break;
}
if <(value) = [thisvalue]> thenby most scratchers who don't know better, and this can be dramatically slower than the thing that JS already gives you because the scratch version is in O(n) time while the JS version is optimized.
dostuff...
else
if <(value) = [thatvalue]> then
dostuff...
end
end
- NoxSpooth
-
1000+ posts
Code Scratch in Text
Point taken. I still believe this would be a great idea, though. So maybe we could do something to optimize Scratch in some sort.
- -stache-
-
500+ posts
Code Scratch in Text
FYI I am working on making a scheme-like language to help kids learn, while having features like lambda, hash tables, and much more! Point taken. I still believe this would be a great idea, though. So maybe we could do something to optimize Scratch in some sort.
The benefits of teaching with text-based languages is that you have access to everything, while you don't necessarily have to know about them and be afraid of them.
- Jonathan50
-
1000+ posts
Code Scratch in Text
O(n) time while the JS version is optimized.I understand nothing about big O, but isn't that better than O(n)? I think it would be O(n) if it was like by most scratchers who don't know better, and this can be dramatically slower than the thing that JS already gives you because the scratch version is in
if <(value) = [thisvalue]> thenI think the biggest problem with nesting IF THEN ELSEs is it's unreadable.
dostuff...
end
if <(value) = [thatvalue]> then
dostuff...
end
Last edited by Jonathan50 (Sept. 28, 2016 21:06:02)
- -stache-
-
500+ posts
Code Scratch in Text
Oh yeah… It is O(log2(n))…O(n) time while the JS version is optimized.I understand nothing about big O, but isn't that better than O(n)? I think it would be O(n) if it was like by most scratchers who don't know better, and this can be dramatically slower than the thing that JS already gives you because the scratch version is inif <(value) = [thisvalue]> thenI think the biggest problem with nesting IF THEN ELSEs is it's unreadable.
dostuff...
end
if <(value) = [thatvalue]> then
dostuff...
end
The best way is using jump tables …
- banana439monkey
-
1000+ posts
Code Scratch in Text
Duplicate https://scratch-mit-edu.ezproxyberklee.flo.org/discuss/topic/232783/?page=1#post-2367267 (and by the way, even though it's a newer topic, it was reposted after one older than this)
Banana
EDIT: Whoops.
Banana
EDIT: Whoops.
Last edited by banana439monkey (Jan. 27, 2017 18:58:22)
- PAPERKING
-
72 posts
Code Scratch in Text
if you're saying scripts instead of blocks, then im pretty sure scratch would lose its simplicity.
- Pezd
-
100+ posts
Code Scratch in Text
I think it would make the transition from programming in scratch to doing other text-based programming easier.
- SuperDoom
-
1000+ posts
Code Scratch in Text
100% support.
This needs to happen, and while tosh seems like the right thing, it doesn't convert the blocks into JavaScript/6502/C#/anything useful (I don't think).
Also, I tried that as its own project: Scritch!
This needs to happen, and while tosh seems like the right thing, it doesn't convert the blocks into JavaScript/6502/C#/anything useful (I don't think).
Also, I tried that as its own project: Scritch!
- Botcho_Otkho
-
1000+ posts
Code Scratch in Text
No support. If you want a text code,just move to another programming language.
- MrCrazy455
-
2 posts
Code Scratch in Text
It doesn't matter the age of the people that do this, for the ones that want to convert scratch blocks to, say, Java or Python, there should be an option. I would personally like this, for I have my reasons.
when green flag clicked
forever
if <key [ space] pressed> then
think [SLOOOOOOOW DOOOOOWN] for (2) secs
end
end
Last edited by MrCrazy455 (Sept. 19, 2017 04:03:27)
- DaEpikDude
-
1000+ posts
Code Scratch in Text
1: Don't blockspam. It doesn't matter the age of the people that do this, for the ones that want to convert scratch blocks to, say, Java or Python, there should be an option. I would personally like this, for I have my reasons.when green flag clicked
forever
if <key [ space] pressed> then
think [SLOOOOOOOW DOOOOOWN] for (2) secs
end
end
2: There are lots of things in Scratch that just don't convert well to other languages (for example, Python: how would the project draw sprites? How would it know to import time for time.sleep if there was a wait block? etc). Plus, if someone wanted to code in another language, shouldn't they be learning that other language?
No support for reasons stated above.
- Sean222
-
12 posts
Code Scratch in Text
You can use the same method used for hacking scratch blocks; opening it with a zip opener and editing the project.json.
- Charles12310
-
1000+ posts
Code Scratch in Text
Support. Since we can't convert Scratch to other programming languages, I think it's good what Scratch should have their own text-language. There should be an option and should be for advanced (no not advanced commands but a more advanced appearance for scripts) (or not) such as:
This is just an example. If you want it simple then that is fine.
onGreenFlagClick [
forever [
if votes > 9 then
sprite.say(“About 10 votes! Awesome!”)
else
sprite.say(“Keep it up!”)
end]
end]
def script change position by x: (var x) y: (var y) [
sprite.xPosition = sprite.xPosition + x
sprite.yPosition = sprite.yPosition + y
end]
onReceive(“Stop all”) [
sprite.stop.otherscripts
end]
onGreenFlagClick [
var.local.allsprites = timer1
sprite.timer.reset
forever [
timer = sprite.timer + 0.1
end]
def boolean stopSignclick [
return sprite.timer > sprite.vars.timer
This is just an example. If you want it simple then that is fine.
- I-Iz-A-Litten
-
1000+ posts
Code Scratch in Text
no support, Scratch is supposed to be four 7 year-olds, this isn't Unity
Last edited by I-Iz-A-Litten (Nov. 14, 2017 02:17:46)
- I-Iz-A-Litten
-
1000+ posts
Code Scratch in Text
True but there are older kids to and it is a good idea to have a Choice between block coding and the ability to type it as well No support. Scratch is made up of younger kids, and you thing 6 and 5 years old can do it?
there are other programs for that
- Discussion Forums
- » Suggestions
-
» Code Scratch in Text