3 ms·
Maybe they mean rather than: if (thingThatIsTrue): // a bunch of logic here... else: // different logic here... they mean: if (thingThatIsTrue): re
by corps_and_code 18d ago
Maybe they mean rather than:
if (thingThatIsTrue):
// a bunch of logic here...
else:
// different logic here...
they mean:
if (thingThatIsTrue):
return doThisWhenTrue()
return dothisWhenFalse()
Just a simple example. I'm not sure if this is what you consider "obfuscating" the branches. Logically the same, but a bit more linear to understand?
Edit: I am bad at formatting comments here.
- taink 18d agoPutting two spaces before the line formats is as code. Example: No space before start of line. One space before start of line. Two spaces before start of line. Thus, you can put multiple lines of code with indentation as well as long as you put two spaces at the start of the line: int main() { return 0; } int main() { return 0; } See https://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc
- corps_and_code 18d agoOh perfect, thanks!