[ProgClub list] Memory management in C

John Elliot jj5 at progclub.org
Sun Oct 9 15:28:59 AEDT 2011

On 9/10/2011 3:36 AM, Stuart Laughlin wrote:
> 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.)

I started doing a web-application in ASP.NET years ago, back in the 1.0 
days when it was even more terrible than it still is, and I couldn't 
figure out how to design my app at all. So I ended up just implementing 
IHttpHandler and integrating with IIS/ASP.NET like that. I build a 
document composing API and business forms modelling toolkit (that I 
called xdocs) and just used that. So my experience of "ASP.NET" has 
almost nothing to do with ASP.NET proper. I.e. I just hook 
"ProcessRequest" (or whatever it is) and do everything manually from 
there. I built my own web framework. (And in the main project I used 
this framework in I was talking to an Analysis Services backend via its 
SOAP provider. Initially I was using COM interop with the COM API, but 
that had some weird MT bugs that corrupted my data and I ended up 
switching to the managed provider which was slower but more robust.)

> 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.

Well you can't explain that to me and then not tell me what's so good 
about IoC!

> 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.

That sounds like a win to me. You got the project done in time and on 
budget and all of that?

I've seen a little work in a Rails app that is trying to replace a whole 
line of business suite at my current client. Their previous programmer 
wanted to re-write the whole thing in Rails and MySQL and he made a bit 
of a start on it. I just don't know how that's feasible given all the 
SQL Server integration they do. I'm just not sure that a switch to a 
MySQL backend would be compatible enough with the way they work with 
their data. (I.e. integrating with Office and other Windows software. 
Although maybe the OLE DB (or ODBC?) driver for MySQL would be good 
enough to get the required level of connectivity.)

> 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.

What sort of a company are you working for? Sounds like a consulting 
software development company, yes?

> You should care about IoC because it forces you to think about how
> your classes interrelate.

But saying something like that is like saying nothing at all. *Of 
course* I think about how my classes interrelate, and I don't need an 
IoC framework to "force" me to do that! :P

> 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 hear you say all those things and am still left wondering what on 
earth IoC is. :P

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

Lol. Fair enough!

> 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.

Well it's probably going to be a *very* long time before I get around to 
actually using IoC. I've got the "design" of most of the software I 
intend to be working on for the next few years all nailed down (and it 
doesn't involve IoC) and now I'm just waiting to find the time to code 
it all up.

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

Well put.

More information about the list mailing list