Softpanorama

May the source be with you, but remember the KISS principle ;-)
Home Switchboard Unix Administration Red Hat TCP/IP Networks Neoliberalism Toxic Managers
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and  bastardization of classic Unix

Pascal -- One of the Best Introductory Programming Languages

News DOS History Book reviews Recommended links Tutorials Papers References and FAQs
Sources Borland Internals Tools and Libraries Structured programming as a religious cult Modula-2 Modula-3
Free Compilers Structured programming Donald Knuth Donald Knuth Interviews Random Findings Programming Language Humor Etc

Pascal, especially in old "Turbo Pascal" (TP) implementation by Borland used to be probably the best first programming language to teach in the high school and at the first courses of the university.

Recently JavaScript started to compete with it as the first language. But still TP is a nice simple language very suitable for learning programming and it contains an excellent debugger.  Modula-2 also  is an interesting language -- one of the first widespread languages that implemented coroutines but there are no great compilers from it.  Both Pascal and Modula now belong to so called  "retro-programming".  Most compilers (and some of excellent quality) are now abandonware including all famous "turbo" and "Delphi" lines of Borland compilers. Delphi proved to be more productive language then C++, especially for development of programs with graphical interface. But it is also by-and-large gone. Some major application are still written in it (Total Commander is one example)

TP is not a "pure" Pascal, it is  "a more practical Pascal" -- a derivative of Pascal and Modula. In a way "pure" Pascal as defined by Wirth was the first "one step forward -- two steps back" or "return to basics" programming language. It was created by Wirth as a reaction on overcomplexity of Algol 68 (which was modest language by contemporary standards, times change ;-).  

Wirth had found his salvation as a false prophet of  Structured programming and interpretation of the "Structured Programming Gospel" according to St. Edsger Dijkstra. Which innovatively turned it into pseudo-religious cult.  This generally false and primitive vision of control structures in programming languages became pretty widespread and was taught by clueless careerists  in all major universities ;-).  In a way this was prelude to subsequent capture of economics department by greedy careerists teaching "neoclassical economics". 

Even   Donald Knuth was not able to dispel its false message although he resisted it somewhat and wrote an influential paper that implicitly formulated the right approach -- finding the set of control structures that can express most common situation with passing control in programming, especially with exit from the loops. .  While structured programming has some positive effects by bringing attention to the control statement if programming languages like many other religions it induces its believers a distorted perception of reality and, as a consequence, an inability to deal with reality effectively. 

As Paul Abrahams aptly noted, the key problem with structured programming is that it is elevation to good heuristics into bad dogma, and the creation of the illusion that difficult problems are easy.  If structured programming is treated as a style -- a collection of good programming practices it is less objectionable,  but treated as a collection of inflexible rules it is definitely harmful.

Pascal suffered from those dogmas and it is really strange that such talented language designer as Wirth made so made blunders in the language. But he implemented simple and open source recursive decent based compiler which was free, distributed with the source,  and very fast by standards of the day. That outweighed its blunders in the design of the language. The rest is history.

Still in some areas Pascal hurts. For example it has too rigid loop statement (increment can be only one), static arrays that are even less flexible then in Fortran (that an achievement, in a very negative sense). Like any dogma it led to increase, not decrease of programming efforts concealing this fact by brave verification rhetoric's.  TP occurred after Wirth realized and tried to rectify its blunders in design of Modula and Modula 2 languages. We can view TP as essentially Modula language without coroutines.

There is something wrong with C as non-system programming language. Outside of system programming it provides too much rope to hang yourself.  And while TP may not be the best answer it does demonstrate the limitations of C for general purpose programming and first of all low productivity and the tendency to create a set of nasty and subtle bugs and security vulnerabilities (famous buffer overflows, etc). I guess that for applications like editors and file managers TP programmers are approximately twice as productive as their C counterparts.

The big advantage of Pascal was that one can use it in DOS on the cheapest PC possible and still get an excellent programming education. Moreover an excellent the TP 5.5 compiler  (and may be now TP6 and TP7, please check Borland site) are now available for free from Borland/Inprise and the debugger in this compilers is really good...

Moreover they works well under Linux DOS emulation. And again I would like to stress that one could certainly accomplish a lot with Turbo Pascal on any PC with DOS emulator (really any, including a 286, if you can find one). All you need to acquire the deep knowledge of  fundamentals of programming and data structures is the cheapest PC possible and the desire to learn.

I would like to stress it again, Turbo Pascal, so to speak, is the most democratic language. And not only introductory one. Historically TP and its close cousins Modula-2 and Delphy were used for building very complex stuff  (games, graphics, BBSes, etc.). The advantage of Turbo Pascal is in providing the student with exercises which are enjoyable (graphics, sound, etc.), and this enables the teacher to make course more interesting. Later Javascript was able to fill this niche too but there is no good debugger for JavaScript and that's a serious shortcoming.

