CH 01
CH 01
begin
Power and simplicity, expressiveness and readability, great for learning and for pro-
fessional development alike, these are some of the traits of today's Object Pascal, a
language with a long history, a lively present, and a brilliant future ahead.
Object Pascal is a multi-faceted language. It combines the power of object-oriented
programming, advanced support for generic programming and dynamic constructs
like attributes, but without removing support for more traditional style of proce-
dural programming. A tool for all trades, with compilers and development tools
embracing the mobile era. A language ready for the future, but with solid roots in the
past.
What is the Object Pascal language for? From writing desktop apps to client-server
applications, from massive web server modules to middleware, from office automa-
tion to apps for the latest phones and tablets, from industrial automatation systems
to Internet virtual phone networks... this is not what the language could be used for,
but what it is currently used for today, in the real world.
The core of the Object Pascal language as we use today comes from its definition in
1995, a terrific year for programming languages, given that this was the year Java
and JavaScript were also invented. While the root of the language dates back to its
Pascal ancestor, its evolution didn't stop in 1995, with core enhancements continu-
ing as of today, with the desktop and mobile compilers build by Embarcadero
Technologies and found in Appmethod, Delphi, and RAD Studio.
Learn by Doing
The idea of the book is to explain core concepts and immediately present short
demos that readers are encouraged to try to execute, experiment with, and extend to
understand the concepts and assimilate them better. The book is not a reference
manual, explaining what the language should do in theory and listing all possible
corner cases. While trying to be precise, the focus is more on teaching the language
offering a practical step-by-step guide. Examples are generally very simple, because
the goal is to have them focused on one feature at a time.
The entire source code is available in a subversion repository, rather than a down-
load file, so that you can easily update your code in case I publish any changes or
additional demos. You can use any subversion client (my personal preference on
Windows is for TortoiseSVN) and point it to the following HTTP URL to get all of
the demos of the book (alternatively you can also check out individual chapters):
http://code.marcocantu.com/svn_public/marcocantu_objectpascalhandbook
The repository source code can also be browsed online by selecting the “Browse” link
in the code repository wiki page at:
http://code.marcocantu.com/trac/marcocantu_objectpascalhandbook
To compile and test the demo code, you'll need one of the available versions of the
Object Pascal compiler, and possibly a recent one to compile them all. There are trial
versions available that you can use, generally allowing you 30-days free use of the
compiler.
Acknowledgments
As any book, this volumes owes a lot to many people, too many to list one by one.
The person who shared most of the work on the book was my editor, Peter Wood,
who kept bearing with my ever changing schedule and was able to smoothen my
technical English very significantly as usual, helping to make this book (like my pre-
vious handbooks) what it is.
Given my current work position as product manager at Embarcadero Technologies, I
owe a lot to all my coworkers and the members of the R&D team, as during my time
at the company my understanding of the product and its technology has further
increased thanks to the insight I've gained in countless conversations, meetings, and
email threads. Given how hard it is to make sure everyone is mentioned, I won't
really try, but only pick three people that for their role have had a direct input on
this book: David I of Developer Relations, John Thomas (JT) who's the head of
Development tools Product Management, and Chief RAD Studio Architect Allen
Bauer.
Other people outside Embarcadero continued being important contacts and at times
offering direct input, from the current group at Wintech Italia (Paolo and Andrea),
to the countless customers, Embarcadero sales and technical partners, Delphi com-
munity members, MVPs and even developers using other languages and tools I keep
meeting so often. If there is one person in this group I've spent a lot of time with,
prior to joining Embarcadero, this is Cary Jensen, with whom I've organized a few
rounds of Delphi Developer Days in Europe and the US.
And finally big thank you goes to my family for bearing with my travel schedule,
nights of meetings, plus some extra book writing on weekends. Thanks again Lella,
Benedetta, and Jacopo.
To avoid annoying you any further, I'll only add that I currently live in Italy, com-
mute to California, have a lovely wife and two wonderful kids, and enjoy getting back
to programming as much as I can.
I hope you enjoy reading the book, as much as I enjoyed writing it (my 19th work in
print). For any further information, use any of the following contact details:
http://www.marcocantu.com
http://blog.marcocantu.com
http://twitter.com/marcocantu
https://www.google.com/+MarcoCantu
http://www.facebook.com/marcocantu