Jason on Tue, 9 Jul 2002 14:45:22 -0400


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

Re: [PLUG] Pascal?


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 08 July 2002 23H:39, Noah Silva wrote:
> On Mon, 2002-07-08 at 14:27, Jason wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > On Thursday 04 July 2002 11H:40, Noah Silva wrote:
> > > On Thu, 2002-07-04 at 11:09, Leonard Rosenthol wrote:
> > > > At 11:12 PM -0400 7/3/02, Noah Silva wrote:
> > > > >Very little for C++ (it's just broken! use Objective C!),
> > > >
> > > > 	Don't get me started on Objective C - it's just WAY TOO WEIRD
> > > > and needs to be updated to the 1990's (let alone 2000)...
> > >
> > > As I understand it, apple is working on this now, as they are sing it
> > > for the development of OS X stuff.  C++ was designed to be a temporary
> > > solution, and imo, it shows.
> >
> > Where did you get this notion?
>
> Several publications said things to this effect, even referring to
> whitepapers for the original spec.  If you like and give me a little
> time, I can look them up.

You are free to disagree and offer any support that you like. I disagree with 
your use of the word "designed" in the phrase "designed to be a temporary 
solution".

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.

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++.

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.

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.

>
> > Also, in a previous post you mentioned that
> > "C++ is broken", why do you say that?
>
> Well... let me rephrase ;) C++ seems very poorly integrated into C,
> probably because it was added as an afterthought.  ObjectPascal wasn't
> originally thought of for pascal either (at least in the ISO spec), but
> in reality it integrates much better.
>
> > You've mentioned how you think that
> > others have misconceptions about Pascal with no supporting evidence.
> > Where is your support for these statements about C++?
>
> Fair enough.  But most of my complaints about C are opinions.  Many of
> the complaints I hear about pascal are [false and/or outdated] facts.
>
> > - From Bjarne Stroustup (the recognized founder of C++) in "The C++
> > Programming Language":
> > The C++ programming language is designed to:
> >   -  be a better C
> >   -  support data abstraction
> >   -  support object-oriented programming
> >
> > I've heard the first one many times ("a better C"). I've been using C++
> > since 1990. I've NEVER heard anyone mention anything about C++ being
> > designed as a temporary solution. I could be wrong, but I've checked the
> > books sitting on my bookshelf.
>
> ok I will try to dig this up then.  One difference between OP and C++ is
> that OP doesn't reinvent basic pascal, it is just a superset.  C++ adds
> replacement ways to do standard C functions.
>
> > I would suspect that the ObjectPascal still has Pascal as its basis for
> > the same reasons that C++ stems from C, to allow Pascal programmers to
> > add to their knowledge base without having to start over from scratch.
>
> To be sure, but also because the way to so things that aren't OOP
> related is the same.  OP really adds syntax elements to the compiler.
>
> for example, in C you would probably use "printf", yet in C++ you would
> likely use "cout".  In pascal, you would probably use "writeln" either
> way.  Then I always had warnings from or programming teacher urging us
> not to mix C and C++ in the same program.

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.

A well written C program is usually a perfectly valid C++ program. I can only 
guess that your teacher was probably trying to get accross the concepts of 
writing OOP programs versus procedural programs.

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.

<snip>

>
> Well it steals a lot from a few languages actually, especially as they
> steal a lot from each other.  There are certainly elements that came
> from C++, but a lot of the syntax is identical (or nearly so) to
> ObjectPascal.

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.

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.

An excerpt from "The Java Programming Language", published by Sun 
Microsystems:
"The Java programming language shares many features common to most programming 
languages in use today. The language should look familiar to C and C++ 
programmers because it was designed with C and C++ constructs where the 
languages are similar."

And that is just a reference from flipping open the book and skimming through 
the preface.

I think that sums it up pretty clearly. Your statement is backward. There may 
be concepts similar to or stemming from a number of other languages 
(including ObjectPascal), but the syntax is designed/patterned/etc. to be as 
close as possible to C and C++.

<snip>
>
> > AFAIK, the 1st OOP language is Simula-67, from which most of the newer
> > OOP languages "steal a LOT".
>
> and you can write OOP programs without help from the compiler.  An
> "object" (or uhm.. "instance" depending on who you are talking to) is
> really just a "struct" (in C terms) of pointers in most implementations,
> where some point to function addresses and others point to variable
> locations (slightly simplified, but...).  One of my professors spoke of
> writing OOP programs manually using this type of method before OOP
> languages were common.

You may still need to be familiar with how some of this works when you deal 
with what goes on "under the hood", for example when on a platform with a 
debugger that does not fully link back to the C++ source. Or, even when you 
want to trace what happens to the function table when an object is corrupted.

>
> > And what is my personal preference? Well, it depends on the project, who
> > I'm working with, what other tools are already being used, etc.
>
> Well likewise, I am not going to contort something that would be trivial
> in C (because of existing bindings, etc.) into pascal just because I
> like pascal better.  I am also not going to try to write gnome apps in
> smalltalk or oberon at this point, no matter how much I may like them.
>
> > I don't have a lot of interest in Pascal at the moment, so I didn't
> > follow these messages initially. Not intending a language Holy War, just
> > trying to keep the playing field something close to what I consider to be
> > level.
>
> Of course!  I don't like holy wars either.  Aside from that, insults
> don't win many converts.  I don't know about C++, but it makes sense
> that C caught on because at the time, and for what it was being used
> for, it was probably one of the best available languages at the time.

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".

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.

Again,
Cheers,
Jason Nocks
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAj0rLyQACgkQ3CryLfCgqRna+wCeMBhvLRNDyH2L4t/IRxHN5VD3
LLsAnR/kmGyEmFpSIWIFlwIJqoexm0Mi
=kUuD
-----END PGP SIGNATURE-----


______________________________________________________________________
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