Discuss Scratch

ihavenocluewhythisis
Scratcher
500+ posts

Elif (else-if) block

Sussycrewmate12 wrote:

Support because this would make most codes become a large mess of orange blocks a bit less, and also because I might as well because I supported a dupe.
what dupe?
Pengufenhoffer
Scratcher
100+ posts

Elif (else-if) block

ihavenocluewhythisis wrote:

scimonster wrote:

mathfreak231 wrote:

First of all, nobody calls it Elif. It's “elseif” or “else if”.
Python users do, as that's the name of the Python keyword.

What's wrong with simply stacking if/elses?
if <...> then
...
else
if <...> then
...
else
if <...> then
...
else
if <...> then
...
else
...

its too big

What if we could make switch statements in scratch? As in java.
switch() {
case 1:
does_something;
case 2:
does_something_else;
case 3:
does_something_completely _different;
default:
does_something_significantly_less_exciting;
}
iiucandyfloss
Scratcher
1000+ posts

Elif (else-if) block

What is the need for this?

There is already the
if <> then 



else

end

block, so why do we need a separate block made?

The workaround is very clear. Additionally, the name “Elif” is not very clear. Scratch is supposed to be easy for New Scratchers to understand and grasp the concept of, not an advanced coding platform.
starlightsparker
Scratcher
1000+ posts

Elif (else-if) block

iiucandyfloss wrote:

What is the need for this?

There is already the
if <> then 



else

end

block, so why do we need a separate block made?

The workaround is very clear. Additionally, the name “Elif” is not very clear. Scratch is supposed to be easy for New Scratchers to understand and grasp the concept of, not an advanced coding platform.
FOR THE LAST TIME
ITS MESSY
NESTING IF ELSE BLOCKS MAKES IT MESSY, THIS WOULD BE MORE ORGANIZED
This workaround has been said 1000000102083937937937292 times, it doesn’t need to be repeated so many times it’s literally just annoying at this point.
iiucandyfloss
Scratcher
1000+ posts

Elif (else-if) block

starlightsparker wrote:

iiucandyfloss wrote:

Why do we need a separate block made?
FOR THE LAST TIME
ITS MESSY
NESTING IF ELSE BLOCKS MAKES IT MESSY, THIS WOULD BE MORE ORGANIZED
This workaround has been said 1000000102083937937937292 times, it doesn’t need to be repeated so many times it’s literally just annoying at this point.

1) Please calm down. Capitalising your letters does not help your point, it actually undermines it by making you seem uncontrolled and angry. I think that is not your aim. Am I correct?

2) And? It's still an extremely suitable workaround, and is less complicated.

3) Telling me that I'm being annoying doesn't help. Also, saying so is rather rude, please calm down and stop shouting at people who are trying to discuss a topic in a civil manner.

4) Code is not supposed to be a pretty piece of art that you can stare at because of its beauty.

5) “If else”. Does that make sense? It is not very clear. What happens if the “if” is true? This workaround would solve this:

if <> then
set [ v] to [1]
end

if <<[v] = [1] >> then

end

The second piece of code serves the “Else” purpose. The first section of code adds the feature of changing a variable based on the result of the “if” block, which is what causes the second piece of code to work properly.
The first workaround is much more simple. Do you agree?

Last edited by iiucandyfloss (May 14, 2024 20:27:11)

starlightsparker
Scratcher
1000+ posts

Elif (else-if) block

iiucandyfloss wrote:

What is the need for this?

There is already the
if <> then 



else

end

block, so why do we need a separate block made?

The workaround is very clear. Additionally, the name “Elif” is not very clear. Scratch is supposed to be easy for New Scratchers to understand and grasp the concept of, not an advanced coding platform.
… did I not just answer you?
iiucandyfloss
Scratcher
1000+ posts

Elif (else-if) block

starlightsparker wrote:

iiucandyfloss wrote:

What is the need for this?

There is already the
if <> then 



else

end

block, so why do we need a separate block made?

The workaround is very clear. Additionally, the name “Elif” is not very clear. Scratch is supposed to be easy for New Scratchers to understand and grasp the concept of, not an advanced coding platform.
… did I not just answer you?

