Question: > 
> **Possible Duplicate:**  
> 
> [Is the ternary operator evil?](https://softwareengineering.stackexchange.com/questions/28314/is-the-ternary-operator-evil) 
> 
> 
> 

Does using shorthand if else statments hurt readability?

Compare:

```
string name = street != null ? street.Owner : "Not known";

```

With:

```
string name;

if(street != null)
{
    name =  street.Owner;
}
else
{
    name = "Not known";
}

```

I have become familiar enough with the shorthand that its just as readable for short statements as the long version. Is that true for most developers or should I favor the more verbose version

Answer: 
```
string name = street != null ? street.Owner : "Not known";

```

This one was horrible to read at the first sight! I was busy figuring out `name = street` but realized later that your syntax was actually perfect. 

```
string name;

if(street != null)
{
name =  street.Owner;
}
else
{
name = "Not known";
}

```

This one i didn't too effort to understand at all (partly because the first one fixed my brain already). However, i agree that this is too inefficient. 

However, keeping brevity while the readability both, i would have done this way, 

```
string name = (street != null) ? (street.Owner) : "Not known";

```

This is fine, but i won't use ternary operator `?` in lieu of `if` ever, in case either of the clauses are more than a single variable. or any complex expression with more than 2 parenthesis or 2 lines.
I often hear form programmers coming from other languages than it hurts readability. But once they got used to it, it becomes natural. For programmers of other languages (e.g. Delphi) it may not translate to anything they already know, so they think it's difficult.

When you know the language, I think it actually improves readability (unless you chain this shorthand multiple times or use really complex conditions).