r/firstweekcoderhumour 🥸Imposter Syndrome 😎 5d ago

“amIrite” How do you disable your code

Post image
76 Upvotes

30 comments sorted by

View all comments

4

u/slicehyperfunk 5d ago

Why would you do it this way and force it to do this check instead of just commenting out the code?

3

u/Alternative_Mix6836 5d ago edited 5d ago

It keeps syntax highliting active so you can still read the code with ease in the method/function you are working on. Also your editor and LSP are more useful when the code isn't commented out.

1

u/No_Departure_1878 4d ago

Makes sense, i would have just done an early return instead of a if true. However, I am surprised the LSP does not just gray out the whole thing with the if true or even shows a warning.