try and try! in Rails 4.0

Can we please call the new try something else, and leave try doing what it already does?

The new behavior was discussed at the time #try originally went in, and, with some dissenters, it was agreed that it was less useful for most people because any typo now becomes an expression that returns nil rather than an error you can see and fix.

More generally, changing the semantics in the way that has been described is really confusing two very different things, and makes for a huge amount of search-and-replacing for those of us who read the changelogs and a lot of broken apps for those who don't.

Try isn't a great name anyway. We can just pick another.

Can you show me some of the many places where your app now breaks because we don’t raise an exception on #try?

Also, this is why we do major releases, so we can break backwards compatibility in order to improve the API.

Having #try! be the exception raising version of #try makes perfect sense to me. And I find the #try that doesn’t raise exceptions much more useful in my work.

Feel free to suggest a better name, but odds are low that it’ll be accepted. Of course, the great thing about Ruby is that you can add your own alias.

Enjoy!

Only apps that have bugs. But that’s the thing - currently you find out about the bugs, now you won’t.

Remember how great it was when we had to write ActionScript and it just silently swallowed all the errors and you couldn’t find out where your code was breaking?

No? It wasn’t great, it was a PITA :).