Fred K Ollinger on Tue, 9 Jul 2002 15:21:53 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Pascal?


> My opinion is that C++ evolved from C just like ObjectPascal evolved from
> Pascal. I wouldn't call either of them temporary solutions. Both have
> evolved, and both seem to continue to do so.

Although, it may appear that C++ "evolved" from C b/c C++ compilers are
backwards compatable, I think that this does allow for really bad
programming practices.

Larry Wall is cool, but I strong disagree w/ his TIMTOWTDI idea when it
comes to programming b/c consistency is very important.

Usually mixing c and c++ has worked for me, but it does make for messy
code. My experience comes from using the c++ strings and char arrays
together.

c++ is so popular today b/c it mixes w/ c, but that doesn't mean that
mixing the two is a good idea. If the ideas in c++ are so good, then their
methods should be used and c methods not used. If the ideas in c++ are not
so good then there's no point in having them.

This is coming from a half-assed c++ programmer who badly wants to master
c.

> I'm sure there are have been many purists that would say (and did say) that
> any OO language that's not designed from scratch is only a temporary
> solution. However, I don't believe that any of these people were closely
> involved with the design and evolution of C++.

I don't think that's what Noah meant.

If c++ gave methods that did _different_ things than c then it could be
said to have evolved. An example is bash evolving from sh (and ksh).

However, c++ seeks to replace c's methods with it's own. It retains c
compiling capability, IMHO, in order to get c programmers to learn c++.
"Look, you can still do c, but if the fancy strikes you, use these better
methods, too."

I _like_ mixing c and c++, but that doesn't mean that it's good for me. I
like perl, and I like being sloppy, but that could make more work in the
end. I think that the structure in pascal tries to force people out of
these bad habits.

> Also, it would seem to be completely counter-productive to work on the design
> of a language that you intended for obsolescence (sp?). Not that it couldn't
> have happened that way. But, I'd be very surprised if that was actually the
> way that Bjarne Stroustrup intended.

Did he take ideas from other OO langs and bolt them onto a c compiler?
That's how it's looked to me.

I've heard so many people talk about these really cool oo langs (small
talk) that can't be used for compatability reasons.

> BTW: I believe that Eiffel was a from-scratch OO language, and I haven't seen
> any new development with that language in quite some time. I don't doubt that
> someone is working on it somewhere in the world, though.

I have read a lot of mind-numbing Eiffel advocacy, among it suggests that
the mess w/ deps in linux seems to be some brokenness in c/c++ itself. I
doubt this may be all the story b/c the book goes on to praise java for
dealing w/ lib problems, but I have had lots of puke on my screen when I
don't have all my paths set up right. I do wish there was a magic way out
of dynamic library hell. I don't think that static linking everything is
the answer, and I do think that apt-get is a step in the right direction,
but I still have messes w/ libs getting mucked up all the time. Mostly
this is my own fault, tinkering, but still.

> There's nothing stopping you from using printf in a C++ program. It's a
> function call and is perfectly valid. IMHO, the intent of C++ was exactly not
> to throw away C, but to add OO concepts. Also, the words are "support
> object-oriented programming", not REQUIRE it. When you write C++ code, you
> often can and do need to call functions with C-style syntax. This is
> perfectly valid, acceptable, and common practice in many of the most OO
> development groups. C-style functions are NOT BAD. They just might not be AS
> GOOD, or as readable in a true OO app.

But I'd rather keep using all C-style functions only and only use c++ for
improving things that weren't in c all ready. My point is I don't want to
have printf and cout b/c I think it's a mess. I guess the answer to this
is not to use C-style functions at all.

> Here's an example: If you have a "C" function that does exactly what you need,
> you don't need to create an object that simply calls that function. However,
> if creating an object, or moving the function call to an already existing
> object, simplifies much of the rest of your code, then do it. IMHO, the
> biggest gains still to be realized from OOP is code readability.

Here, here. Although, it takes a while to get used to oo. I gave myself
ulcers when I made way too many classes, at first, and I spent time trying
to pass variables from class to class. I still don't think I have that
right. I'm not saying personal incompetence makes for a bad language, but
I'm saying all things in moderation.

In many small programs, I don't see the point in oo at all, in even mediam
size ones, I'm in hell if I don't do at least a little modularization.

> I completely (but respectfully) disagree with this description. I believe that
> it is fairly common knowledge that Java is a direct descendant of C++. I
> believe that this is spelled out in pretty much every Java book I've ever
> read.

I like java for this reason. It has all the good stuff from c++, but none
of the rough edges. I'd probably use it more often if it had a free
compiler to create binaries using swing libs. I all ready learned qt so I
don't need this so much anymore.

> In addition, one of the ways that the Java certification exam tries to trip
> you up on is on some of the subtle differences between C++ and Java.

> Well, I hope you didn't take any of my message as an insult. I did, however,
> take objection to statements like "C++ is broken" and merely "intended as a
> temporary solution".

This was news to me, too. I did see the point, though.

> And, you seem to be trying to indicate that Java stems very closely from
> ObjectPascal and is simply similar to C++ in some elements. I believe that
> you have that entirely backwards.

Well if you are going to copy an older oo language, there's only so many
ways you are going to want to change around the syntax.

I think that this is like saying BB King sounds a lot like the Rolling
Stones. Hmm.

Fred


______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug