Board index » delphi » Learning Pascal/Delphi

Learning Pascal/Delphi

I have decided to purchase Delphi in the near future. I have started
to read some computer science books from the library which also teach
Pascal.

While reading some of the other messages I read something that
concerned me.
kand...@remove.iti2.net (Kanda' Jalen Eirsie) wrote:

Quote
>"I've been told that Unlearning C is even harder than Unlearning pascal so that you can be profficient in Delphi..."

So I began to wonder if reading these Pascal based books was going to
teach me things in which I would have to unlearn.

I not only want to become proficient with the Delphi IDE but I would
also like to master the language behind the IDE. I had hoped to do
some reading before I bought Delphi. (One reason, to be closer to the
arrival of Delphi 3.0 so that I would have to do an upgrade so soon
after purchasing Delphi Developer.)

Any input? Is learning an earlier version of Pascal bad? One of the
books is general Pascal (published '90), the other Turbo Pascal 6.

Any good Object Pascal books for Delphi's language?

Thanks in advance for any and all suggestions.

Jimmie

 

Re:Learning Pascal/Delphi


In article <33304479.67849...@news.texoma.com>,
   jhouc...@texoma.com (Jimmie Houchin) wrote:

Quote
>Any input? Is learning an earlier version of Pascal bad? One of the
>books is general Pascal (published '90), the other Turbo Pascal 6.

Depends what you mean by "bad" :)  Pre-Turbo-Pascal or General Pascal
books have their uses, but they don't reflect how you're going to be
programming.

The TP6 book would be a bit better, and will be good AND bad...
GOOD: You will learn little Borland Pascal "tricks" that are probably
somewhat glossed over in other books (like sets, the move command,
down-in-the-guts file I/O)
BAD: You don't program Delphi programs like you program TP6 programs
(Not so bad: If the book touches on OOP at all, absorb the information
contained within it, but forget the very specific stuff)

Quote
>Any good Object Pascal books for Delphi's language?

From the fairly good look at it I got in the bookstore, "The Way of
Delphi" is a fantastic introduction to the WHYs as well as the hows
of Delphi programming, and will give you the design knowhow that's
required to make BIG Delphi programs (and low-maintenance small ones).

The orange/black/gold books (Unleashed?) usually have a really good
section on the language itself.

Quote
>Thanks in advance for any and all suggestions.

Best of luck, and if you have any weird questions about the language,
feel free to ask :)

  --=- Ritchie Annand

Re:Learning Pascal/Delphi


Quote
jhouc...@texoma.com (Jimmie Houchin) writes:

> I have decided to purchase Delphi in the near future. I have started
> to read some computer science books from the library which also teach
> Pascal.

> While reading some of the other messages I read something that
> concerned me.
> kand...@remove.iti2.net (Kanda' Jalen Eirsie) wrote:
> >"I've been told that Unlearning C is even harder than Unlearning pascal so that you can be profficient in Delphi..."

> So I began to wonder if reading these Pascal based books was going to
> teach me things in which I would have to unlearn.

This is all IMNSHO, but most definitely not!  Remember that Wirth
designed Pascal specifically as a teaching language, both in order to
make learning to program easier, but also to make the actual concepts
involved in programming easier to take on board as well.  This has
lead some people to criticise Pascal as a "toy language" which is only
useful for learning but not for actually doing anything, and while I'm
not going to come right out and say that dmr (I think it was) doesn't
know what he's talking about (even I am not that arrogant), I disagree
quite strongly.

Depending on how much time you have, I'd recommend becoming familiar
with Standard Pascal before getting too much into the Borland-extended
versions, both because there's less to learn that way and because some
of the extensions are a bit tricky (such as taking the address of
declared variables - C programmers seem to be tempted to do it all the
time, usually with disastrous consequences).

I can't see anything in Pascal that you'd have to unlearn when picking
up other languages later, but there are definitely features you'll
miss when you're forced to use C, which will probably happen at some
time.  Knowing that the concepts exist will help you to write better
in other languages that don't support them directly.

A few examples of what I'm talking about:

Variant records. (not so useful now that we're all O-O, but handy
sometimes).  Pascal allows you to declare a tag field that is
associated with the different variants, and to declare which value of
the tag implies which variant.  C doesn't.  It has unions, which give
you the variant bit, but not tags, so you have to declare the tag
variable separately, and comment what it's for or hope you'll remember.

VAR arguments.  Pascal allows you to pass variables to procedures by
reference, so that the procedure you call can modify the variable and
give the new value back.  C doesn't.  So you have to take the address
of the variable explicitly, pass a pointer to it, and use different
syntax in the called routine to access it.

Subrange types.  C doesn't have them.
Compiled-in range checking.  C doesn't have it.  Coupled with the
above, this leads to all sorts of problems when you put bugs involving
arrays in your program.

Sets. C doesn't have them, so you have to do unclear stuff with
bitwise operators to fake it.

Proper FOR loops.  In C you have to write the initialisation, test and
increment code yourself.  It's not hard to do, but it's a bind, and
there's always the possiblity that you'll miss something out.

Proper CASE statements.  In C you have to explicitly put a "break" in
at the end of each branch of a "switch" statement, otherwise it just
runs straight through and does the code you've put in for the next
branch.  As if anyone would ever want that to happen by default.

Nested procedure declarations.  C doesn't have them. O.K. so you don't
_need_ them, but you can't have too many ways of restricting the
visibility of implementation details.

There are probably many more reasons why Pascal is an excellent first
language, but I can't think of them right now.

Quote
> I not only want to become proficient with the Delphi IDE but I would
> also like to master the language behind the IDE. I had hoped to do
> some reading before I bought Delphi. (One reason, to be closer to the
> arrival of Delphi 3.0 so that I would have to do an upgrade so soon
> after purchasing Delphi Developer.)

> Any input? Is learning an earlier version of Pascal bad? One of the
> books is general Pascal (published '90), the other Turbo Pascal 6.

Nope, as I said above, it's probably good to learn an earlier version
first.  Borland certainly haven't taken anything out (quite the
reverse!).  If I had to choose, though, I'd go for the standard Pascal
over Turbo, particularly if it's only as a jumping-off point for
learning to use Delphi.

Quote
> Any good Object Pascal books for Delphi's language?

"Delphi Unleashed" seems pretty good to me, but it's more about
getting stuff done with Delphi once you've learnt it.  No doubt
someone else can recommend a text for learning OP.

Good luck!

--
-----------------------------------
Matt Francomb, Setanta Software Ltd
http://www.demon.co.uk/setanta
-----------------------------------

Re:Learning Pascal/Delphi


Quote
Matt Francomb <m...@setanta.demon.co.uk> writes:

[snippage]
Quote
> involved in programming easier to take on board as well.  This has
> lead some people to criticise Pascal as a "toy language" which is only
> useful for learning but not for actually doing anything, and while I'm
> not going to come right out and say that dmr (I think it was) doesn't

                                                                ^^^^^^^
Quote
> know what he's talking about (even I am not that arrogant), I disagree

  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

As has been pointed out to me gently, this is rather a stupid thing to
say, even in fun.  "Why Pascal is not my favou^Hrite language" does
make some useful points about standard Pascal as (was) used for
teaching in comparison with languages used in the "real world".  The
thrust of the argument is that unextended Pascal is not generally
useful for very much and that extended Pascal is not portable.  Both
of these points are true.

To some extent, I think that portability is overrated in certain
circumstances (but I wish that Borland would make a Mac version of
Delphi - it would certainly ease my pain!), but it is a fairly strong
argument for using a language other than Pascal when you have a large
body of code that needs to run on many different OSs and processors.

--
-----------------------------------
Matt Francomb, Setanta Software Ltd
http://www.demon.co.uk/setanta
-----------------------------------

Re:Learning Pascal/Delphi


Quote
Matt Francomb wrote:
> [...]
>  The
> thrust of the argument is that unextended Pascal is not generally
> useful for very much and that extended Pascal is not portable.  Both
> of these points are true.

> To some extent, I think that portability is overrated in certain
> circumstances

        Like there's the guy down the hall who wants to compare two
*.reg files to see what changes an install program made. I came up
with a nice Delphi gizmo to do just that. He said he'd rather have
C++ for portability. Evidently we're concerned about the case of
someone administering a WIN32 network who doesn't have access to a
WIN32 machine to run utilities <g>...

--
David Ullrich

?his ?s ?avid ?llrich's ?ig ?ile
(Someone undeleted it for me...)

Re:Learning Pascal/Delphi


Quote
David Ullrich <ullr...@math.okstate.edu> writes:

> Matt Francomb wrote:
> > [...]
> >  The
> > thrust of the argument is that unextended Pascal is not generally
> > useful for very much and that extended Pascal is not portable.  Both
> > of these points are true.

> > To some extent, I think that portability is overrated in certain
> > circumstances

>    Like there's the guy down the hall who wants to compare two
> *.reg files to see what changes an install program made. I came up
> with a nice Delphi gizmo to do just that. He said he'd rather have
> C++ for portability. Evidently we're concerned about the case of
> someone administering a WIN32 network who doesn't have access to a
> WIN32 machine to run utilities <g>...

tee hee.

It gets on my nerves a bit when someone wants a program written and
can't or won't do it himself, but then wants to have a say in what
language you use for it as well.

I used to get lots of stick in a previous job for using Modula-2 for
all my little throw-away utilities when everyone else wanted to use C
or C++.  The fact that that way it took me a tenth of the time (oh,
all right, half the time) to get the thing written didn't seem to
count for anything.

--
-----------------------------------
Matt Francomb, Setanta Software Ltd
http://www.demon.co.uk/setanta
-----------------------------------

Other Threads