24

Confession: i hate inline ifs and i cant even spot them in the code.

Comments
  • 5
    I hate if without curly brackets
  • 2
    What about ternary operations?
  • 1
    @BellAppLab that...that is inline if
  • 9
    I understand inline if as:

    `if (something) doSomething();`

    And ternary as:

    `return cool ? "Cool" : "Not cool";`

    Or are the names interchangeable?

    🤔
  • 1
    @BellAppLab i wasnt aware people called ?: ternary, i guess the names are interchangable
  • 4
    @BellAppLab yeah it seems so lol
  • 7
    @RazorSh4rk we learned something today!! \o/
  • 3
    I'm su bad at ternary operators. It's not inherently obvious whether the true statement goes first or the false one.
  • 2
    Trying to understand inline lambdas in C++ is worse and you might end up shooting yourself
  • 1
    @bdhobare we have them as function arguments in our source code. I think that they suck for different reasons, though. They're rare enough that I just Google the syntax for a refresher if I need it.
  • 4
    @bdhobare i prefer it this way
  • 0
    @bdhobare naughty!
  • 2
    If not abused, it makes the code more readable in my opinion. What you should never do is to nest ternary operations, THAT is confusing.
Add Comment