Page 1 of 1

The truth about software design.....

Posted: Wed Jan 17, 2007 6:04 pm
by KiLlEr
> p.s. Thanks everyone for all the help with how C++ works. I understand
> much better now. (And, I feel your pain... :)

So, I'm reading this thread and laughing my ass off. Why? Because it was a detailed analysis by some smart people who obviously know C++ very well of hobocopy. And I wrote hobocopy, and I don't really know jack shit about C++ - I just barely remember enough from when I used to write it to keep myself out of the worst kinds of trouble.

This was my favorite comment:

> This code is demonstrating a principle of API design (for
> which surely there must be a name, but I don't know it)
> which says the type of [in] parameters should be as generic
> as possible, while the type of [out] and [ref] params should
> be as concrete as possible.

Because what that code was actually demonstrating was that Craig started out working with LPCTSTR, got annoyed by how hard it was to use the CRT string manipulation routines, switched to wstring briefly, couldn't figure it out, then found CString which looked more System.String-like, then had all sorts of horrendous allocation problems and decided "fudgie it - everything gets allocated on the stack", then spent a few hours wrestling with C++ reference semantics until he got the program to run without crashing and without leaking. And never bothered to change the parameter from LPCTSTR to CString because I was too lazy and the damn thing worked anyway.

So the whole thing sort of reminded me of a bunch of literature professors analyzing the diary of an eight-year-old. :)

Not that the advice you guys gave wasn't useful - I certainly learned something!

Posted: Wed Jan 17, 2007 9:29 pm
by Taurec
<g>

Never understood C++
Pascal was my hobby....

But I used hobocopy a while ago. to copy open pst files.

Posted: Thu Jan 18, 2007 12:21 am
by HELLFIRE
1) You're talking to a guy who took 3 years to figure out HOW to write
a simple multiplication table program in BASIC...

2) I think that quote about how C++ takes off your whole leg sums up
my attitude towards programming overall

:doh: :doh: :doh: :doh: :doh: :doh: :doh: :doh: :doh: :doh: :doh: :doh:



Regards