Welcome, Guest. Please login or register.

Author Topic: View the Outbox  (Read 4286 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show all replies
Re: View the Outbox
« on: January 28, 2007, 12:03:02 AM »
Quote

c64_d0c wrote:
then its about time a f**king update is done to the forum, its 2007 now not 1999...... :evil:


You've obviously never tried to update a XOOPs site that has a lot of content already ;-)
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show all replies
Re: View the Outbox
« Reply #1 on: January 28, 2007, 12:13:32 PM »
Quote

c64_d0c wrote:
its not like he is the only one with the problem you know :-x


Evidently. Yet he doesn't feel the need to behave like a spoiled toddler about it :-P
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show all replies
Re: View the Outbox
« Reply #2 on: January 29, 2007, 12:44:54 AM »
@Jose

I guess it's not everybody's cup of tea. He wouldn't be alone in hating it.

*mental image of gamecube pops up for no apparent reason*
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show all replies
Re: View the Outbox
« Reply #3 on: January 29, 2007, 12:57:08 PM »
Quote

Piru wrote:
Quote
Actually I've for the 1st time tryed to code some stuff (that general coder thing, unfinished...) that made me see some actual limitations of C. The main loop for array handling for each data type had blocks of code that followed the same control statements. If I was to code it for each type separately it would have a bunch of repeated code.

Ever heard of macros? ;-)


Or just use C++ where this could be quite readily handled with a template ;-)

int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show all replies
Re: View the Outbox
« Reply #4 on: January 29, 2007, 09:14:03 PM »
@Jose

That depends. The C preprocessor knows absolutely nothing about C as a language and will happily create the most illegal code possible if you aren't careful.

Templates in C++, on the other hand, are part of the language specification and have strict rules.

As for a class versus a template class, it really depends on your particular needs.

If you need run time polymorphic behaviuour and speed is not absolutely critical, abstract classes are the way to go.

Templates, on the other hand, are designed to allow you to create "generic" code. Every version of a template you make results in something like a new handwritten class based on your template parameters being created by the compiler. Consequently code can bloat a lot if you are not careful. Thankfully, its easy to specialise templates to avoid that. For example, suppose you made some container template "MyContainer", you could save a lot by making a specialisation for pointers by making the MyContaier as a specialisation for all MyContainer. In effect, what you end up with is a single class that handles void* and a bunch of templates that just wrap it with type-safe behaviour, adding no additional code to the executable.
int p; // A