When comparing Scheme vs Pascal / Object Pascal, the Slant community recommends Scheme for most people. In the question“What is the best programming language to learn first?” Scheme is ranked 8th while Pascal / Object Pascal is ranked 15th. The most important reason people chose Scheme is:
Scheme syntax is extremely regular and easy to pick up. A *formal* specification of the syntax fits onto just a few pages; it can be introduced informally in a paragraph or two. Students are not distracted by remembering how to write if statements or loops or even operator precedence because every syntactic follows the same pattern. Ultimately, everything looks something like this: (func a b c) This includes not only user-defined functions but even control flow: (if cond then-clause else-clause) or even primitive operations like `define` and `set`: (define foo 10) (set! foo 11) This means that nothing really has special syntactic treatment in the language. There are essentially no weird edge-cases to memorize, and different concepts are given a more equal weight in the language. (Unlike Algol-like languages which tend to given undue weight to loops and assignment statements, for example.)
Ranked in these QuestionsQuestion Ranking
Pro Simple syntax
Scheme syntax is extremely regular and easy to pick up. A formal specification of the syntax fits onto just a few pages; it can be introduced informally in a paragraph or two. Students are not distracted by remembering how to write if statements or loops or even operator precedence because every syntactic follows the same pattern.
Ultimately, everything looks something like this:
(func a b c)
This includes not only user-defined functions but even control flow:
(if cond then-clause else-clause)
or even primitive operations like
(define foo 10) (set! foo 11)
This means that nothing really has special syntactic treatment in the language. There are essentially no weird edge-cases to memorize, and different concepts are given a more equal weight in the language. (Unlike Algol-like languages which tend to given undue weight to loops and assignment statements, for example.)
Pro No Magic - it's clear how everything works
Scheme has far less built into the language itself, helping students see that things like OOP are not magical: they are just patterns for organizing code. Everything in Scheme is built up from a very small set of primitives which compose in a natural and intuitive fashion.
Having a language that does not accord many things special status helps keep students open minded. This will help students later go between different languages and paradigms from procedural to object-oriented to functional.
Pro Great at teaching fundamental programming ideas
Scheme teaches the important, fundamental ideas immediately without the distraction of unnecessary syntax or language features.
Pro Great, well known textbooks
There is a set of very strong textbooks introducing CS and programming using Scheme. These books are available for free online.
The most famous example--and one of the most famous CS books full stop--is Structure and Interpretation of Computer Programs usually known as SICP. This book introduces fundamental ideas in computer science and covers an incredible amount of material quickly and clearly without requiring any prior knowledge.
However, some people find SICP a bit challenging as a first text. Happily, there are other more introductory texts as well. Simply Scheme is a book designed to be read before SICP, easing beginners into the language as well as CS and programming in general. How to Design Programs is another text used in introductory college courses.
Pro Robust metaprogramming
The quotation functionality of Lisp allow for extremely powerful, yet syntactically straightforward metaprogramming via macros. This is more powerful than the C preprocessor while being less involved than something like Template Haskell or F# quotations.
Using macros to properly decompose a problem domain teaches new developers good habits, improving composibility and reliability when tackling large programs. Scheme metaprogramming also serves as a gentle introduction to domain specific languages.
Unlike most languages, Scheme actually accords both functional programming and imperative programming roughly equal status. Many other languages like Python and Java are staunchly imperative while SML and Haskell are primarily functional; Scheme is a nice middle ground.
Additionally, since Scheme syntax is extremely flexible, it can easily be re-purposed for teaching non-deterministic and logic programming. There is no need to learn a new language like Prolog when the same ideas can easily be expressed with Scheme syntax.
This gives students a good perspective on different ways to think about and organize programs, which makes it much easier to move forward to other languages and technologies.
Pro Understanding of basics
Because of the verbosity and easy syntax, Pascal language is relatively easier to be learned and understood, even for someone who has no programming knowledge. It's said that Pascal code —if written well— is like reading pseudo code.
Pro Cross platform
Pascal / Object pascal was used in schools during the 2000's to teach kids the basics of object oriented programming.
Pro Clear syntax
Pascal's syntax is clear and concise, for example:
procedure test(); begin DoSomething(); end;
Pro Fast compilation
The compiler is fast, really fast. Compared to C/C++, the delphi compiler is designed to compile a decent sized desktop application in seconds rather than minutes.
Pro Enforces good programming practice
Numerous strong compile time checks with optional runtime checks ensure one doesn't do stupid things and even when one does (because the compiler can't prove it at compile time), the binary will check and report it at runtime.
Correct modular programming implementation with proper namespacing, no file inclusion hack.
Pro Tons of academic reading
Being known as the programming language for education, especially in the 90's, there many academic reading and tutorials available on the internet.
Pro Assembler Code and DLL/SO creation
You can put Assembler code in Intel or AT&T formats, to achieve great results of speed and accuracy. It is possible to create Dynamic Link Libraries or their equivalent in Unix-like systems so it's relatively easy to use and powerful.
Pro Rich existing libraries
Both shipped with implementations and spread all over the web. Both natively written or bindings to libraries written in other languages. Typically to build non-trivial applications there's no need to surf the web as many things are implemented already. Streaming, output templating, socket & networking, web, database, image manipulation, high performance graphics, (de)compression, (de|en)cryption, regex, unit testing, json manipulation, google API, indexing, multithreading, external process management, the list just goes on and on!
Using the Free Pascal Compiler (the main Pascal distribution) you can code in a language that can be procedural and imperative now, but it can became object-oriented simply adding a directive at the start of the source
Pro Easy GUI creation
Visual Basic may have predated Delphi but Delphi was the ground breaking visual designer which set the standards expected today by most GUI developers. Its rich component set was well designed, structured and extensible, it even has the ability to display live data from the attached database in its data controls.
Pro Well balanced for desktop development
For desktop development, Delphi is productive, the code is easy to understand, compilation speed is blazing, and it produces well performing applications that are easy to deploy. The perfect balance between C# and C++.
Pro Automatic Memory Management
The new Delphi compilers are powered by Automatic Reference Counting to ease development.
Pro Still active
From the early roots of Pascal, Delphi has been developed and is still actively supported. It is used in many desktop applications today, and even supports multi platform coding.
Pro Language depth
Object Pascal is being used to write custom kernels (Ultibo) and operating-systems for various ARM boards. So the way you work with the code scales from low-level to pure OOP high-level. Object Pascal has the same level of depth that you find in C/C++ but with added productivity.
Pro Extensive third party libraries
There are large collections of third party components, many free which enable developers to add wide ranging and complex functionality to their code with ease
Pro Fast execution
The compiler generates fast and optimized code. No stop-the-universe garbage collection.
Pro Suitably close to modern languages, without the pitfalls
It was developed as a teaching language and it shows. No syntax pitfalls and gently encourages good style.
Pro Reliable language and code base
Most code from the Turbo Pascal days in the 80s still compiles, yet the language has since been adapted and extended with modern concepts, introducing OOP and interfaces, exception handling, native Unicode support, anonymous methods, generics, ARC and more.
Con Little Job Market
There are little to none jobs searching for a Scheme programmer. The ones that exist are more related to Research in Maths or Artificial Intelligence.
Con Fragmented ecosystem
Scheme is an IEEE standard, not an implementation. Unfortunately, the standard is too minimal and practical implementations have diverged--they had to expand on the standard to get anything done, but did so in incompatible ways.
The later de facto standard R6RS tried to correct this, but lost Scheme's minimalist elegance in the process. The newer R7RS standard takes the best of both worlds with an elegant minimalist core and a practical standard library.
Con Very different semantics from mainstream programming languages
Con A language that is purely academic
If someone said "I am starting a project in Scheme" then they are either talking about their homework or they are starting a joke.
Con Niche language
Most use of this language will be found in jobs supporting legacy code. It will be hard to find things to do with this language outside of that niche.
Con No up-to-date version of language standards
In 1983, and update in 1990, the language was standardized with two standards: ISO/IEC 7185:1990 Pascal and ISO/IEC 10206:1990 Extended Pascal. However, Object Pascal extensions to the language have no official standards but in 1993, a draft proposal for object oriented Pascal standard was re; for review purposes only. There are no standards for modern features and enhancements, thus various Pascal dialects like Delphi or HP Pascal has their own enhancements and features.