#Before and after of my code

1 messages · Page 1 of 1 (latest)

heavy lichen
#

didnt know if that part was better that way
if (sender instanceof Player p ){
or that way
if (!(sender instanceof Player)){return false}

#

so I kept the one that would make me assign one less variable

stoic karma
#

you can make an early return to not indent it so much

#

i.e. if (!(p instanceof Player player) return false;

#

and then below that the rest of the function

#

the variable player will still be usable even if its outside of the if's scope technically

bold flame
#

i can’t view it on my phone

heavy lichen
heavy lichen
heavy lichen
stoic karma
#

why not

heavy lichen
#

oh wait I think it does

#

i misplaced the }

#

with an )

#

sorry lol

heavy lichen
heavy lichen
#

with your tips I was able to impress my internship supervisor

heavy lichen
#

yeah, thank you both 😄

#

actually, you 3

bold flame
#

nice bro that’s sick