When comparing Smalltalk vs Pascal / Object Pascal, the Slant community recommends Smalltalk for most people. In the question“What is the best programming language to learn first?” Smalltalk is ranked 6th while Pascal / Object Pascal is ranked 13th. The most important reason people chose Smalltalk is:
You can modify the system as it's running. You're "swimming with the fish", instead of probing a black box by remote control.
Ranked in these QuestionsQuestion Ranking
Pro Environment of live objects
You can modify the system as it's running. You're "swimming with the fish", instead of probing a black box by remote control.
Pro Easy to learn and experiment
Pro Inspector makes objects transparent
Programmers must make detailed mental models of the system they are developing. Bugs usually happen when the mental model does not match the actual system. This is one of the greatest difficulties beginners have because most systems are so opaque. It takes a lot of effort to see what's really going on. But in Smalltalk this is much easier, thanks to the powerful tools included in the environment, like the object inspector.
Pro Internal source code and documentation
You can explore how everything works easily.
Pro Superb Integrated Development Environment (IDE)
All tools (Inspector, Browser, Debugger etc.) are written in Smalltalk and are live objects in the environment. All sources are present, so that the tools can easily be studied, changed and experimented with.
The same goes for the other components like the compiler, OS-Integration etc.
Pro Pure and easy object orientation
Smalltalk is one of few languages that are purely object oriented. This provides a solid and easy to understand base on which to learn object oriented programming, the most popular approach to programming.
Pro Elegant syntax fits on a postcard
The syntax was designed to be easy enough for children to learn. Beginners can learn the language rules very quickly and then focus on programming without fighting the syntax at the same time. Things that have to be baked into the grammar in other languages are simple message sends with block arguments in Smalltalk. Expressions have only three precedence levels to worry about.
Pro Agile "interactive" test-driven development
Smalltalk had the original (and still the best) unit test system that inspired it in many other languages (like Java's JUnit). Working with interactive live objects in Smalltalk style TDD makes it easy to teach and learn TDD.
Pro Inspired many other languages' object systems
Pro Powerful integrated debugger
You can edit code and swap it in while the program is still running after an exception has already been signaled, or restart from anywhere in the call stack. You can inspect and modify the state of any object. Some Smalltalkers write unit tests and then program exclusively in the debugger.
Pro Save and restore virtual machine image
A Smalltalk environment can save the state of a running program and later restore and resume execution. This includes the internal state of live objects, multiple thread stacks, and debugging sessions, making it easier for beginners to take the exact problem to an expert for assistance.
Pro Open source
MIT licensed implementations Pharo, Squeak, Cuis & Dolphin
and GPL licensed GnuSmalltalk.
Pro Graphical user interface
Beginners are usually stuck making command-line applications in other languages, because GUIs are too hard. Smalltalk GUIs are easy enough to start with.
Pro Incremental compilation
Smalltalk provides an extremely fast code-compile-run-debug cycle. You don't have to stop and reset the world to tweak your program, since you can compile one method at a time while the environment is still running. This is great for beginners to experiment and prototype ideas.
Pro Language uniformity
This leads to a very simple programming model (pure OO) that is still very powerful. A lot of stuff that is hard to implement in other languages is easier in Smalltalk.
Pro First-class functions with lexical closures
Also known as "blocks". These objects contain reusable snippets of code and as first-class objects they can be passed as arguments to other methods or blocks and also returned from them. "lexical closures" mean they retain access to the variables in the lexical environment they were written in, that is, in the surrounding code.
Pro Provides a functional way to interact with objects
Many languages today use object orientation, while the most of them stock on the half way in that perspective.
Smalltalk sees literally everything as an object and this includes things like the classes and primitive data types. There is are zero control structures such as selection and iteration, since all is done by sending messages to objects.
It use a lot of concepts from Lisp in order to provide a nice experience for this pure kind of object orientation.
It provides immutable data structures, closures, anonymous functions and higher order functions, while all those functions are objects. This is what makes Smalltalk so simple, elegant, and easy.
All this counts for Pharo, while other implementations as Amber are probably feature complete to it.
Pro As a first language, almost forces you to learn OO design
Hybrid languages (e.g., Java, C#, C++) make it easy to slip into procedural thinking. Smalltalk's pure OO approach makes it hard not to think in object-oriented terms. In addition, since the entire IDE and runtime components are there in the image for you to browse, you have plenty of examples of good OO design to learn from.
Pro It invented a lot of stuff
Smalltalk is the inventor of Just-in-Time compilation and the MVC concept, refactoring through their so-called refactoring browser and it was also one of the first adopters of a language virtual machine, closures, live programming, test driven development, an IDE and the development of GUI`s.
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.
Pascal / Object pascal was used in schools during the 2000's to teach kids the basics of object oriented programming.
Pro Cross platform
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.
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 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!
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 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 Automatic Memory Management
The new Delphi compilers are powered by Automatic Reference Counting to ease development.
Pro Fast execution
The compiler generates fast and optimized code. No stop-the-universe garbage collection.
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 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 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.
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 Component based (reusability, decoupled, rich design architecture)
Pro Dynamic evolution of language.
Pro Excellent Database development
Con Not common
Smalltalk missed an opportunity to become mainstream when its implementations cost $5000 per seat versus $0 open source. New open source implementations (Pharo, Squeak) have minor corporate backers but not yet an IT behemoth. Direct jobs are scarce (but indirectly Smalltalk experience is very well regarded). Online communities are relatively small.
Con Not useful for mobile development
While Smalltalk is very powerful and easy to learn, it doesn't have a well supported mobile distribution, but you'll be spoiled for working in mainstream languages like Java, Swift or Kotlin where jobs are more readily available.
Con Virtual machine in its own isolated world
Smalltalk wants to be the whole OS. While this has tremendous advantages internally, interacting with the world outside the VM is not as easy as pure Smalltalk and must be done via a Foreign Function Interface.
Con OO is becoming obsolete
Smalltalk did it best, but the whole paradigm is a poor fit for the expected future multicore processors. Isolated mutable variables with no compile checks is a recipe for race conditions in multithreaded code. Beginners would be better off learning a functional language.
Con Non-standard arithmetic ordering
Since every operation is considered a message sent sent is a specific order, all arithmetic operators have the same precedence. E.g. 2 + 3 x 4 translates to 2 + 3, and the result is multiplied by 4, giving an answer of 24 (instead of the correct answer - 14). Once you are learn this, it can easily handled using brackets, e.g. 2 + (3 x 4), but still a momentary suprise for beginners.
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.