June 13, 2003
>I don't too much care for C++.  I'm learning it right know simply because there are no books or tutorials available for D.

Trying to learn C++ while waiting for a D book is a total waste of time. If you would like to quickly learn the necessary programming concepts and then later want to have an easy switch to D, I'd suggest you learn Pascal.

And with this I don't mean Delphi, because it lures you into looking
at a lot of widgets and windowing stuff, instead of learning to program.
What I suggest is you download Free Pascal and go to the nearest
library and find a first year textbook on programming in pascal.
There are piles of excellent books about learning to program --
if you want to do the learning with Pascal. After all, Pascal was
originally developed for this!

What you'll get from it all is you will learn to program. And that is not the same as "knowing C or D or Perl" or Pascal either.

Who am I to tell you what to learn? Well, I've spent 5 years teaching programming at a university. And I've taught others all my life.

Now, there's even a serious perk hidden here: while D code looks quite like C++, and quite unlike Pascal, in reality D and Pascal are very much alike -- much more alike than D and C++. Especially in the issues that are covered in the first year.

(I know it's less cool to study Pascal than C++, but hey, which is more important, being cool or learning?)


June 13, 2003
Georg Wrede wrote:
>>I don't too much care for C++.  I'm learning it right know simply because
>>there are no books or tutorials available for D.

That means you have to learn C, but not that you have to learn C++. I would recommend starting off with Delphi, Java or C#.

> Trying to learn C++ while waiting for a D book is a total waste of time.
> If you would like to quickly learn the necessary programming concepts
> and then later want to have an easy switch to D, I'd suggest you learn
> Pascal.

I'm not sure i could second this. Well, the first serious programming language i learned was Delphi. I'm really thankful that i did. It allows one to get insight into clean, correct OO programming concepts without taking too much care about silly syntax-caused bugs: these can be a very annoying nuisance when learning C and its descendants, while with Pascal they get filtered out. I'm strictly opposed to the idea of learning C++ as the first object-oriented language, and i believe that Pascal is much better suited than e.g. Java.

> And with this I don't mean Delphi, because it lures you into looking
> at a lot of widgets and windowing stuff, instead of learning to program.
> What I suggest is you download Free Pascal and go to the nearest library and find a first year textbook on programming in pascal.
> There are piles of excellent books about learning to program --
> if you want to do the learning with Pascal. After all, Pascal was
> originally developed for this!

Well, stop dreaming, Georg! these describe the old Turbo Pascal or something which is far away from Delphi and object-oriented programming. I really don't know any book which can be recommended, besides one russian Delphi book i learned by, which gives some (more than the others, but IMO too little) attention to important aspects. Can you make any more specific recommendation? Maybe there is some good book (lecture notes etc.) on the internet? I'm sorry, i have too little time to search the net, but if anyone drops a couple of links, i'm sure me and other people would be happy to review them.

As an alternative compiler, i would recommend GNU Pascal. It's not much difference, but it seems to be more contemporary and is not limited to x86 platforms. They both support Object Pascal pogramming model with some deviations. I remember trying to compile valid Delphi code with FreePascal, and it did, but the application would get a segfault. I believe the difference is, in Delphi i used implicit default values for the fields, while in FreePascal there is no such thing and all you get is garbage.

> What you'll get from it all is you will learn to program. And that is not the same as "knowing C or D or Perl" or Pascal either.

Very true.

> Who am I to tell you what to learn? Well, I've spent 5 years teaching programming at a university. And I've taught others all
> my life.

This is interesting. Do you have your lecture notes published? :)

> Now, there's even a serious perk hidden here: while D code looks
> quite like C++, and quite unlike Pascal, in reality D and Pascal are very much alike -- much more alike than D and C++.
> Especially in the issues that are covered in the first year.

True. Dunno about the first year though, since we learn OCaml and functional programming in our first year. :)

