Most people call modern pascal a different name: "object pascal". This is just by habit. Most of them don't mean the language is "pure object based", but unfortunately the phrase "object pascal" is very pure sounding. It's even worse than the longer phrase "object oriented pascal" since the word "oriented" is missing. Current pascal is not even object oriented pascal many times, such as the system.pas unit itself.
Maybe I'm being too picky, but I love pascal because it is a hybrid language and not a pure object language.. and I also love pascal because it is very modern with all the work being done on FPC and Delphi compilers. So I think modern pascal is a perfect name for current Pascal today.
Message me about this article
Don't objects revolve around messages?
I don't know - I don't send my oven "messages" to cook supper. Do you? Again, another controversial subject. Why do objects revolve around messages, if my oven and car objects don't necessarily revolve around messages?
Languages like smalltalk supposedly revolve around and focus on messaging. Different purists have different definitions of what "object oriented" really means. Because "object" is such a vague term and because it creates so much controversy, and because object oriented languages like small talk tend to be very high level - I think naming a language "object pascal" is asking for trouble. Modern Pascal can be very low level and very high level - it is not like Smalltalk. Modern Pascal does not revolve around messages either, so it is not like smalltalk, the father of Object Orientation.
Here is where purism and egotism gets folks into trouble:
The first version, known as Smalltalk-71, was created in a few mornings on a bet that a programming language based on the idea of message passing inspired by Simula could be implemented in "a page of code."
--Wikipedia Smalltalk History
What the heck is an object?
So how can we say Pascal is Object Pascal if we really don't know what the definition of an Object is? Object Orientation is a ficticious term that no one can really define. The word "Object" is a buzzword and we should stay away from using it when it comes to programming. Pascal is not like small talk (other than it being similar in syntax with the := assigner).
An object method in Pascal is not focused around messages. Message "dispatchers" are available in Pascal these days, they are not the basis of Pascal. So is our language an object oriented language, even if we don't use messages in the same ways a purist object languages do (smalltalk)? Borland first started hacking the Records and made them into Borland Objects, which were really just advanced records with cool capabilities like inheritance.. but no messaging reliance like small talk - so still not really pure objects.
Personally, I don't like being a purist - so I don't like calling a language something that implies purism. Calling something "Object ABC" automatically implies purism, even more so than the phrase "Object Oriented Pascal". Oriented at least implies the language is oriented.
People start debating what really is object oriented. People start debating what an object really is, and whether or not real life objects really revolve around messages. People start debating about verb vs noun based programming. Better name Pascal something that doesn't create so much controversy - just call it Modern Pascal and be happy.
Functions, parameters, procedures.. or Messages?
An object method in Pascal is more like a procedure or function, that is attached to a structure with an instance. Is this an object? Who knows. It's definitely structured.. whether one wants to beleive it is an object or not is up to them. I personally see them as really advanced and cool records that have some capabilities of what smalltalk had - but they are nothing like message based smalltalk was. Smalltalk was the father of OOP/OO/ObjectOrientation, and I'm still really not sure what OOP is since most so called OOP languages don't even use message 90 percent of the time.. even though OOP is supposed to be based around messages.
Pascal is already controversial as it is. We had standard pascal, a limited and controversial language that ended up being heavily criticized.. and now we have "Object Pascal" which according to object purists really isn't "object oriented". Java at least isn't called Object Java. Java has been criticised as not being "object oriented" but since they don't claim it to be Object Java, I guess they are safe.
Object Pascal can't be Object Pascal if you've got those who still use IntToStr functions and StringReplace functions, which goes completely against object orientation. Who cares? Let's not be purists, let's be modern pascal programmers instead of object programmers - because object programmers are purists.
The bottom line is that object orientation has a bad reputation of being vague and hard to define.. just like other purisms such as extreme programming, fascism, communism, etc.
I'm not mad, I'm just trying to make a point
Don't judge the book by its cover though.. just because Object Pascal is a silly name for a programming language, doesn't mean that the language is silly. I've been using structures, objects, functions, procedures, and all sorts of neat things in the Pascal language for years - and I have not too many complaints. I just don't like purism, and I will do anything to avoid naming a language after something that has a bad reputation of being purist. I wouldn't marry someone who claimed to be a Communist Jill or a Fascist Sarah - I'd marry someone who understood that there is really no such thing and that there are fine balances. A hybrid is a perfect example of a fine balance.
Modern Pascal is not dedicated to objects, it just is this wonderful hybrid language with all sorts of useful structures and routines and data and algorithms. The InToStr() functions and 100's of utilities in sysutils.pas and system.pas aren't object oriented according to an object oriented purist. In fact, many of the functions in sysutils.pas and system.pas aren't object oriented even to a non-purist.
"Object Oriented Programming puts the Nouns first and foremost. Why would you go to such lengths to put one part of speech on a pedestal? Why should one kind of concept take precedence over another? It's not as if OOP has suddenly made verbs less important in the way we actually think. It's a strangely skewed perspective. As my friend Jacob Gabrielson once put it, advocating Object-Oriented Programming is like advocating Pants-Oriented Clothing."
--http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html
I use a lot of procedural code, functions, structures, and object code - but not just object code when using modern Pascal. In fact, I'd suggest that Object Pascal isn't even Object Oriented according to a true Small Talker or an Object zealot. Modern Pascal is more like structured programming with the ability to use advanced structures (classes), methods, properties, and inheritance if you want to.
Not Delphi Language.. but Modern Pascal
Delphi? People know Delphi as a visual development tool for Windows operating systems and GUI stuff only. And delphi is like a trademark that is owned by a company, and you can't call pascal delphi, since delphi is that RAD Windows thing.
So for now, I'm using the phrase "Modern Pascal" to describe current Pascal.. I considered other labels like "Pascal 2000" because "modern" is a bit imprecise. "Modern" however does imply that we are not using "old standard pascal" and it does imply that we are not using "1970" pascal. Modern implies that we are constantly updating the language as years go by - i.e. it is always modern. And currently, that is the way it is. Freepascal and Delphi are constantly updated and modern, unlike standard pascal.
Of course people have different opinions. Flamewars such as "Pascal 2000 sounds like Windows 2000" will come about. One reason Pascal 2000 is good is because most of the modern advancements and most current advancements to pascal occurred around 1980-2007. Therefore since the general era where major advancements occurred is around year 2000 era, it can be a good century to name the current Pascal language after. Another thought is Pascal 3000 since we are now passed year 2000 and working our way to 3000. I'm not saying we should name the language Pascal 2000 or 3000 just because numbers with three zeros in them are aesthetically pleasing.
Does this sound rational? That previous paragraph has reasoning behind it, yes.
This Wiki was written in what? Standard Pascal?
There are so many people that think this wiki (PasWiki) was written in Standard Pascal, or that everyone using freepascal are advocates of Standard Pascal. Rubbish! Modern or current Pascal past year 1980 is anything but standard Pascal. Current Pascal has as many features as C and some of C++ but much much cleaner in syntax.
No, there is no 255 string limit in modern Pascal. No, you do not have to stuff all your source into one giant file in modern Pascal. Modern Pascal has separate compilation, and many ways to escape the type system when you want to.
To all those people who think this wiki was written in Standard Pascal, and to all those people who think freepascal programmers are a bunch of Standard Pascal Nazi's:
Don't flame Pascal until you know what modern Pascal or Pascal 2000 is. If you are going to flame Pascal, I'm going to flame the first B language that came out decades ago (which was what C was based on).
The final word
I do bring you this important message from our Expert FPCFAN though. FPCFAN has made the ultimate decision that "Object Pascal" is "better" than "modern Pascal". So, case closed! Not!
(click below to see a conversation between some other folks on IRC)
The final word has been spoken. I have to add though, that anyone who claims something is "better" without offering any explanation why it is "better" is probably the same person that fell for "Object Orientation" when it was such a hot fashion (fad). I also have to add that yes, I do like to rant, and in many cases my rants are correct and valid - just like many scientists have ranted and been correct about many points in their rants. I do also have to add, that people who engage in talking behind people's backs, and waste their life away on IRC are no better than those who rant.
(I personally rarely use IRC so wasn't there to discuss with them my rationale. Nor would I take anyone serious who calls themself a screen name with the word 'fan' in it, since all 'fanboys' are irrational and biased suckups).
PS: thanks Almindor for offering FPCBOT.. it is useful, for spying on others who are talking behind your back.
See also:
Above articles are for reference only. I am not a procedural zealot or a relational zealot.
I personally am fond of hybrid programming rather than "one true way". I feel that the phrase "object pascal" can imply "one true way" even if that was not the original intention of the person who invented the term "object pascal". I use hybrid languages myself, and I use databases which aren't "pure" relational ones. The goal of this article is to encourage modern Pascal programmers to describe current pascal as a modern hybrid language rather than a functional, procedural, object oriented, or message based language.
My Rational Conclusions and Reasons
The phrase "Modern Pascal" is not biased or centered around any single pure paradigm, and it suits current Pascal perfectly.
|