Sorry, I had this on one tab because of the 60 second rule and then I accidentally posted on another tab and the action was repeated . However, i have edited the post now, you can have a look at it.
cuddlyscout
Scratcher
21 posts

Elif (else-if) block

I was literally just going to comment on this when I saw this… What a coincidence! I 100 percent agree with this and want it added super badly. I hate having to stack if/else blocks. I think there should be a little symbol on the end of the if/else blocks to add more else blocks, and make the previous blocks if else blocks.
I Program in C# (And Various other languages as well) and most of them all contain some soft of if else statement.
This would:
  • Create cleaner code easier to read
  • Potentially make programs faster by not having to call as many if/elses.
In my opinion, this is a must.
Although please let's not name if “elif”. THat's confusing for beginners, and scratch is against that. Just stick with the classic JavaScript “else if {}”

If this is denied, I would request switch statements similar to JavaScript. This would also be nice.

Last edited by cuddlyscout (May 14, 2024 23:08:22)

ihavenocluewhythisis
Scratcher
500+ posts

Elif (else-if) block

cuddlyscout wrote:

I was literally just going to comment on this when I saw this… What a coincidence! I 100 percent agree with this and want it added super badly. I hate having to stack if/else blocks. I think there should be a little symbol on the end of the if/else blocks to add more else blocks, and make the previous blocks if else blocks.
I Program in C# (And Various other languages as well) and most of them all contain some soft of if else statement.
This would:
  • Create cleaner code easier to read
  • Potentially make programs faster by not having to call as many if/elses.
In my opinion, this is a must.
Although please let's not name if “elif”. THat's confusing for beginners, and scratch is against that. Just stick with the classic JavaScript “else if {}”

If this is denied, I would request switch statements similar to JavaScript. This would also be nice.
#python
starlightsparker
Scratcher
1000+ posts

Elif (else-if) block

iiucandyfloss wrote:

starlightsparker wrote:

iiucandyfloss wrote:

Why do we need a separate block made?
FOR THE LAST TIME
ITS MESSY
NESTING IF ELSE BLOCKS MAKES IT MESSY, THIS WOULD BE MORE ORGANIZED
This workaround has been said 1000000102083937937937292 times, it doesn’t need to be repeated so many times it’s literally just annoying at this point.

1) Please calm down. Capitalising your letters does not help your point, it actually undermines it by making you seem uncontrolled and angry. I think that is not your aim. Am I correct?

2) And? It's still an extremely suitable workaround, and is less complicated.

3) Telling me that I'm being annoying doesn't help. Also, saying so is rather rude, please calm down and stop shouting at people who are trying to discuss a topic in a civil manner.

4) Code is not supposed to be a pretty piece of art that you can stare at because of its beauty.

5) “If else”. Does that make sense? It is not very clear. What happens if the “if” is true? This workaround would solve this:

if <> then
set [ v] to [1]
end

if <<[v] = [1] >> then

end

The second piece of code serves the “Else” purpose. The first section of code adds the feature of changing a variable based on the result of the “if” block, which is what causes the second piece of code to work properly.
The first workaround is much more simple. Do you agree?
We all have our breaking point, sorry I was getting Irritated by how many times this dang workaround has been said lol. If it helps I’m a kid and I don’t always think before speaking :’)
Also, while the suggestion may have flaws, the flaw that the workaround is really irritating and annoying to work with. It becomes really messy. Especially for projects that already have so many blocks.

Also it’s not if else it’s else if.

So it would detect if condition is true, if not it resorts to “else if” and if that condition isn’t met it resorts to the other else if till all of them are checked
It’s not rocket science


By the way I didn’t call you annoying I called the extensive amount of times this workaround has been said annoying.
I have somewhat anger issues and have trouble controlling them, while I do think I came off as rude, im just putting this here so you know it didn’t come from my heart. I’m sorry, though. Also, I'm probably not gonna sleep tonight knowing the thing happened where I break and shout but the other end is all mature so I'm left looking like an immature brat-

Edit:
Ohhh I just realized now you mean in this post stacking if blocks, not nesting if else blocks.
Not even sure if that works the same actually. I'll wait for someone else to respond

Last edited by starlightsparker (May 15, 2024 16:33:33)

julmik6478
Scratcher
500+ posts