It is easy to imitate Logo style environment in Turbo Pascal. And my experience as a professional educator proves that the task of generating musical tunes is an excellent way to teach loops (may be one of the best approaches for teaching loops possible).

I feel that the students will develop their own style and abilities much quicker in Turbo Pascal than in C.  Turbo Pascal is less complex, has much better compile time diagnostic and better string handling than C.  Modula is one of the few languages that has coroutines support and thus can beat C in many tasks.  But who cares -- C is the king of the hill and nothing succeed like success ;-).  C is also more realistic language than Turbo Pascal but it's a more complex and a lower level language (structured assembler).

Good electronic books (including documentation for TP) are available  (actually they are better than introductory  books on C because Pascal is a better introductory language).

Anyone interested in becoming a decent programmer should learn both, but Turbo Pascal first!

Much like C language,  the initial version of Pascal was an attempt to simplify programming language. C was system programming language derived from PL/1 and BCPL. It was designed as a high level assembler.  Pascal is a derivative of Algol and is a reaction on creation of Algol-68 (which was a complex, PL/1-style version of Algol-60).

Although historically Pascal was a negative reaction on the complexity of Algol 68, it's mainly "The Last of the Mohicans" of the Algol 60 family of languages -- a simple language derived from Algol 60 that was initially intended as a teaching language. One of the explicit design goal was the speed of compilation so that you do not even need a linker.

If you wrote something as a negative reaction to the overcomplexity it's easy to run into another extreme. At the time of writing Wirth was influenced both by structured programming and formal verification of programs -- two fashionable at this time religious movements  :-) and in process he made some regretful mistakes that were partially corrected in Modula and Turbo Pascal.

Actually a lot of verification zealots were promiscuous enough to became later object-oriented programming fundamentalists, so you better beware ;-) But Wirth was a very talented language designer and despite some elements of structured programming fundamentalism (and verification fundamentalism) Pascal proved to be very useful language and has important descendants (Modula-2, Modula-3, Ada, Turbo Pascal, Delphi, Oberon).

In fact, both C and Pascal served as a foundation for the whole family of the languages. Pascal-derived languages are not as widely used in commercial environment as C++ (only Delphi is still more or less visible), but they still represent an important approach to programming language design. Both Windows and Linux has  Modula-2 and Modula-3   compilers freely available.

Note about Modula. Like Pascal, Modula-2 is a great language. One of the few mainstream languages that implemented coroutines. You can use Modula-2 instead of Turbo Pascal as an introductory language, but nothing in Modula space matches the quality of Turbo Pascal as an introductory language. 

Polytechnique Modula-3 (PM3) is the most up-to-date freeware implementation of the Modula-3 language, libraries, and runtime environment.

Good electronic books are available for Modula-2, less for Modula-3.

Dr. Nikolai Bezroukov


Top Visited
Switchboard
Latest
Past week
Past month

NEWS CONTENTS

Old News ;-)

[Dec 22, 2003] Turbo Pascal Programmers Page a very comprehensive page !

vpsource.com - portal for webmasters and programmers -- contain a good and more up-to-date that this site collection of Delphy programming links.

[Nov 11, 2000] Learn Pascal - Contents -- a pretty decent intro

Turbo Pascal 3.0 compiler and code generation internals

[Jun 12, 2000] Pascal Programming -- syllabus for high school.

[Sept.1, 1999] Programmers Heaven - Delphi Zone -- an excellent page

[June 28, 1999] Links to Web-based courses added

[June 17, 1999] Index to Pascal Tutorial Pages -- outline with good questions http://cal.csv.warwick.ac.uk

[June 17, 1999] TP-Links

[June 11, 1999] StudyWEB Pascal links -- a very good educational site

[June 11, 1999] WEB Pascal course (limited distribution, mirroring prohibited without CD purchase)

REXX.pas Reimplementation of REXX functions in Pascal. A very useful unit...

{Copyright (C) 1989-1992, 1995-1997. Earl F. Glynn, Overland Park, KS.
All Rights Reserved. This UNIT may be freely distributed only
for non-commercial use.

REXX-like functions. For information about REXX see the book
"The REXX Language," by M.F. Cowlishaw, Prentice-Hall, 1985,
or various IBM CMS or OS/2 manuals.

Freshmeat/AKFQuiz A collection of programs for quiz games, teaching exercises, and psychotests

The AKFQuiz package lets you easily make your own quiz games or learning exercises. These can be used either with grquiz in a graphical environment (SDL), with crtquiz on a text terminal, or with diaquiz in a GUI environment. There is also a line oriented variant, linequiz, which can be used as a backend. A CGI-variant can be installed on a Web server to offer exercises via the Web. A mkquiz tool that generates an HTML file for to use with the JavaScript akfquiz5.js is also included. Those can then be published with any Web-space provider.

Author:
Andreas K. Foerster [contact developer]

taoyue.com- Learn Pascal tutorial - History

From version 1.0 to 7.0 of Turbo Pascal, Borland continued to expand the language. One of the criticisms of the original version of Pascal was its lack of separate compilation for modules. Dr. Wirth even created a new programming language, Modula-2, to address that problem. Borland added this to Pascal with its units feature.

By version 7.0, many advanced features had been added. One of these was DPMI (DOS Protected Mode Interface), a way to run DOS programs in protected mode, gaining extra speed and breaking free of the 640K barrier for accessing memory under DOS. Turbo Vision, a text-based windowing system, allowed programmers to create great-looking interfaces in practically no time at all. Pascal even became object-oriented, as version 5.5 adopted the Apple Object Pascal extensions. When Windows 3.0 came out, Borland created Turbo Pascal for Windows, bringing the speed and ease of Pascal to the graphical user interface. It seemed that Pascal's future was secure.

Syn Text Editor

Syn is an Open Source Text and Programming Editor with Syntaxhighlight for many Languages, and some IDE Features, like starting a program (e.g. Compiler) and capture the output, support for Projects etc. Syn is written in Delphi (Version 5, Updatepack 1) for maximum performance, stability and filesize ;-), hence it doesn't require any bulky VC++/VB Runtime or MFC libraries!

Syn supports Active Scripting, this means you can extend the functionallity with writing a Script. If you have written such a Script, or an other file (Autocomplete file or whatever), and you think it could be useful for others, just send them to me or to the Users Mailinglist (syn-users[at]lists[dot]sourceforge[dot]net), and we will add them. Of course, we will give you proper credits. Many thanks to all of you!

Parallel versions

Two branches of development are actually followed:

The 2.1 branch consists in adding functionalities and fixing bugs of the running version (2.0). This version is almost maintained by Stefan Ascher. To view the list of modifications, open the changelog.

The 3.0 contains big modifications of code for better handling of customization, storing settings to files instead of registry and multilanguage support (read what's new). This branch is maintained by Danail (most ideas come from him). For now, 3.0 is our goal. Preview version is already released, but still there is a lot of work before a beta release. Help us debugging!

Geoff's hobby is programming.

Recommended Links

Google matched content

Softpanorama Recommended

Top articles

Sites

See also

Bookshelf

External Links


Tutorials

See also: Tutorials - Pascal Programming - Net Links -- very good list of tutorials and

Pascal Programming Introduction

Pascal programming. Lecture notes, interactive tests, and links to related materials. By Brian Brown, Central Institute of Technology, New Zealand.

Informit.com Sams Teach Yourself Delphi 4 in 21 Days - Programming - Delphi -- free registration required.

Table of Contents

Introduction

Day 1 -

Getting Started with Delphi

Day 2 -

More on Pascal

Day 3 -

Classes and Object-Oriented Programming

Day 4 -

The Delphi IDE Explored

Day 5 -

The Visual Component Model

Day 6 -

Working with the Form Designer

Day 7 -

VCL Components

WEEK 1 -

IN REVIEW

Day 8 -

Creating Applications in Delphi

Day 9 -

Projects, the Code Editor, and

Day 10 -

Debugging Your Applications

Day 11 -

Delphi Tools and Options

Day 12 -

Graphics and Multimedia Programming

Day 13 -

Beyond the Basics

Day 14 -

Advanced Programming

WEEK 2 -

IN REVIEW

Day 15 -

COM and ActiveX

Day 16 -

Delphi Database Architecture

Day 17 -

Building Database Forms

Day 18 -

Building Database Applications

Day 19 -

Creating and Using DLLs

Day 20 -

Creating Components

Day 21 -

Delphi and C++Builder

WEEK 3 -

IN REVIEW

APPENDIXES

Appendix A -

Answers to the Quiz Questions

Appendix B -

Delphi Internet Resources

Bonus Day -

Building Internet Applications

Study Web Programming Pascal Links

Turbo Pascal for DOS Tutorial by Glenn Grotzinger.

Turbo Pascal Tutorial at Grenville Christian College (WebNotes - Turbo Pascal Tutorial)

A short tutorial on running Turbo Pascal.

Turbo Pascal Tutorial -- another short tutorial


Papers

**** Why Pascal is Not My Favorite Programming Language -- famous paper by Brian W. Kernighan
AT&T Bell Laboratories, that was kind of prohibited at the time of its writing(April 2,1981) and the author has difficulties with its publishing because of all this structured programming verification blah-blah-blah of this time ;-)

