Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: Generic Programming - What Is the Best Method? (Was: Intelligent
On 3 apr, 02:39, "Gerry Ford" <ge...@nowhere.ford> wrote:
> "Arjen Markus" <arjen.mar...@wldelft.nl> wrote in message
>
> news:d9078f0f-d62f-4d3b-8cea-caf6168f563d@e23g2000prf.googlegroups.com...
>
>
> 
> 
> 
> 
> 
> 
> 
> 
>
> Stepanov thought it was important that one of the above was & and the othe
r
> was const &.  The distinction is lost on me.
>
> My problem with c++ is that when you take out Microsoft and C, I'm not lef
t
> with much.  The template syntax is, e.g., beyond me.
>
> I like Stepanov's emphasis on algorithms.

I was in a somewhat frivolous mood when I wrote my answer, but indeed
Fortran
has had generic features at least since FORTRAN 77.

There are two important aspects to generic programming:
1. Notational: C++'s templates are one form, smart macros are another
2. Conceptual: creating a sort of meta-algorithm to solve a whole
class
of problems, not just a particular one (albeit one with lots of
parameters)

I like the description of the conceptual aspect, I think it captures
the
essence of what you want to achieve.

The notational aspect is just as important, but the two templates you
gave are
very idiosyncratic to C++: it has to do with passing values/objects by
reference
or by value (note: in C you _always_ pass by value, but sometimes you
pass
the address by value, resulting more or less effectively in a pass by
reference,
but it is up to you to use the asterisk in the right places).

As for generic design of algorithms: in my opinion, reverse
communication,
though it may not seem modern or even have a awkward reputation, is a
very
flexible solution on the client side to this:
You only have to fill in a few blanks in whatever way you find
necessary
and there you go.

A solution with callbacks is much more restrictive. The interface for
each callback is fixed. And it does not do much more to hide the
details,
you still need to fill the blanks.

But with the right design, either can do the job.

Regards,

Arjen

Report this thread to moderator Post Follow-up to this message
Old Post
Arjen Markus
04-03-08 11:27 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Fortran archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 02:08 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.