This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def do_error_prone_thing | |
begin | |
toss_peanut_and_try_catching_it_in_your_mouth | |
rescue PeanutNotCaught => e | |
casually_pretend_it_did_not_happen | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveRecord::Base.transaction do | |
PlaylistSong.delete(playlist_id:params[:playlist_id]) | |
#<create the new PlaylistSong objects | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Want to get Evernote's attention about the fact that its app has awful performance and point out an easy fix? Paste the following test into a support ticket of the type "bug report". | |
Your iOS app hangs at the drop of a hat. Though I'm sure there are tons of things that are causing the performance of the app to not be that good, the most egregious offender here is the fact that you appear to do all of your loading and synchronization in the main thread of execution of the app. | |
When you perform long running blocking operations (like syncing notes) in the main thread, the application is unusable to the user (i.e. it hangs). Furthermore, you make poor use of modern dual-core iPhones and iPads by not multithreading. | |
Please, for the love of all that is sacred, do your data synchronization on a secondary thread so that when I open the app, I can immediately get to doing what I want to do. | |
There may be some parts of this process that might have to be blocking (like updating the UITableView of notes, for instanc |
NewerOlder