Elif (else-if) block

You can make IT like this:
if <> then 



else
if <> then

end
end
starlightsparker
Scratcher
1000+ posts

Elif (else-if) block

julmik6478 wrote:

You can make IT like this:
if <> then 



else
if <> then

end
end
(I'm holding it in oh my GOD I'm gonna scream)
Perhaps read other replies before posting next time just in case this workaround has posted before about 9 trillion times /hj
This isn't a good workaround because when nested it becomes messy.
iiucandyfloss
Scratcher
1000+ posts

Elif (else-if) block

starlightsparker wrote:

We all have our breaking point, sorry I was getting Irritated by how many times this dang workaround has been said lol. If it helps I’m a kid and I don’t always think before speaking :’)
Also, while the suggestion may have flaws, the flaw that the workaround is really irritating and annoying to work with. It becomes really messy. Especially for projects that already have so many blocks.
That's quite all right.
I was a young child once too, you know! I understand.
Mess is less annoying than difficulty coding. Do you agree?

starlightsparker wrote:

Also it’s not if else it’s else if.

Right.

starlightsparker wrote:

So it would detect if condition is true, if not it resorts to “else if” and if that condition isn’t met it resorts to the other else if till all of them are checked
It’s not rocket science

This is much more confusing than a simple “If < > is true, then _____” “If else(not), then __________”

If you're trying to tell me, “It's not that hard to understand,” drop it.
Telling me something is easy does not make it easier.

starlightsparker wrote:

By the way I didn’t call you annoying I called the extensive amount of times this workaround has been said annoying.

Can you give me one valid reason why the workaround is not suitable? That's not “It's messy” because that is like saying, “I won't code something I want to code because it's too long and messy even though I understand the code,” ?

The repetition of this workaround is highly relevant to the discussion.

starlightsparker wrote:

I have somewhat anger issues and have trouble controlling them, while I do think I came off as rude, im just putting this here so you know it didn’t come from my heart. I’m sorry, though. Also, I'm probably not gonna sleep tonight knowing the thing happened where I break and shout but the other end is all mature so I'm left looking like an immature brat-


1) Okay

2) Let's get this straight. It didn't just come off as rude; it was rude.

3) That's fine

4) Are you trying to guilt trip me here, or use a sob story? If you are, drop it; I don't have time to be manipulated, I have exams to prepare for. If not, I'm not trying to insult you, this is a genuine question.

5) Don't think I don't have a sense of humour

6) And no, you're not an immature brat, only if you act like one. And those actions were immature-brat-ly but that doesn't mean you are an immature brat.
You realised your mistake and how you acted and came to your senses; that takes a strong character, not an “immature brat”.

starlightsparker
Scratcher
1000+ posts

Elif (else-if) block

iiucandyfloss wrote:

starlightsparker wrote:

I have somewhat anger issues and have trouble controlling them, while I do think I came off as rude, im just putting this here so you know it didn’t come from my heart. I’m sorry, though. Also, I'm probably not gonna sleep tonight knowing the thing happened where I break and shout but the other end is all mature so I'm left looking like an immature brat-


1) Okay

2) Let's get this straight. It didn't just come off as rude; it was rude.

3) That's fine

4) Are you trying to guilt trip me here, or use a sob story? If you are, drop it; I don't have time to be manipulated, I have exams to prepare for. If not, I'm not trying to insult you, this is a genuine question.

5) Don't think I don't have a sense of humour

6) And no, you're not an immature brat, only if you act like one. And those actions were immature-brat-ly but that doesn't mean you are an immature brat.
You realised your mistake and how you acted and came to your senses; that takes a strong character, not an “immature brat”.

I know this is off topic but I need to respond to this
1. Okay
2. I know, I probably shouldn’t have worded that like that but I did mean that it was rude, for some reason I always word it like that by habit but “was rude” is what I mean by that : p
3. ok
4. uh, no? I wanna say something else but that’d also turn into a “sob story” unintentionally even though I don’t mean to manipulate anybody so I’ll probably do so yeah I’ll just say uh, no
5. what does that mean
6. good to know

iiucandyfloss
Scratcher
1000+ posts

Elif (else-if) block



starlightsparker wrote:

iiucandyfloss wrote:

