{"id":76,"date":"2007-03-17T10:06:18","date_gmt":"2007-03-17T18:06:18","guid":{"rendered":"http:\/\/jaredrobinson.com\/blog\/?p=76"},"modified":"2007-03-17T10:06:18","modified_gmt":"2007-03-17T18:06:18","slug":"mtnwestruby-review-of-a-rails-app","status":"publish","type":"post","link":"https:\/\/jaredrobinson.com\/blog\/mtnwestruby-review-of-a-rails-app\/","title":{"rendered":"mtnwestruby: Review of a Rails App"},"content":{"rendered":"<p>\nmtnwestruby: Review of a Rails App by Marcello and Jamis of 37signals.com<br \/>\n17 March 2007\n<\/p>\n<p>\nAlmost everyone in the audience has used Rails. A little less than have write Rails apps for a living. I haven&#8217;t used Rails, and even if I had, it would be difficult to take notes on this presentation. I recommend viewing the video when it becomes available.<\/p>\n<p>\nMarcello and Jamis recommend Kent Beck&#8217;s book on <a href=\"http:\/\/www.amazon.com\/Smalltalk-Best-Practice-Patterns-Kent\/dp\/013476904X\">Smalltalk best practices<\/a> and how to decide what code belongs where. They also recommend <a href=\"http:\/\/domaindrivendesign.org\/books\/index.html\">Domain Driven Design<\/a>.<\/p>\n<p>\nWhy do you prefer the operator &#8216;&amp;&amp;&#8217; over &#8216;and&#8217;? The use of &#8216;&amp;&amp;&#8217; leads to fewer bugs. Consider the following code:<\/p>\n<ul>\n<li><code>return foo and bar <\/code> # will not return what you expect\n<li><code>return (foo and bar) <\/code> # this will work\n<li><code>return foo &amp;&amp; bar <\/code> # use &#8216;&amp;&amp;&#8217; and &#8216;||&#8217; because they&#8217;re more predictable in behavior than &#8216;and&#8217; and &#8216;or&#8217;\n<\/ul>\n<\/p>\n<p>\nConvention: A bad smell in code is seeing a chain of if..elsif<br \/>\nstatements to check for error conditions. In this case, you probably want to<br \/>\nhandle error cases with exceptions. For example, in Rails, myobj.save! will<br \/>\nvalidate data, and raise an exception when there&#8217;s a problem, whereas<br \/>\nmyobj.save will not raise an exception.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>mtnwestruby: Review of a Rails App by Marcello and Jamis of 37signals.com 17 March 2007 Almost everyone in the audience has used Rails. A little less than have write Rails apps for a living. I haven&#8217;t used Rails, and even if I had, it would be difficult to take notes on this presentation. I recommend &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/jaredrobinson.com\/blog\/mtnwestruby-review-of-a-rails-app\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;mtnwestruby: Review of a Rails App&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,17],"tags":[],"class_list":["post-76","post","type-post","status-publish","format-standard","hentry","category-programming","category-tech"],"_links":{"self":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/76","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/comments?post=76"}],"version-history":[{"count":0,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/76\/revisions"}],"wp:attachment":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/media?parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/categories?post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/tags?post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}