[fpc-pascal] Bls: Quick Modern Object Pascal Introduction, for Programmers

Mr Bee pak.lebah at yahoo.com
Mon Jun 20 05:31:29 CEST 2016

Good work, sir. Thank you very much. I might use your article to direct people who still thinks Pascal today is still like the old Pascal of the 70's. :) 
I have a little suggestion though. I prefer to use {$J-} directive in my Pascal program. I think it encourages good programming practice in Pascal. The {$J-} means constant is a constant no matter how you declare it. To bad FPC is still using {$J+} as the default even in the {$MODE OBJFPC}, which means a constant becomes a variable once you include the data type eventhough it's declared within a 'const' block. CMIIW.

–Mr Bee

    Pada Minggu, 19 Juni 2016 13:27, Michalis Kamburelis <michalis.kambi at gmail.com> menulis:


So, I wrote a document describing (quickly!) many features of the
modern Object Pascal:)

Read on:



This document started just Thursday morning. I thought that such
document would be a helpful resource for the developers interested in
my Castle Game Engine (http://castle-engine.sourceforge.net/ ). The
document is directed at programmers who already know the concepts
(like classes, virtual methods) but they don't know how they look like
in Object Pascal. Or maybe they know Object Pascal classes, but don't
know about some "advanced" (but really useful IMHO) language features
added in the recent years. For example, many people are not aware that
Pascal has generics -- a powerful and important language feature,
IMHO. Many people are not sure what happens when an exception occurs
during the constructor -- which is quite important to know, if you
want to write correct destructors, I think.

This document quickly grew over the last 3 days:) It starts from
really basic stuff, and quite quickly jumps into "advanced" stuff. The
PDF is now 52-pages long, and calling it a "Quick Introduction"
becomes harder and harder:)

Parts of it apply only to recent FPC versions, and only to {$mode
objfpc} mode. I deliberately didn't want to burden the reader with
historic details, or differences between Delphi and FPC, or FPC
$modes. This is for readers who just use the latest FPC version, as
their primary Pascal compiler, and want to use the language with all
it's current features.

Share and redistribute as you like. The source is in AsciiDoc,
available on GitHub
https://github.com/michaliskambi/modern-pascal-introduction , and
corrections and improvements and all comments are very much welcome!
You're also welcome to reuse parts of it for FPC/Lazarus wiki or any
other document (license is the same as wikipedia). I hope you will
find this useful:)

fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160620/a62d5878/attachment.html>

More information about the fpc-pascal mailing list