No, it isn't
Offline
The 'forever if' block is so stupid that BoltBait suggested it to be removed - and we got a big wave of supporters.
The 'forever if else' block is just as silly, sorry.
Offline
Forever if is similar to a while () loop in other languages. It is not really pointless, it avoids a nesting level... (although, looking better, it seems to be duplicate in functionality with repeat until, just inverting the condition).
I just don't see the point of a forever if / else, when it is supposed to go in the else part? If the condition is no longer satisfied, it just goes out of the loop and continue below.
break (getting out of the loop and continuing with the remainder of the script) and continue (skipping remainder of the loop content to go to next loop start) blocks might be useful, though.
Offline
Phi_Lho wrote:
Forever if is similar to a while () loop in other languages.
I thought that was the "repeat until" block. (EDIT: Nvm you're right. )
Break and continue would be really useful, I agree.
Last edited by technoguyx (2010-04-08 21:12:30)
Offline
We don't really need the if else block either. You can create that with If <insert>do (blah)
If <not<insert>> do (blah)
Offline
--test_account-- wrote:
We don't really need the if else block either. You can create that with If <insert>do (blah)
If <not<insert>> do (blah)
Yes, but we have the if/else block for simplicity. Nearly any programming language lets you use "else" statements too.
And if the Scratch Team removed it for some reason, over half of the projects uploaded would be obsolete, same if they removed the forever if block.
Last edited by technoguyx (2010-04-08 21:15:19)
Offline
technoguyx wrote:
And if the Scratch Team removed it for some reason, over half of the projects uploaded would be obsolete, same if they removed the forever if block.
Nope, it would just become an obsolete block. It would turn red but still work, even though it doesn't exist anymore. Blocks like <abs( [/blocks] that have been removed still work in later versions.
Offline
hmnwilson wrote:
technoguyx wrote:
And if the Scratch Team removed it for some reason, over half of the projects uploaded would be obsolete, same if they removed the forever if block.
Nope, it would just become an obsolete block. It would turn red but still work, even though it doesn't exist anymore. Blocks like <abs( [/blocks] that have been removed still work in later versions.
But they won't work online if the java player is updated too (IIRC, blocks that are now obsolete only work offline...).
Offline
technoguyx wrote:
hmnwilson wrote:
technoguyx wrote:
And if the Scratch Team removed it for some reason, over half of the projects uploaded would be obsolete, same if they removed the forever if block.
Nope, it would just become an obsolete block. It would turn red but still work, even though it doesn't exist anymore. Blocks like <abs( [/blocks] that have been removed still work in later versions.
But they won't work online if the java player is updated too (IIRC, blocks that are now obsolete only work offline...).
The Scratch Team isn't stupid... in Scratch 2.0, they'll probably keep the functionality for the obsolete blocks.
Offline
Chrischb wrote:
Jonathanpb wrote:
The Scratch Team isn't stupid...
You're always contradicting that.
Last edited by Jonathanpb (2010-04-09 01:56:37)
Offline
First about the topic, forever if else: I don't think forever if is needed so forever if else would be more of the same uselessness.
--test_account-- wrote:
We don't really need the if else block either. You can create that with If <insert>do (blah)
If <not<insert>> do (blah)
Your statement if false!
If x=1 set x=2 else set x=3
Is not the same as...
if x=1 set x=2 if not x=1 set x=3
The second example using your method ends incorrectly with x always having the value 3 but the first example correctly gives x a value of 2 if it started with 1 and 3 if it started with any number other than 1. This is because your method evaluates x twice and x has changed since the first evaluation. The glory of if else is that it chooses between two blocks of code based on a single evaluation. Also, because your method requires two evaluations it will needlessly slow down your program.
Offline
axorion wrote:
First about the topic, forever if else: I don't think forever if is needed so forever if else would be more of the same uselessness.
--test_account-- wrote:
We don't really need the if else block either. You can create that with If <insert>do (blah)
If <not<insert>> do (blah)
Your statement if false!
Code:
If x=1 set x=2 else set x=3Is not the same as...
Code:
if x=1 set x=2 if not x=1 set x=3The second example using your method ends incorrectly with x always having the value 3 but the first example correctly gives x a value of 2 if it started with 1 and 3 if it started with any number other than 1. This is because your method evaluates x twice and x has changed since the first evaluation. The glory of if else is that it chooses between two blocks of code based on a single evaluation. Also, because your method requires two evaluations it will needlessly slow down your program.
Okay, but this thread is a bit old. (Check the date of the last post: April 9th.)
Offline