> (I know it's less cool to study Pascal than C++, but hey, which is more important, being cool or learning?)

There is only one reason for which i started learning C. Since there are so many people who know it, i expected to get some help with programming things which other people might also want. I didn't get much help. And i got bitten by the stupid bugs so often, that i decied C was unusable. That made me learn C++, which would help me to structure my code a bit better. I was very lucky to stumble over a very good book right from the start - Thinking in C++ from Bruce Eckel. It concentrates a lot on developing safe programming practices in C++, the importance of which cannot be overestimated. It also gives some insight into efficiency, but the best source for that would be "Efficient Algorithms and Data Structures" or something alike available from any university bookstore.

Another notable learning language i would like to mention is Sather. I would also like to know your opinion on it. The official tutorial is short, but explains all of the language and the OO concepts in about 100 pages. Some programming skills are prerequisite, C/ Pascal/ Basic should suffice to be able to learn it by this tutorial.

-i.

June 16, 2003
Ilya Minkov wrote:
> Georg Wrede wrote:

>> And with this I don't mean Delphi, because it lures you into looking
>> at a lot of widgets and windowing stuff, instead of learning to program.
>> What I suggest is you download Free Pascal and go to the nearest
>> library and find a first year textbook on programming in pascal.
>> There are piles of excellent books about learning to program --
>> if you want to do the learning with Pascal. After all, Pascal was
>> originally developed for this!
> 
> Well, stop dreaming, Georg! these describe the old Turbo Pascal or something which is far away from Delphi and object-oriented programming.

You must be referring to seriously old Turbo Pascal. I have here a number of different versions of them, and here's a quote from the Turbo Pascal 5.5 manual, published 1989 (my translation from Finnish to English):

"  The object oriented part of Turbo Pascal 5.5 is based on
"  ideas generated from "Object Pascal Report" by Larry Tesler
"  (Apple, 1985) and "The C++ Programming Language" by Bjarne
"  Stroustrup (Addison Wesley, 1986).

A quick run-through shows that this version had about everything C++ had about OO, except multiple inheritance. (At the time I remember thinking that this was left out because it was too hard to implement, but now I'm starting to think that they knew it was an unimportant feature for real-world programming.)

The debugger had object inspectors and it showed the hierarchy.

Between 1989 and about 1995 there were a number of good textbooks on learning to program. Most used Turbo Pascal because it was a clean, well thought out language which included OO, and it was readily available. When Sun stormed the world with Java it suddenly became uncool to use "ancient languages". The last year I touhgt Intro to Programming, I had to spend half the first few lectures justifying to students why we used Pascal instead of Java.

I am not going to give names of books here because if those particular books aren't available at the local university library, then anyone interested is going to skip Pascal "because there were no good books". Also, I haven't read _all_ good books about the subject either.

How do I define a Good Book? Well, what you get from the book has to have value for many years to come. A textbook on programming has to be written so that you can clearly see what is programming and what is just implementing it in the language at hand.

I still think one should use something like Free Pascal (or maybe Gnu Pascal), instead of Delphi. There is nothing in the Delphi version of Pascal that's missing in FP or GP -- at least nothing that is relevant to our current discussion.

The difference between them seems to be that Free Pascal is more in the spirit Borland kept with Pascal. Also, as a product it feels somewhat easier and more polished to handle. (Your mileage may vary on this.)

www.freepascal.org says FP is available on DOS, Win32, OS/2, SunOS, Classic Amiga, Linux, FreeBSD, QNX, BeOS, and soon PowerPC.

Further, "The language syntax is semantically compatible with TP 7.0 as well as most versions of Delphi (classes, rtti, exceptions, ansistrings). Furthermore Free Pascal supports function overloading, operator overloading and other such features."


The experience of having written your entire program
yourself vs. just filling in lines and snippets in a machine-
written framework seems to have made a big difference, at least
with my students.

Particularly, one year we had half the students use BP7 as a command line compiler, and the other half used the windowed interface. Interestingly, the command-line crowd fared much better, both initially and after a few years.

>> What you'll get from it all is you will learn to program. And that is not the same as "knowing C or D or Perl" or Pascal either.
> 
> Very true.
..
> There is only one reason for which i started learning C. Since there are so many people who know it, i expected to get some help with programming things which other people might also want. I didn't get much help. And i got bitten by the stupid bugs so often, that i decied C was unusable.

Exactly!
I've had the same experience.


June 17, 2003
In article <bcl4ia$2d06$1@digitaldaemon.com>, Georg Wrede says...
>> Georg Wrede wrote:

>You must be referring to seriously old Turbo Pascal. I have here a number of different versions of them, and here's a quote from the Turbo Pascal 5.5 manual, published 1989 (my translation from Finnish to English):

Knowing Finnish is by itself an Art. :>

>"  The object oriented part of Turbo Pascal 5.5 is based on
>"  ideas generated from "Object Pascal Report" by Larry Tesler
>"  (Apple, 1985) and "The C++ Programming Language" by Bjarne
>"  Stroustrup (Addison Wesley, 1986).
>
>A quick run-through shows that this version had about everything C++ had about OO...

Obviously, yes. But the object model in Turbo Pascal 7 is not the same as in Delphi. And that of Delphi is much cleaner.

The one in  Turbo Pascal was blatantly copied from C++, namely that an "object" is simply a kind of a struct. What it leads to, is a need to explicitly declare *pointer* to this struct, then explicitly dereference it. But it works even worse than in C++. The result is simply ugly. And this would lead to unappropriate design klugdes or the urge to avoid the stuff altogether. For example, this snippet, taken from the FreePascal reference:

--- 8< ---

Type
TParent = Object
..
procedure Doit;virtual;
..
end;
PParent = ^TParent;
TChild = Object(TParent)
..
procedure Doit;virtual;
..
end;
PChild = ^TChild;

Var ParentA,ParentB : PParent;
Child           : PChild;
ParentA := New(PParent,Init);
ParentB := New(PChild,Init);
Child := New(PChild,Init);
ParentA^.Doit;
ParentB^.Doit;
Child^.Doit;

--- >8 ---

The Delphi model brings following enhancements in:
- new keyword Class: pointer and dereferincing is implicit; it requieres some
explaination and trial for the students to understand this, but the ease-of-use
is much greater and leaves less space for bugs.
- operator new is implicit, but construction and destruction are still explicit;
- Getters, setters - properties which are described by methods and not
necessarily connected to classes' storage. Usually very useful to specify
processing when a fierld is assigned, or to implement lazy evaluation. Results
in definately cleaner client code;
- array properties with getters and setters.

Some of these changes - but i believe too few of them - were blatantly stolen by Java and probably made it a market's dominant language.

>I still think one should use something like Free Pascal (or maybe Gnu Pascal), instead of Delphi. There is nothing in the Delphi version of Pascal that's missing in FP or GP -- at least nothing that is relevant to our current discussion.

Almost definately true. Gnu Pascal supports a superset of features of FreePascal, which is a superset of fetures of Delphi. The Delphi classes compile, but subtle differencies might prevent them from working properly. Gnu Pascal is a bit more focused towards language feauteres from other Pascal dialects, like the standardized dynamic array type as opposed to the Delphi one.

>www.freepascal.org says FP is available on DOS, Win32, OS/2, SunOS, Classic Amiga, Linux, FreeBSD, QNX, BeOS, and soon PowerPC.

This "soon PowerPC" has been around for more than 2 years! The versions beside some mainstream x86 ones have not been updated for long either.  The development is stagnated, while Gnu Pascal is being developed actively, i guess at some university in Germany. I believe FreePascal is based on the somewhat refractored GCC source, which makes it possible but hard to port to different platforms. Gnu Pascal compiles with unmodified GCC 3.x.x source on any platform, and benefits from the recent optimiser improvements.

>Further, "The language syntax is semantically compatible with TP 7.0 as well as most versions of Delphi (classes, rtti, exceptions, ansistrings). Furthermore Free Pascal supports function overloading, operator overloading and other such features."

Gnu Pascal has all these features. RTTI and strings are probably not 100% compatible though.

>The experience of having written your entire program
>yourself vs. just filling in lines and snippets in a machine-
>written framework seems to have made a big difference, at least
>with my students.

This is right. The book i mention contained a project template which was a .dpr with a compiler pragma converting the generated program to console. You could then code in exactly the same manner as in previous Pascal versions, and the IDE would degrade to a convenient Editor with Debugger.

>Particularly, one year we had half the students use BP7 as a command line compiler, and the other half used the windowed interface. Interestingly, the command-line crowd fared much better, both initially and after a few years.

The dependancy can be very subtle. Like, they might simply have previous experience and thus both prefer commandline and study easier? Or maybe they are simply less lazy?

-i.


June 17, 2003
Hello, I am intertsting in learning to program . I happen to fall on to this
site and  I am convinced
about the "D" language. and was following  this thread. So for somebody that has
no expirience in
programing ,what is the bottom line, what would be  the most efficent way to
learn "d",
what would be the best way ? Meaning to start with which language and or books ?
for the basics.


June 17, 2003
New comer wrote:
> Hello, I am intertsting in learning to program . I happen to fall on to this
> site and  I am convinced about the "D" language. and was following  this thread. So for somebody that has
> no expirience in programing ,what is the bottom line, what would be  the most efficent way to
> learn "d",
> what would be the best way ? Meaning to start with which language and or books ?
> for the basics.
> 

There's a lot of different ways to go.  I recently advised my brother to learn Java first, and that seems to have worked out well.  Some people on this group have advocated learning Pascal first, which seems reasonable to me.

Bill

June 18, 2003
In article <3EEF66BB.9060801@viasic.com>, Bill Cox says...
>
>New comer wrote:
>> Hello, I am intertsting in learning to program . I happen to fall on to this
>> site and  I am convinced
>> about the "D" language. and was following  this thread. So for somebody that has
>> no expirience in
>> programing ,what is the bottom line, what would be  the most efficent way to
>> learn "d",
>> what would be the best way ? Meaning to start with which language and or books ?
>> for the basics.
>> 
>
>There's a lot of different ways to go.  I recently advised my brother to learn Java first, and that seems to have worked out well.  Some people on this group have advocated learning Pascal first, which seems reasonable to me.
Which is the closest in structure , syntext and logic ? What I understand , to
start with C/C++ is
out of the question. Correct ?
>
>Bill
>


June 18, 2003
>Which is the closest in structure , syntext and logic ? What I understand , to start with C/C++ is out of the question. Correct ?

If I had programs written in different languages and had to rewrite them in D, then, I think, the easiest to translate would be those in Pascal.

Add that to what has been discussed here, and the answer would be Pascal.

((NOW, PLEASE, everybody else: let's not start another
lengthy and meandering discussion about this. Such long
ruminations, while fun for us, don't serve those for
whom these issues are important right now!))


June 18, 2003

Ilya Minkov wrote:
>>>Georg Wrede wrote:

So, to sum it up, we seem to mostly agree!

Also, anyone reading this has probably by now a pretty good understanding on what they should do about learning to program while waiting for the ultimate text book in D.  ;-)


June 18, 2003
"Georg Wrede" <Georg_member@pathlink.com> wrote in message

> Also, anyone reading this has probably by now a pretty good understanding on what they should do about learning to program while waiting for the ultimate text book in D.  ;-)

I do...but it is certainly interesting to watch the conversation unfold.  On the subject of "the ultimate text book in D," I'm under the impression that Bruce Eckel does great work...especially with his "Thinking in" series.  I urge anyone interested in seeing this book come to reality in the near future to drop him a line showing interest in the product. Last I understood was that he entertains the thought of taking on the project, but that the user base wasn't large enough or at least doesn't seem to be.

Andrew