[Wylug-discuss] Speakers for meetings in 2004!

Roger Leigh roger at whinlatter.uklinux.net
Thu Nov 27 20:25:09 GMT 2003


"Paul Grenyer" <paul at paulgrenyer.co.uk> writes:

> Hi
>
>> > I could give a talk on Software Engineering, specifically in C++ if
> anyone
>> > is interested???
>>
>> I would be /very/ interested in this (and I would travel from
>> Blackburn to attend).
>
> Great! I was thinking some more about this last night. I could do a
> couple of talks, one on getting going with g++ on Linux and then move
> on to cover how a lot of programmers (especially those with a C
> background) mis-use C++.

That would be good--I'm also from a C background, though I'm getting
into the new way of thinking quite well.  What I've found hardest
isn't the new language features, but breaking out of the mindset you
used when designing software in C.  You tend to want to do things the
hard way!  I'm working my way through the Josuttis "C++ Standard
Library" book (currently on Algorithms!), and I'm finding it quite
enjoyable--so much stuff that is tedious in C is so trivial with the
STL).

> You don't need formal training, but I would urge you to join the ACCU
> (www.accu.org). The website doesn't do it justice but the mailing lists
> and the journals make it the best £25 a year you'll ever spend (as a
> programmer).

I'll take a look, thanks.

>> I'm currently doing a lot of C++ work, but lacking any "formal"
>> software engineering experience, I'm sure this would be most useful.
>> (I'm currently just about to get into Design Patterns, which I've been
>> unconsciously using for a while, but it's time for me to start
> applying
>> them properly.)
>
> On your way to Design Patterns, did you cover or side-step templates?

I've started to use templates, though only in strict moderation so
far!  Perhaps you could answer a (probably stupid!) question about
them:

When the compiler emits a template instance for a translation unit,
AFAICK it /should/ have vague linkage, but I'm only getting weak
linkage (except for typeinfo and vtables), bloating the code
considerably because the linker won't remove duplicate weak symbols.
Do I need to forward delare them, use special compiler options or
anything?  What is the best way to use them (currently I'm just
putting them in headers, with inline methods)?

Currently, I'm using them like this (this is one layer of my
database<->object serialisation thingy:

table.h:
  template<typename _Row, typename _Convert>
  class Table : public Transaction
  {
  };

stock.h:
  #include "table.h"
  class StockTable : public Table<StockItem, StockItemConvert>
  {
  };

Here I'm inheriting from a template instance (StockItem is a class
representing a row in a database table, and StockItemConvert is a
function object containing methods for (de)serialisation).

[nm -C]
00000000 V typeinfo for Table<StockItem, StockItemConvert>
00000000 V vtable for Table<StaffMember, StaffMemberConvert>
00000000 W Table<StockItem, StockItemConvert>::~Table()
00000000 W Table<StockItem, StockItemConvert>::insert(StockItem&)

Oddly, I can't see a constructor for Table<StockItem,
StockItemConver> in the symbol table, but there is one for StockTable,
StockItemConver> which derives it.


WRT Design Patterns, I've been recommended to read the "Gang of Four"
book.  Is this a good book?  Are there any books I should buy in
preference (or addition) to it?  I only recently learned about the
existence of DPs, but from the little I've read so far, they seem to
be fairly straightforward "common sense" ideas, some of which I've
been using already, although I didn't know them by their formal names.


Regards,
Roger

--
Roger Leigh

                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.




More information about the Wylug-discuss mailing list