2) Let's get this straight. It didn't just come off as rude; it was rude.

3) That's fine

4) Are you trying to guilt trip me here, or use a sob story? If you are, drop it; I don't have time to be manipulated, I have exams to prepare for. If not, I'm not trying to insult you, this is a genuine question.

5) Don't think I don't have a sense of humour

6) And no, you're not an immature brat, only if you act like one. And those actions were immature-brat-ly but that doesn't mean you are an immature brat.
You realised your mistake and how you acted and came to your senses; that takes a strong character, not an “immature brat”.

I know this is off topic but I need to respond to this
1. Okay
2. I know, I probably shouldn’t have worded that like that but I did mean that it was rude, for some reason I always word it like that by habit but “was rude” is what I mean by that : p
3. ok
4. uh, no? I wanna say something else but that’d also turn into a “sob story” unintentionally even though I don’t mean to manipulate anybody so I’ll probably do so yeah I’ll just say uh, no
5. what does that mean
6. good to know



1. Does your story fit into these:

a) It's a fake story
b) It's said to make someone do something because of pity or guilt
c) It's highly overexaggerated e.g. Normal:“ I'm disappointed because I got denied into a university but at least I was accepted into another one” VS s.s.: “I'm dEvAsTaTeD because my life's opportunities are ruined, my future is destroyed, my dreams are crushed, my alternative is a really bad university (but actually it was smth like refusal to Harvard but accepted into Oxford ) and I feel like crying my eyes out”

2 . I meant, “I'm not an 8 year old, but I wasn't born in 1892 lol”

Last edited by iiucandyfloss (May 15, 2024 19:03:55)

starlightsparker
Scratcher
1000+ posts

Elif (else-if) block

iiucandyfloss wrote:

starlightsparker wrote:

iiucandyfloss wrote:

2) Let's get this straight. It didn't just come off as rude; it was rude.

3) That's fine

4) Are you trying to guilt trip me here, or use a sob story? If you are, drop it; I don't have time to be manipulated, I have exams to prepare for. If not, I'm not trying to insult you, this is a genuine question.

5) Don't think I don't have a sense of humour

6) And no, you're not an immature brat, only if you act like one. And those actions were immature-brat-ly but that doesn't mean you are an immature brat.
You realised your mistake and how you acted and came to your senses; that takes a strong character, not an “immature brat”.

I know this is off topic but I need to respond to this
1. Okay
2. I know, I probably shouldn’t have worded that like that but I did mean that it was rude, for some reason I always word it like that by habit but “was rude” is what I mean by that : p
3. ok
4. uh, no? I wanna say something else but that’d also turn into a “sob story” unintentionally even though I don’t mean to manipulate anybody so I’ll probably do so yeah I’ll just say uh, no
5. what does that mean
6. good to know



1. Does your story fit into these:

a) It's a fake story
b) It's said to make someone do something because of pity or guilt
c) It's highly overexaggerated e.g. Normal:“ I'm disappointed because I got denied into a university but at least I was accepted into another one” VS
No, not really, it’s what I said on your profile page I said it a few mins after posting this.
Back to topic,

Is this what you mean by your workaround?
if <> then

end
if <> then

end
if <> then

end
or
if <> then



else
if <> then



else
if <> then



else

end
end
end
I’m confused
medians
Scratcher
1000+ posts

Elif (else-if) block

Bringing this topic up
julmik6478
Scratcher
500+ posts

Elif (else-if) block

Possible in that ways:
if <> then 



else
if <> then

end
end

if <> then



else
if <> then



else

end
end
You can make it in amount that you want.
iiucandyfloss
Scratcher
1000+ posts

Elif (else-if) block

You can use this:

if <not <something something>> then
do something something
end

Or you can stack if elses.

Problem solved. Messy, yes, but aesthetics are not the main focus of coding. They are not the focus of coding in any sense.
ihavenocluewhythisis
Scratcher
500+ posts

Elif (else-if) block

julmik6478 wrote:

Possible in that ways:
if <> then 



else
if <> then

end
end

if <> then



else
if <> then



else

end
end
You can make it in amount that you want.
get ready to get yelled at or smth cuz people said the workaround like 100 times

Powered by DjangoBB