Interfaces are also a part of Object Pascal as well as Exceptions. The base class of all classes is TObject. Classes can also inherit other classes, so you can build a hierarchical tree of the data and behaviour you have modelled within your application. Properties define which getter- or setter-methods are used to read or write a field. It is also possible to define the way of how data is accessed by a feature called properties. A class can define methods, which are procedures or functions, and data, called fields in Object Pascal. You can define complex types with the help of classes. Although the language is not fully object oriented in that sense like Smalltalk or Ruby, where even the most basic data types are instances of classes, you will find all the concepts that define OOP in the Object Pascal language: encapsulation, inheritance and polymorphism. Object Pascal provides you all the tools you need for modern Object Oriented Programming (OOP). With this feature, you have the power to define, let’s say, the result of the addition operation of two or more instances of the same class. It is possible to overload operators for specific types. Functions and procedures can also be passed to variables or other functions thanks to procedural types. Pascal is very strict, so the programmer has to differ between subroutines that return values, in Pascal called functions, and subroutines that does not return something, called procedures. It is even possible to create sub-ranges of types or to rename existing ones. For this task Pascal offers you Enumerations, Sets, Arrays, Records and Classes. The language offers many predefined types, but you can also define your own types. The type-safety has one big advantage: it forces you to think about how to structure your data. The compiler will instantly raise an error when you’re trying to pass incompatible types to a variable or parameter. Pascal is a compiled, statically-typed language, which requires, that you define the types of all variables, parameters and functions in your code. Both, Free Pascal and Lazarus, are highly cross-platform and can run on and compile for different systems, among them are GNU/Linux, Windows, MacOS, BSD.īut beside this historical excursion, what are the reasons that I use Free Pascal in my personal projects? Pascal focus on types But thanks to some Free Pascal enthusiasts, the Lazarus IDE was developed as a powerful RAD environment especially for Free Pascal. It consists of the language, the compiler and a runtime-library - but does not include the RAD-tools which made Delphi famous. Delphi runs only on Windows, but can compile programs for GNU/Linux, MacOS, Windows, iOS and Android, too.įree Pascal in contrast is a free, Open Source implementation of the Object Pascal language. Today there are two major implementations: Delphi, the official Turbo Pascal successor, and Free Pascal.ĭelphi is a commercial Rapid Application Development (RAD) environment, which consists of the Object Pascal language, a powerful and fast compiler, a large runtime-library (RTL) and a designer for crossplatform Graphical User Interfaces (GUI). Over time some object-oriented additions were added to the language by Apple and later by Borland, which has evolved into what we now call Object Pascal. One of the most favourite versions, which made Pascal one of the most well-known and widespread programming languages of the 80s and the early 90s, was Borlands Turbo Pascal 2. But unlike other languages, there were different Pascal dialects and compilers since the very beginning. Pascal was standardized as an ISO standard in the early 90s. As an example, the first version of Photoshop was made with Pascal. With the appearance of the Classic Mac OS, Pascal was the language of choice propagated by Apple for serious application development. It was used as a teaching language as well as a language for business applications. Pascal was initially developed in 1969 by Dr. And although it is in fact one of the older programming languages, it has greatly evolved into a modern, full featured language over the last decades. Pascal is considered by many programmers as an old language from the past.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |