Best Pascal IDE: Delphi vs. Lazarus

Pascal IDEBack in the 1970s and 1980s, a generation of software developers learned the basics of computer programming courtesy of the Pascal programming language. The design of this influential language features a simple procedural syntax that encourages structured programming. If you’re interesting in learning the fundamentals of programming using Pascal, check out Learn to Program with Pascal. In addition to helping you master basic programming concepts, the class will introduce you to Delphi and Lazarus, two of the leading software tools for Pascal code development.

Origins of Pascal

Pascal was created by Niklaus Wirth, an award-winning Swiss computer scientist. Wirth developed Pascal while working as an assistant professor of Computer Science at Stanford University and the University of Zurich in the 1960s and 1970s; he also designed Modula, Algol, Oberon and several other languages. In recognition of his contribution to the field of computer science, in 1984 Wirth was awarded the ACM Turing Award, which is often referred to as the “Noble Prize of computing.”

A simple example of the Pascal programming language can be seen in this Hello World code snippet:

program HelloWorld;

begin
writeln(‘Hello World’);
end.

Wirth named Pascal after a French philosopher, mathematician and physicist named Blaise Pascal who is credited with inventing the mechanical calculator in 1642. Although the language was mainly intended as a teaching tool, Pascal was used in the early years of Apple for development of the Lisa and Mac computers. More recently, the Skype application was written in Pascal.

What is an IDE?

An IDE, or Integrated Development Environment, is an interactive application that provides all of the main functions needed to create, edit, compile, link and debug a software application. Before the introduction of IDEs, programmers used separate tools for each step of the programming process. IDEs allow programmers to be more efficient by providing a single consistent location for accomplishing the main tasks related to coding. They also help programmers avoid errors by providing language-specific syntax formatting in the editor. Although you can still also accomplish programming tasks using separate tools, the project management benefits of an IDE usually outweigh the effort required to learn how the IDE works.

Today’s IDEs have graphical user interfaces and bear little resemblance to Dartmouth BASIC, the first programming language that used an IDE. Developed in 1964, Dartmouth BASIC provided a command-based interface that integrated editing, compilation and debugging. Other early IDEs include Maestro I and Softbench. In the early 1980s, a software company called Borland introduced Turbo Pascal, an integrated programming toolkit for the Pascal language. Turbo Pascal wasn’t powerful enough to be used for large-scale programming projects, but it was a powerful advance over BASIC for beginning programmers. According to Byte magazine, about a quarter million copies of Turbo Pascal were sold in the first two years after its release.

Embarcadero Delphi IDE

In the mid-1990s, Borland evolved Turbo Pascal into a “rapid application development” (RAD) tool called Delphi. It was written in an object-oriented version of Pascal called Object Pascal and included a sophisticated IDE. Throughout the 1990s, Borland released increasingly more powerful versions of Delphi, adding support for dynamic arrays, method overloading, interfacing with databases and support for 32-bit operating systems.

In 2008, Borland sold the software tools division responsible for Delphi to Embarcadero Technologies. Embarcadero has continued to support Delphi, which is currently available on Microsoft Windows and produces code that runs on 32-bit and 64-bit Windows, Mac and on Apple and Android mobile devices. If you’re interested in learning how to program using Delphi, you’ll need to have access to a computer running Windows.

The latest version of Embarcadero Delphi is XE5. Its main advantage is the ability to use the same application code for a variety of platforms and devices, including PCs, laptops, smartphones and tablets. Additional capabilities including FireDAC, a library that allows applications to connect to enterprise databases such as MySQL, Oracle, DB2 and more. The Delphi XE5 IDE also supports visual development that allows you to design, prototype and implement an application using visual components. The VCL (Visual Component Library) is a visual framework that allows you instantly change the look and feel of an application by applying pre-defined visual styles to existing code.

The main disadvantage of Embarcadero Delphi for a beginning programmer is that it is a full-fledge professional development environment and carries what many consider to be a hefty price tag. On the Embarcadero website, the price ranges from $4,679 for the enterprise version to $1,871 for the professional version.

Lazarus IDE

Lazarus is a competing RAD IDE that provides much of the same functionality as Delphi. It can be download free of charge from the Lazarus website. Like Delphi, Lazarus provides a cross-platform IDE that supports multiple platforms. The platforms supports by Lazarus include Windows, Mac, Linux, Raspberry Pi, BSD and a variety of devices, including Nintendo. The Lazarus Class Library (LCL), which resembles Delphi’s VCL, supports a drag-and-drop graphical designer with more than 200 components that facilitate the creation of graphical user interfaces.

The Lazarus IDE includes a code editor that provides syntax highlighting and code completion. It is designed for development of Pascal code using Free Pascal, an open source compiler for Object Pascal. Free Pascal is compatible with Delphi Pascal and supports many of the same libraries. According to the Lazarus website, Free Pascal is robust enough to be used by both programming students and developers of commercial software products.

Lazarus is open source and therefore extensible. Anyone can modify the source code and add additional functionality. You can also install third party add-ons and custom components that implement a specific look-and-feel. Like Delphi, frameworks for several popular databases are available. As is frequently the case with open source software tools, Lazarus has a community of users who are willing to provide advice and support in a public forum. The Lazarus and Free Pascal Wiki provides technical documentation and programming examples.

If you’re trying to decide between the Delphi and Lazarus IDEs and don’t have a large budget for programming tools, Lazarus seems like the obvious winner. Another reason to select Lazarus is the ability to build applications for a wider range of platforms. On the other hand, if you can afford the steep Delphi licensing free, you may prefer that advantages that come with commercial-level support.

The Next Step

As you become more fluent in Pascal, you’ll be able to transfer many of the general programming concepts you’re learning to more modern languages. Ruby Programming for Beginners introduces an object-oriented language that can be used to create portable web applications that will run with different operating systems and web browsers. Ruby is easy to learn, especially for people who are already familiar with another programming language such as Pascal.

This is the Hello World code snippet written in Ruby:

puts ‘Hello world’

Another more modern language that has a wide variety of uses is Python. In Python for Beginners, you’ll learn how easy it is to program and debug applications using the Python programming language.

Here’s Hello World written in Python:

print “Hello World.”

Starting Your Own Programming Business

Most people who want to learn how to program are interested in programming for a living. In addition to learning about the technical aspects of software development, it helps to understand the business of programming. Break into the Programming Business is a series of video lectures presented by Huw Collingbourne, technology director at SapphireSteel Software. It explains how to manage a tech project or your own or direct a team of programmers. By the time you finish the course, you’ll know enough about the programming business to “talk to programmers on their own terms.”