From: Dave Thomas Date: 2001-06-27T22:21:46+09:00 Subject: [ruby-talk:16966] Re: finalizers, destructors and whatnot Fritz Heinrichmeyer writes: > i interpreted David Leals posting in the way that he is concerned about > the very expensive resource "database-connection" (one connection => one > postgres daemon). With reference counting languages you get rid of them > immediately. With ruby maybe enforcing garbage collection is worth it in > this case (or using some kind of database pooling). I think that may have been the case. However, often the situation doesn't really arise in Ruby, as blocks are used for these kind of purposes. I've personally switched over to a style where 99% of resource management is done using blocks, and it really does make life simpler: DB.connect(name, pw) do |db| # .. do lots of database stuff end Regards Dave