Comparing C and Pascal is rather like comparing a Learjet to a Piper Cub - one is meant for getting something done while the other is meant for learning - so such comparisons tend to be somewhat farfetched. But the revision of Software Tools seems a more relevant comparison. The programs therein were originally written in Ratfor, a ``structured'' dialect of Fortran implemented by a preprocessor. Since Ratfor is really Fortran in disguise, it has few of the assets that Pascal brings - data types more suited to character processing, data structuring capabilities for better defining the organization of one's data, and strong typing to enforce telling the truth about the data.

It turned out to be harder than I had expected to rewrite the programs in Pascal. This paper is an attempt to distill out of the experience some lessons about Pascal's suitability for programming (as distinguished from learning about programming). It is not a comparison of Pascal with C or Ratfor.

The programs were first written in that dialect of Pascal supported by the Pascal interpreter pi provided by the University of California at Berkeley. The language is close to the nominal standard of Jensen and Wirth,(6) with good diagnostics and careful run-time checking. Since then, the programs have also been run, unchanged except for new libraries of primitives, on four other systems: an interpreter from the Free University of Amsterdam (hereinafter referred to as VU, for Vrije Universiteit), a VAX version of the Berkeley system (a true compiler), a compiler purveyed by Whitesmiths, Ltd., and UCSD Pascal on a Z80. All but the last of these Pascal systems are written in C.

Object Pascal beats C++ by Jim Phillips

Pascal Programming - Past issues of weekly features -- collection of papers

Turbo Pascal 3.0 compiler and code generation internals


References and FAQs

Pascal Language Reference Contents

TP-FAQs

Help-Site Computer Manuals - Pascal Programming - The Help-Site Pascal Programming section


Free Pascal and Modula compilers

Borland FPK FPC Medigo

Borland_community compilers

Borland Community Home Page See Museum. Free registration required.

FPK


Free Pascal / FPK Pascal
-- Free Pascal -- 32 bit Pascal compiler. It is available for different CPUs (i386+ and 680x0) and operating systems (Linux, DOS,AmigaOS,OS/2,Win32). Decent but turbo Pascal is better.

Graphics Vision for the Free Pascal Compiler (FPK)
Matthias Koeppe, Stefan Milius
Graphics Vision (GV) is a pixel-oriented graphical re-implementation of Borland's Turbo Vision (Pascal). It is available for DOS, DPMI and Windows. It is currently being ported to the free 32-bit Free Pascal compiler (Target: GO32 DOS Extender). A Linux version is being prepared. The FPK versions of GV are free software.

FPC

Turbo Pascal compatible compiler by Carl Eric Codere
FPC is a freeware Turbo Pascal 7.0 compatible compiler. Same as FPK.
The Official WinFPC Homepage
Allen Cheng
WinFPC - freeware IDE for Free Pascal

Medigo

Megido

Think Pascal Ingemar Ragnemalm

Virtual Pascal
The tool of choice for 32 bit cross-platform development in Pascal. Virtual Pascal will include support for OS/2, Windows 95, Windows NT and various 32-bit DOS extenders.

Internals

Turbo Pascal 3.0 compiler and code generation internals


Pingo's Turbo Pascal Page -- some minor stuff

Leonid Mamtchenkov's Home Page -- some minor staff


Tools and Libraries


What is now left from Borland


Best Price for TP

In USA both TP 7.0 and BP 1.5 for Windows are around $30 with educational discount. It's difficult to find TP 6.0...


Modula-2


Modula-3

Introducing Modula-3

Modula-3 Resources

Humor

Top 10 reasons why Pascal is better than C


Random Findings


Etc

Society

Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers :   Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism  : The Iron Law of Oligarchy : Libertarian Philosophy

Quotes

War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda  : SE quotes : Language Design and Programming Quotes : Random IT-related quotesSomerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose BierceBernard Shaw : Mark Twain Quotes

Bulletin:

Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 :  Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method  : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law

History:

Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds  : Larry Wall  : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOSProgramming Languages History : PL/1 : Simula 67 : C : History of GCC developmentScripting Languages : Perl history   : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history

Classic books:

The Peter Principle : Parkinson Law : 1984 : The Mythical Man-MonthHow to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite

Most popular humor pages:

Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D


Copyright © 1996-2021 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

You can use PayPal to to buy a cup of coffee for authors of this site

Disclaimer:

The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society. We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

Last modified: March 12, 2019