Check if else blocks in parameters
Basically it gives a certain output depending on the condition.
Set text to ((if (1 = 1) then (yes) else (no));
The above block will output yes if 1 = 1 or no if 1 ≠ 1.
I’d use it for this type of project:
Everything
Here are some examples of Hopscotch code that could be improved if we had this:
Places where there’s a condition for the input, like ‘must be a number’
To be honest, I’m not so keen on this idea, doing this (at least in C, Java, and python. I’m pretty sure it’s not recommended in other languages, too). It’s a lot more clear when you have
if(condition){
var = something;
}
else{
var = something_else;
}
As opposed to:
var = (condition) ? something : something_else;
Especially when mixed together with other code.
This is just my (and others’) opinions, and of course you don’t have to share them.
I still really don’t see a point to this. An if/else statement is a lot more clear, and adding a one line if/else statement will just hurt the readability of a project.
Programming is all about readability, so other people can easily read and understand what you wrote, so they can help you. Adding this, in my mind, will cause more harm than good for projects. But then again, it’s not up to me. Still a nice idea though.