Rick wrote:
> At 1/23/2007 12:27 AM, you wrote:
>> One has to question WHY they know C and not C++.  Absent thousands of 
>> lines of code in C to be maintained, there is no excuse for using the 
>> language.
> 
> And why does one have to wonder why "they" know C and not C++? How about 
> "they" learned C long before C++ ever existed?
> And what about the millions of lines of C code that currently exist? One 
> cannot simply throw it all away and re-write it overnight. It's out 
> there, in volume, and it's doing the job it was meant to do.
> 
> Perhaps your over-zealous acceptance of C++ over C is because you never 
> learned C. Good for you. Some of us aren't that fortunate.
> And, perhaps you DID learn C first and then converted to C++. Also good 
> for you.
> I am not a programmer/software developer by trade. I program because I 
> enjoy it. I started years ago programming in ALGOL then BASIC, COBOL, 
> Pascal, PL/1, and other languages. Eventually I learned C and liked it 
> far better than the previous languages I had worked with. I still like 
> it. It does what I need it to.
> 
> Agreed, I SHOULD learn C++. And I would like to do that, but I simply 
> don't have the time to devote to that effort full time. So I spend time 
> here reading the messages hoping to pick up some tips and ideas about 
> the C++ language. I've gone back to some of my old C code and tried to 
> re-write it in C++. But it's a slow effort given the time I have to 
> devote to it.

I snipped a lot of this discussion.  Seems to be wandering 
off-topic'ish/flame'ish.

Rick, you could do what I did.  If you have an existing C base, many of 
C++'s _concepts_ are adaptable to C.  For instance, classes.  In C++, 
you do:

class MyClass
{
public:
   MyClass();
   ~MyClass();

   int SomeFunc();

private:
   int SomeVar;
   char *AnotherVar;
};

In C, you could translate that to:

struct MyClass
{
   int SomeVar;
   char *AnotherVar;
};

struct MyClass *CreateMyClass()
{
   // Allocate a structure and pre-fill the fields.
}

int DestroyMyClass(struct MyClass *MainPtr)
{
   // Deallocate the structure.
}

int SomeFunc(struct MyClass *MainPtr)
{
   // Perform some action and return result.
}

(I know I used C++-style comments.  Habit.  Sorry.)

You get the idea.  I just took a C++ idea and implemented it in C.  Yes, 
it results in more code and uses an unprotected struct, but back when I 
started using the above OOP-style concept, C++ compilers weren't exactly 
around.  Moving to C++ for me was a natural move once I determined that 
C++ compilers had stabilized sufficiently.

-- 
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* VerifyMyPC 2.0
Change tracking and management tool.
Reduce tech. support times from 2 hours to 5 minutes.

Free for personal use, $10 otherwise.
http://www.CubicleSoft.com/VerifyMyPC/

Reply via email to