[ProgClub list] Memory management in C

Stuart Laughlin stuart at bistrotech.net
Sun Oct 9 03:36:54 AEDT 2011

On Fri, Oct 7, 2011 at 11:50 PM, John Elliot <jj5 at progclub.org> wrote:
> p.s. I didn't know you did much with ASP.NET. I didn't think you did web
> dev, I thought you were a WinForms database programmer. Although, by the
> sounds of it you're like me and do both.

You are correct; I did WinForms almost exclusively (just a bit of
ASP.NET WebForms here and there) thru late 2007 (or thereabouts?).
Around that time Ruby on Rails was hitting big; I looked into it and
was pretty enamored, so when my next big project came through and
called for ASP.NET I decided to make it as much like Rails as
possible. That is to say, I knew I wanted MVC and an ORM. ASP.NET MVC
didn't exist just yet, so I went with Castle MonoRail. (Boy, that was
rough. Not because of MonoRail -- MonoRail was great -- but because I
discovered that I actually had no clue how web applications actually
work. WebForms had kept me entirely ignorant with its lies and
deception.) Castle also has a Rails-like ActiveRecord project which
uses NH on the backend, but I found it too intrusive so I tossed it
and went with straight NH. MonoRail and NH with the Repository pattern
is what got me dabbling with an IoC container. Now that I've used
DI/IoC and understand it, I would hate to work on a C# project without
an IoC container.

Then in late 2008 I went back to take a second look at Rails and
company and discovered that Django kicks Rails's ass (imho of course
;). So in early 2009 I really dug into python/django, landed a big
eCommerce project, and spent most of 2009 and 2010 immersed in
django/debian/postgres/vim/etc. That project wrapped late last year.
This past year has been pretty slow professionally (which is probably
good considering it's been bonkers personally). I've had smallish
projects here and there with varying technologies, but none of them
have been very interesting. Mostly my colleague and I are trying to
reboot the software development consulting practice at the company
where we work. We used to be focused on Microsoft and BI; now we're
targeting web (esp django) and mobile (esp mono for android and
monotouch). So we'll see how that goes.

> I have to confess I've never gotten around to understanding IoC. I really
> don't get it. Something about "containers", whatever they are. I figured I'd
> have bumped into something that made it clear what it is by now, but it's
> just a technique that I've never got around to understanding. Care to
> explain IoC to me and why I should care about it?

You should care about IoC because it forces you to think about how
your classes interrelate. Thinking about dependencies drives you to
create classes that are very specific and targeted to do just one
thing. Then you can compose your classes into a system by wiring them
all up with an IoC container. It's really a great thing. Besides that,
IoC allows you to do some pretty magical things. I can't tell you the
number of times I found myself wanting to do something out of the
ordinary in MonoRail, and fretting over how in the world I was going
to accomplish it. Only to find out... oh, all I have to do is
implement this interface and register it with the container and it
just works?? Brilliant!

I'd love to explain IoC and containers in detail. But not today. It's
too nice outdoors. :)

But seriously, I will go through it with you if it's something you
want to take up presently. I know you've got several other things
cooking, so let me know. One caveat, though: if you're anything like
me I reckon you'll be like, "yeah?" I had to actually use it on faith
for a while, until I discovered its beauty and utility.

> That's cool you're loving python man. From what I see when I squint it
> sounds like the language has a pretty good reputation. I've only just
> started to learn a little bit about the language, but I really hope I don't
> end up falling in love with it. :P

Ha! I know exactly what you mean. Passions can be so... inconvenient!


More information about the list mailing list