MySQL Lists are EOL. Please join:

List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:October 31 2008 6:05pm
Subject:Re: InsertPolicy and Transactions
View as plain text  
Rick Gutleber wrote:
> Templates are definitely still not instinctive for me... 
> especially the idea of "faking" inheritance of an abstract interface.  

You can find traits used throughout the Standard C++ Library, Boost, 
etc.  Most of the time, you ignore them, because the defaults work for 
most things.  If you study the declarations, though, you'll find them: 
custom allocators for containers, etc.

But really, all of this template jiggery-pokery just just a way to 
approximate, in a statically-typed language, the SOP in languages like 
JavaScript, Smalltalk, or Objective C.  If you haven't written something 
significant in one of those, I highly recommend it; it will change the 
way you think about programming.

I particularly recommend Douglas Crockford's _JavaScript: The Good 
Parts_.  If you think you know JavaScript already but haven't read 
Crockford, you've probably just been speaking pidgin JS.  JS is probably 
the most widely-deployed language now: most browsers, most of the 
professional Adobe apps, Flash, various server-side implementations... 
All we're missing is wide deployment of it as a command-line 
interpreter, a la Perl.

> It feels like cheating from an OO point of view, 

It's just a different kind of OO.  Alan Kay, co-creator of Smalltalk, 
famously said, "I made up the term 'object-oriented', and I can tell you 
I did not have C++ in mind."  That's not [just] a swipe at C++.  It 
reflects the fact that the two languages have an entirely different 
approach to OO.  Both have their merits, and their demerits.

> Query& insertfrom(const std::vector<RowT>& con, 

Hmmmm, misgivings I have, yes!  I don't like tying insertfrom() to 
vector.   It might be better to pass two generic iterators, a la 
Query::insert(iter, iter).  Then you could insertfrom a std::set, for 

> ...the C++0x scene (how long until it's called "C++1x"?)

My view is, even if it does come out next year, it's as good as C++1x to 
me.  I still have to build MySQL++ for CentOS 3, and will for the 
foreseeable future.  I'll be lucky to start using new C++ constructs in 
production code before the twenty-teens.

> I realized how 
> radically they are changing, well really adding to, the language.  

I'm looking forward more to the small things:

	- auto var = myVectorOfWhatever.begin()
	- closures, so I never have to write another damned functor
	- several new types of smart pointers
	- hash-based containers

Yes, we can have the latter two today with add-on libraries, but it'll 
make me far happier to have them in the language.
InsertPolicy and TransactionsRick Gutleber30 Oct
  • Re: InsertPolicy and TransactionsWarren Young31 Oct
    • Re: InsertPolicy and TransactionsRick Gutleber31 Oct
      • Re: InsertPolicy and TransactionsWarren Young31 Oct
        • Re: InsertPolicy and TransactionsRick Gutleber3 Nov