Writing Self-Confident Code Thursday, October 30, 2008 A common idiom in ruby is to call a method only if its receiver is not nil: thing.foo if thing or: thing && thing.foo Various libraries exist for making this a little more convenient. You can use andand, or if you are using Facets you can use ergo. …
Blogs / Virtuous Code ›
Latest posts
-
Writing Self-Confident Code
http://avdi.org/devblog/2008/10/30/self-confident-code/ -
Complex Hash Expectations in RSpec
http://avdi.org/devblog/2008/10/28/complex-hash-expectations-in-rspec/Complex Hash Expectations in RSpec Tuesday, October 28, 2008 When spec-ing something that calls method which takes a set of nested hashes (as many Rails methods do), it may be tempting to use #hash_including to test for only the values you care about. However #hash_including won’t work the way we might hope for nested hashes. …
-
Testing Private Methods
http://avdi.org/devblog/2008/10/21/testing-private-methods/Testing Private Methods Tuesday, October 21, 2008 Periodically the question of how to test private methods comes up at work or online. My answer is: don’t. It may seem trite, but there is some reasoning behind it. Private methods are, by definition, implementation details. …
98 blog reactions
-
Gaveen's Blog
http://gaveen.owain.orgVirtuous Code
-
Self-Confident Code
http://www.programmersparadox.com/2008/11/09/self-confident-...Pervasive null tests are a code smell.
-
locknet.ro
http://www.locknet.ro: [Ma.gnolia] Links for week 44, 200831 Oct @ 17:30 Aurelian Oancea on : good: http://news.bbc.co.uk/2/hi/europe/7701551.stm31 Oct @ 17:17 Aurelian Oancea on : Writing Self-Confident Code31 Oct @ 17:17 Aurelian Oancea on : Writing Self-Confident Code31 Oct @ 17:17 Aurelian Oancea on : Romanie, te iubesc atat de…
-
LinkRiver.com » LinkRiver Popular's River » Timeline
http://linkriver.comWriting Self-Confident Code
-
Re.Mark
http://remark.wordpress.comMonkeypatching is the practice of redefining methods in classes at runtime. According to this Wikipedia article the exact definition varies between the Ruby and Python communities. Some think it’s a good thing, while others take a different view. If you want to prevent it from happening, here’s an answer make methods immutable
-
Mark Needham
http://markhneedham.com/blogunnecessary type information and can lead to shorter methods when used well but completely unreadable code when misused. Ruby's open classes which give great flexibility when working effectively with 3rd party libraries for example but can lead to difficult debugging problems if overused. The same probably also applies to C#'s extension methods. I have no doubt there are other features in other languages and probably more in the languages I listed but those are some of the ones that stood out to me when I first saw them.
-
Giles Bowkett
http://gilesbowkett.blogspot.comsoftware for - so I'm going to bring this up in real life, but just for the record, one thing which makes me question the security of the whole shebang is that Immutable doesn't raise errors if you redefine a method and it blocks your redefinition. Method definition confusion drove the whole discussion in the first place, and here we have a solution which at the same time both prevents the problem, and guarantees that it will happen.
-
The Rubyist: August Edition
http://www.juixe.com/techknow/index.php/2008/09/08/the-rubyi...Rails Behind the Firewall What will be Ruby's legacy? Passenger Brings Rails Apps to Apache The Bad Ruby developers don't scale Funny, some Rubyists are stupider than a piece of wood Multiple vulnerabilities in Ruby The Trifecta of FAIL; or, how to patch Rails 2.0 for Ruby 1.8.7 The Informative Ruby Hoedown 2008 Video Ruby at OSCON 2008 Josh Peek officially joins the Rails core Ruby 1.9: What to Expect Interview with David Heinemeier Hansson: Rails Culture, Scaling Basecamp, and Building Successful Companies
-
Web-Program-athon
http://coding.collinchung.compreviously blogged about here The new Microsoft Live Maps and Virtual Earth is released, with reports of the overhaul coming in that it's fairly impressive. Use your Google account with OpenID, and the reasons why your killer app should already support OpenID.
-
Chip’s Quips
http://www.chipsquips.comTwo Write Hands (and two left feet)
Top Tags
What this blog is about