Jeff Duntemann's Contrapositive Diary Rotating Header Image

New Revision of FreePascal from Square One Is Now Up

I just uploaded a new, corrected and expanded PDF ebook edition of FreePascal from Square One to my website. It’s free, and (remarkably) it’s closing in on completion. It’s laid out for the A4 paper size, largely because there’s so much Pascal activity outside the US. You can read it on a screen, or else print it to paper to put in a binder. It’s currently at 294 pages, and when complete I hope to keep it under 325 pages, since that’s a whole lot of paper to print, punch, and bind.

Still to be covered are the standard string functions, locality and scope, and simple file/printer I/O. That’s not a lot of material, and some of it has already been rewritten and edited.

For those who haven’t heard of it before, let me describe the project: I’ve taken my 1993 book Borland Pascal 7 from Square One and heavily rewritten parts of it for FreePascal. Borland Pascal 7 from Square One was the fourth and last edition of my very first technical book, Complete Turbo Pascal, published in May, 1985. That title, by the way, was forced on me by the (now extinct) publisher. Its original manuscript title was Turbo Pascal from Square One. The four editions taken together were in print for almost ten years and sold about 125,000 copies back in the 80s and early 90s.

The book’s mission is to be what Assembly Language Step By Step is to assembly language: An absolute beginner’s tutorial on programming in Pascal. This includes people who have not yet learned what programming is and have never written a line of code in their lives. I start by explaining the ideas of programming, and move from there to Pascal. FreePascal is my compiler of choice, largely because it’s free, but even more because it comes with the Lazarus IDE, which contains a superb GUI builder very similar to the one present in Delphi. FreePascal from Square One doesn’t cover Lazarus beyond installing it and using the code editor. Specifically, it doesn’t cover the GUI builder or Windows programming generally. The example programs all run in the console window.

More than half of the original book explains things that no longer apply: DOS programming, overlays, the Borland Graphics Interface, tinkering the interrupt vector table, and so on. All of that is gone. I’ve made a decision to stop just before OOP, and will begin a Lazarus book with a thorough explanation of OOP and software components. I’m also leaving out pointers, since the topic is heavily intertwingled (to use a wonderful Ted Nelsonism) with OOP.

I intend to keep writing books of new material about Lazarus as time allows, and will sell them as PDF ebooks and spiral-bound POD paperbacks. No timetable; I’m trying to write SFF novels mostly, and will work on Lazarus projects as time allows. We’ve spent the last couple of years working on our Scottsdale house, but that’s largely finished, and I expect a lot more free time in the next few years. So stay tuned. I may do one more “unfinished” upload, but after that I expect to put the wraps on it.


  1. TRX says:

    Yay! I’m sure I’ll learn something from it.

  2. Katarina says:

    Math not correct on the all laundry detergent. If it’s bogo then your price for 2 is 5.79. Then you use 2 $1 off coupons. That brings your oop to 3.78. Not 1.80.

  3. Jeff- So glad you are doing this! I’m a fan from back in the early days.

    Are you open to receive copy-edit style comments?

    1. Sure. I work fast and I make mistakes. Always glad to be corrected. So fire away!

      1. Christian R. Conrad says:

        “Grammar Nazi” kind of stuff?

        Sorry, inveterate picker of nits here… But, hey, doesn’t that just mean I should be able to get a job as a copy editor? πŸ˜‰

        (And yes, I’m serious: Even though English is my third language, I think I can find sources going back to the ’90s of British and American on-line friends acknowledging this.)

        Loved your column back in _Visual Developer_ (IIRC?), used to buy it on dead trees.

  4. Allan Heim says:

    Jeff, what’s your take on Oberon–the language, not Project Oberon the OS and GUI? The fact that the spec for Oberon-07 is all of seventeen pages is compelling.

    1. I’m a big fan of Wirth, but with Oberon I think he may have violated Einstein’s heuristic: He made things a little too simple. Maybe I’ve just gotten used to Pascal getting more and more complex down the years (keep in mind that I discovered it in 1980) so something as sparse as Oberon seems overly confining. Simplicity in programming style is actually a choice: You don’t have to use the more gonzo features of any language if you don’t want to. Still, it’s nice that they’re in the kit somewhere, and you can reach for them if you need them to get out of a tight spot.

      I believe that Oberon requires that reserved words be in uppercase, which is an excellent idea that spits in the face of this ridiculous minicomputer-era BS insisting that uppercase letters indicate “shouting.” They do not. They have not indicated shouting since the dawn of the GUI era (if even then) and that was a very long time ago. Reserved words are the framing members of program structure, and are fundamentally different from all other categories of identifiers. They need to stand out very clearly against other identifiers so you can look at a page of code and discern its overall structure at a glance. I boggle that people still get eyes-rolled-back-in-the-head angry at the suggestion that uppercase has its uses in good programming.

      I haven’t looked closely at the Oberon OS or IDE. There just aren’t enough hours in a day.

      1. Graham Telfer says:

        I’m coming back to programming as a hobby now I’m retired. It was interesting to read that you started out with Forth. I did too. I had a 1k Sinclair ZX81 later upgraded with a 16k RAM pack. Forth is a language in dire need of a good tutorial aimed at more than firmware hackers.
        I have no love for object oriented programming so thought I’d look at Pascal. So far I’m enjoying your book. It would be a good idea though to have a companion volume on Structured and Procedural Design. The leap from simple examples to moderate sized projects is too great without some guidance. There is plenty that seems to be targeted at professionals using object oriented programming but nothing for the hobbyist and individual who prefers a procedural approach.

        1. The problem here is that I intended FPFSO to be an intro to the fundamentals of the Pascal language. I stopped short of objects in part because I was already over 300 pages on it, and I still hope to sell a (cheap) printed edition, but the more pages, the less cheap. However, the real issue is that objects alter the whole approach to program design in Pascal, especially under modern GUIs like Windows. My hope is to write a brand-new book that gets people started on designing object-oriented, event-driven programs using FreePascal and the Lazarus GUI builder and its components. That’s a tall order, especially since I’m also writing SF and fantasy novels. But I’ll do my best. It would help to have the volcanic energy I had when I was 50. Alas, I’m 67. Response to FPFSO has been good, and that gives me some motivation. Like I said, I’ll do my best.

  5. Bee says:

    Thank you for the book, Mr. Duntemann.

    Could you provide the book in .epub format as well? I personally prefer epub because it’s more flexible than pdf. For example, I could make the font larger, change the background color, adaptable to various screen sizes, etc so it’s more comfortable to my eyes.

    1. The problem with epub is that it’s reflowable, and although I’ve tried to create technical material in reflowable formats, changing the screen size completely scrambles the arrangement of elements like code, tables, and technical figures. It’s an unsolved problem, and there may not, in fact, be a solution. I do understand the value of changing font size, etc., especially for people with vision difficulties. I just don’t know how to pull it off and not make the whole thing unintelligible. Good luck and thanks for writing!

  6. Saidus says:

    Many thanks for the book Mr Duntemann.
    Waiting for NExt.

  7. Abby Jones says:

    I studied Pascal in high school on the trusty IBM PS/1 back in 1990. I never understood it, and get back to programming until 2010 or so. Out of nostalgia and fun I look forward to getting back into it. Thank you for this book.

  8. Gary Chike says:

    One of the best books on Pascal and general programming in recent memory. Looking forward to the planned additions in the near future. πŸ™‚

  9. Mircha says:

    This is one of the best technical books I have read recently. I hope the OOP/GUI volume will be published soon. I am counting down the minutes to read it.
    Thank you Mr Duntemann.

Leave a Reply

Your email address will not be published. Required fields are marked *