Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
sdevlin
on Jan 4, 2012
|
parent
|
context
|
favorite
| on:
A Programming Idiom You've Never Heard Of
C#'s 'using' statements allow this kind of pattern for types implementing IDisposable. It looks something like this (might be a little off):
using (var file = File.Open("foo.txt")) { ... }
dubajj
on Jan 5, 2012
[–]
This is what I thought of immediately except to implement the end with behavior you have to override the IDisposable shut down sequence? (does that make sense?)
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: