News for hackers. Stuff that matters.
Re:My Thoughts on “Bad Code” by Jtsummers on Friday March 17, 2023 @12:06AM (#35192971)
The term for that is a "guard". Swift took it literally and introduced guard statements which force you to terminate the containing scope (return, throw, continue, break) or call a function that is marked as never returning. If control flow can ~~enter~~ exit the body of the guard statement without hitting one of those, it's a compiler error.

EDIT: Exit the body of the guard statement, not enter.

Re:My Thoughts on “Bad Code” by latexr on Friday March 17, 2023 @07:24AM (#35195560)
> ~~enter~~

I get you’re going for the non-standard markdown strike through, but that looks confusing and calls attention to something you meant to remove. You can (well, could) remove the word when editing.

Re:My Thoughts on “Bad Code” by pdpi on Friday March 17, 2023 @07:46AM (#35195723)
It is possibly the one Markdown feature I'd like HN to have. I use it all the time on Reddit to correct my comments without making replies look like nonsense.
Re:My Thoughts on “Bad Code” by veyh on Friday March 17, 2023 @11:06PM (#35205649)
You can use unicode, l̶i̶k̶e̶ ̶t̶h̶i̶s̶