Ask Slashdot: Is Pascal Underrated?
An anonymous reader writes In the recent Slashdot discussion on the D programming language, I was surprised to see criticisms of Pascal that were based on old information and outdated implementations. While I'm sure that, for example, Brian Kernighan's criticisms of Pascal were valid in 1981, things have moved on since then. Current Object Pascal largely addresses Kernighan's critique and also includes language features such as anonymous methods, reflection and attributes, class helpers, generics and more (see also Marco Cantu's recent Object Pascal presentation). Cross-platform development is fairly straightforward with Pascal. Delphi targets Windows, OS X, iOS and Android. Free Pascal targets many operating systems and architectures and Lazarus provides a Delphi-like IDE for Free Pascal. So what do you think? Is Pascal underrated?
begin
Pascal should die!
end
Because it's the only language I have extensive experience in.
In 2015 we choose languages on rich sets of apis. Java for example is almost universally hated for it's syntax yet is insanely popular. Why? 150,000 methods to choose from and frameworks galore.
No one cares about features as its not 1982 anymore where you write your own libraries. Today you have a task and a tight deadline and there is no time to program. Only time to grab a framework can tinker with it.
http://saveie6.com/
For most cases the language is rather minimal on the impact.
The quality of the compiler and supporting libraries give performance. The IDE usually offers the ease and speed of development.
Sure some languages make some things easer then others, or makes it easier for the compiler or interpreter efficient.
But for the most part with language preference it is just about chest thumping to try to show who is the alpha geek.
If something is so important that you feel the need to post it on the internet... It probably isn't that important.
I want every programming tool with which I interact to have some special thing that it teaches. What is unique and distinctive about Pascal, the way, say, Perl brought regular expressions to the masses?
Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
Pascal is straight forward, something missing from most modern language which hide substantial implicit variations in how the language behaves by handing behind syntax like Perl or impossibly verbose statements like VB. I worked with Delphi professionally and still think fondly of it. Is a third-generation language, so is closer to system behavior, but is also a great teaching language which is sorely lacking from modern programming.
Here's to losing my Karma Bonus again....
Or, more specifically, Object Pascal. The work that Anders Hejlsberg did on Turbo Pascal and Delphi are very underrated, and conceptualized a lot of ideas that would bear fruit in C#.
However...
When the only jobs for Pascal programmers are teaching other people how to program in Pascal, you know there's a problem.
Please read my Canon EOS tech blog at http://www.everyothershot.com
Delphi targets Windows, OS X, iOS and Android.
Does it now? When they put out the Linux version i think they depended on Wine... just for the IDE or for the compiled apps, I can't remember.
I apologize for the lack of a signature.
The language itself was fairly civilized.
The nested procedures made a sort of hiding with some of the same capabilities as classes.
They worked well for somethings, but incurred an implementation issue of needing multiple lex levels of the stack accessable at run time.
C and C++ with one lex level work just fine accessing stack variables using the stack pointer.
Pascal required an extra frame pointer for each active lex level.
I wouldn't start a new project in Pascal, but suitable compilers are available, I would not hesitate to maintain an existing project.
Why don't Slashdotters invest their scarce free time on some of these other "underrated" OO languages from the past?
A. Because there's no real momentum behind any of them in today's marketplace, same as Pascal.
IMHO the biggest advantage of pascal was that data structures were well denfined and that strings were not nul terminated.
One early problem with Pascal was fragmentation: while there were various decent, proprietary, dialects that let you actually write code that did stuff, *standard* Pascal was as much use as a chocolate teapot. Standard Pascal had lousy I/o and minimal libraries. the standard didn't even specify how to open a file, whereas C always had a decent subset of the Unix API as part of the de-facto K&R standard.
Had Pascal come a few years later when the IBM PC had crushed all before it, then something like Turbo Pascal might have been far more successful. However, back when there was more than one type of PC to worry about, C's huge standard library, and it's preprocessor for fixing minor dialect issues made it unbeatable for writing portable code.
In a survey of 100 programmers, 111111 thought that duck-typing was a good idea.
...In the recent Slashdot discussion on the D programming language, I was surprised to see criticisms of Pascal that were based on old information and outdated implementations. ...
Criticisms based on old information and outdated implementations also plague object-oriented FORTRAN 2003.
.
I already knew c/c++ in college and they tried to teach me good old turbo pascal dos, one of my most painful memories.
Given the value of having other people using the same software that you are(they encourage commercial support and/or contribute to FOSS support, they sometimes save you a ghastly bug-slog by running into it before you do, the work that they start but don't finish, or that needs maintenance, may be your next job, etc.) isn't 'being underrated' itself a defect, however unfair it feels?
Ubiquity isn't always a good thing, especially if it makes it harder for everyone to distinguish between barely adequate crap and excellent stuff; but (with the specific exception of somebody who has mastered a specific set of skills and tools and would be very pleased for it to become an esoteric specialty just in time to land a few lucrative consulting gigs before retirement), are there really situations where you say to yourself "Yeah, Language X is great and all; but it would be better if there were fewer people using it, less incentive for commercial support or non-bitrotting FOSS support, less useful advice floating around, and fewer openings for people with a knowledge of it."?
It is obviously the case that a pure monoculture is not a recipe for success(barring a yet-to-be-invented language that can in fact be all things to all people, well); but a language that is good, possibly even modestly superior; but lacks some specialty feature of elegance and power, are you ever better off on the underrated one?
One of its unattractive features to programmers who are probably more familiar with c#/java is its verbosity. Having to declare ever function twice in an interface and implementation section gets tedious and seems unnecessary given Delphi has provided RTTI for years. At least with c++ you could in theory code everything in a header file - although I've heard that is sure fire way to make a summoning grid and summon an elder one.
My university actually taught/used Pascal in the classroom in the early/mid 1980s and I graded programs written in it. Kernighan's criticisms of Pascal on BSD are spot on - I know, I tried using it for a (more) serious project. The semester project for my Operating Systems class was to simulate an interactive operating system - in Pascal.
The system used for the class was the University's IBM 4381 mainframe running MUSIC ("McGill University System for Interactive Computing") and the version of Pascal had *lots* of libraries and features.
I was a undergraduate research assistant (working on an AI project, funded by NASA, in LISP and Prolog) and had an account on the VAX-785 running 4.3BSD and wanted to use *that* (on my schedule) instead of standing in line to use the IBM. My instructor said "sure", but I'd have to port the support libraries he wrote for the assignment. Unfortunately, the version of Pascal on BSD was just the basic language - as specified in the Language Definition book by Jensen and Wirth. Porting the code from the "richer" version of Pascal on the IBM/MUSIC to the "basic" version on VAX/BSD was simply not possible.
So, I asked my instructor if I could, instead, do the semester project in C. He said "sure", but, again, I'd have to port his libraries from Pascal to C. Now... I didn't know C at the time, but porting his code to it and doing my semester project in it was a great introduction - and I passed the class. All-in-all, this experience help me out immensely with my CS career as I do a LOT of cross-platform work in many programming languages - though not Pascal :-)
It must have been something you assimilated. . . .
It doesn't matter what programming language you use. Go ahead and use Pascal if it's the best choice for the job.
To be a great programmer, you need to write code that reads like English. We have a framework inside of brains called English speech, reading, and writing. If you're a French speaker, or speak another European language, your framework isn't much different. A great French programmer or a great German programmer will program similarly to a great English programmer. Everybody's seen expressive code. You can look at the code and understand what it does almost instantly. Comments, variable names, abstraction, everything that makes a great programmer, all of these things come into play. Conversely, everybody's seen shitty code that takes several days to understand. I don't care what language it is. You're a horrible programmer if you write code like this. Nobody cares how clever you are, or how you've mastered the specific grammar of a certain language. You will eventually move on and someone else will have to modify your code. The best place for clever code is in the trash bin.
To be a great programmer, you need to be able to plan out what you're going to do in advance. Everybody's worked with hacked together shit, and has had to maintain it. Hacked together shit wastes programmers' time. Spend a few days doing absolutely no "programming" whatsoever. Instead draw some flowcharts, try out a rough prototype, brush up on some theory, write up an estimate, and have someone else review everything.
Learn to be realistic about how long your work will take. I know, genius programmer, you can get everything done in about a day. Be true to yourself and don't try to impress anybody with your speed coding abilities. Take your time, and get it done right. Spend an entire day or several days testing. There's nothing better than a launch that is bug free.
Be prepared to explain your code on a whiteboard to your own mother. If you can't explain what you're doing to your own mother, you don't understand the problem well enough, and chances are you're overlooking something. Your boss will have somewhat more expertise than your mother, but if you can justify what you're doing to her then you're probably on the right track.
Don't be that guy who jumps on every programming fad. If something been around for 20 years, it's probably worth considering. If something's been around for 3 years, perhaps the fad will die out and your company will get stuck maintaining an obsolete framework. Been there, done that.
I don't care if you went to MIT or only high school, we're all equal. You can't go away and work in your little PhD way, emerging a month later with a piece of code that everyone despises. Programming is a team effort. If you think that nobody else can write a piece of code except a PhD, then guess what? Your software is likely to fail, because nobody will be able to maintain it, especially when that PhD leaves to go be a professor at Stanford.
I've seen these mistakes repeated over and over for all 25+ years I've been a programmer.
No
Pascal gave way to Modula and Oberon and it inspired Ada.
Then you got things like Borland Object Pascal / Delphi, but once you include Object Orientation, it no longer should be called Pascal, just some proprietary language.
I often feel like everyone on Slashdot is a mix of two people
- Old 50+ year olds used to the good 'ol days when you would write your own stack from scratch whenever writing an application
- 20 year olds fresh out of (or still in) college who yell "squirrel!" at everything new and shiny
The truth is, that 75% - 90% of the business applications that make the world go 'round, and make nearly every startup today go 'round, are based on Java or some complimentary technology like Node.js with Java bindings. The reason for this is simple: The Apache foundation. There are SO MANY amazing enterprise-class Java libraries available via the Apache project that there is little to no reason to ever write your own. The mantra where I work, and it should be where EVERYONE works, is before you write any plumbing code at all, check Apache first. People who roll their own plumbing code INVARIABLY end up with subtle errors they did not think of or subtle problems that will manifest themselves in 2 or 3 year when they try to scale.. and all these problems were likely already figure out long ago.
When building a woodsheed, do you cut down the trees, mill the lumber, and forge the nails? Of course not, you take advantage of modern economies of scale so you can focus on the REAL building project, not the building blocks. The same is true for any halfway competent software developer.. The days of people writing their own libraries for DB MVC, for configuration management, for network access, for parsing libraries, for thread pools.. these days are gone, and thank god. The less you have to worry about the low-level plumbing, the more you can focus on the real business problem. And furthermore, the more people that make use of a low level plumbing libary, the better and more secure and stable it becomes, for everyone.
Pascal was my first procedural language, after spending a year with BASIC on PET computers in the classroom (1982). We used TurboPascal on CP/M, and it allowed me to start writing serious software, as act as a gateway to C and later C++.
Today? I'd probably want to start a new student with C# or Java, but the concepts working with C and Pascal are more relevant to understanding the underlying mechanics of compiling code and coding "closer to the metal".
On the other hand, early BASIC was probably an easier transition to Assembler (who codes in that any more, though?).
Spare a thought for the hardware engineers who have to suffer with languages that are derived from real languages with whatever the hardware engineers thought would be a good thing to add to make it a HDL. ADA -> VHDL, C-> Verilog, Verilog -> System Verilog, C -> System C.
I might design hardware but I have a CS degree and the horror of these carbuncles is not lost on me.
The macros in Verilog and System Verilog might just be the worst thing in any language anywhere.
The absence of a fundamental logic bit type in VHDL means you need libraries before you can do anything.
OVM is beyond the wit of man to comprehend from any modern language theory.
I should use this sig to advertise my book ISBN-13 : 978-1501515132.
I make $200K+/yr doing freelance work, all in Delphi and Oxygene. New projects and old, Windows and iOS.
Why? I get to choose my own tools. Since it's faster to market, it's therefore more profitable for me. I find the syntax is less error prone than most of the realistic alternatives.
Most estimates I see still put Pascal users over 1 million, but it seems like a stealthy unknown, like Python used to be.
I can understand why Pascal does not have the market share of C#/C++/Java, and why programmers are forced to use them. But not why programmers would prefer them.
...from C.A.R. Hoare:
The more I ponder the principles of language design, and the techniques that put them into practice, the more is my amazement at and admiration of ALGOL 60. Here is a language so far ahead of its time that it was not only an improvement on its predecessors but also on nearly all its successors.
-- C. A. R. Hoare, "Hints on Programming Language Design", 1974
Bearing in mind that Pascal was, arguably, the only Algol successor to actually improve the language by tightening up its notion of "types" and removing a number of ambiguities, it, too, would arguably be an improvement on most of its successors - but its successors include Object Pascal, Modula2 and 3, Oberon, and Component Pascal, each of them clearly refining, simplifying, and uniting concepts into languages hardly larger or more complex than Pascal itself. The same just cannot be said of C. C++ is PL/I on steroids, designed primarily to keep compiler writers in lifelong employ supporting features that most programmers have never even heard of, let alone used. And Java and D-flat continue the slide by being syntactically-compatible with C but with entirely different semantics.
fpc is Object Pascal, and not a proprietary language. Unfortunately, its also poorly documented.
I think we've pushed this "anyone can grow up to be president" thing too far.
FWIW, there's nothing intrinsically wrong with Pascal...or less than with C or C++. Java is worse, hobbled by 16-bit unicode, a horrible decision, which was justifiable at the time the decision was made. (Unicode should be either utf-8 or utf-32 [UCS-4]. I generally prefer utf-8, but that requires more complex library support.)
OTOH, the only real advantage of Pascal is fast compile times, and optimal execution times (which can easily be matched in C).
So, yes, its underrated, but there's probably no good reason to change to it.
I think we've pushed this "anyone can grow up to be president" thing too far.
You can take the PARSE VAR statement from my cold dead hands ;-)
Pascal may lose as a language for in the field, but for reasons that make it useful in teaching programming. It has all the pieces you'd want in a language and you can both learn the concepts and make something with them, but in a way that is probably a pain. This leave the student open to the concept that languages have different strengths and to chose languages based on the relevance to the type of problem you are trying to solve.
If you start with a language where it is easy to get a lot of the early work done, you tend to get stuck in a rut with it and want to use it for every problem.
So before Pascal, you were at imminent risk of death?
Did majoring in math allow you to research a way to solve a complex mathematical equation that resulted in a doctor unlocking a new process to create a new drug that cured you of the once-terminal ailment you had?
If not, perhaps you don't realize what "Literally" actually means.
> For instance, "++i" is a more immediately recognizable idiom than "i := i + 1".
It's been "i++" in Pascal for many years.
I worked on an industrial project that consisted of a couple of million (with an "M") lines of Pascal. We used IBM's Pascal/VS dialect. Pascal/VS had extensions that made it very, very close to Modula-2. We used Pascal because it was portable (across IBM platforms) and strongly-typed. At the time, it was the only strongly-typed language available to us. Our error rate (bugs reported by customers) was incredibly low, because it was really hard to make many of the screw-ups that were then common in PL/1, Fortran, and c. We ended up with a system that ran across IBM's product line (mainframes, workstations, PC's).
As Pascal aged (we could see that support would be ending), we moved to C++ by converting the entire code base into a subset of C++ (using a software package we purchased and thousands of lines of AWK and sed). We used C++ as a "strongly typed subset" of "c" for about 10 years, before we started converting to objects and methods.
That project started in the 80's and is only now (almost 30 years later) being rolled up and decommissioned. The original architecture was very structured, streamlined, and simple; with an incredible amount of effort going into defining data structures (as befit the restrictions of Pascal, like no dynamic arrays). It held up very, very well. Still blows the doors off its competition in performance, but the company is getting out of development and support, and needs something it can buy (even if it's slower and has less function.)
The last Pascal-like language I have seen which was more or less interesting is Seed7.
Cursory look at the Free Pascal shows that it has gained lots of useful functions. Bu is that *the* Pascal? The Pascal was standardized by ISO in 1990 and as far as I know there were no new version of the standard since then. The Object Pascal is not standardized at all. And differs between the implementations (Free Pascal vs. Delphi).
All hope abandon ye who enter here.
For the last 25 years, we've just called it Fortran.
But how long have you been able to PUSH START TO RICH with Fortran?
Wasn't that the other programming language whos users would look down on us Basic programmers? My good friend from school was one of those. Now he's a teacher and I'm a software developer.
Pretty much sums it up, doesn't it?
OK, jokes aside: Seriously, who cares how a PL is "rated" - whatever that's supposed to mean. How much it's used and how it gets the job done, or, more precisely, how much do I get paid for using it is what counts.
Example: I love Python. I'm measurably more productive in Python. But I do PHP at work. Why? Wordpress and Typo3 are built with PHP. Python only has Plone and that has almost no market here in Germany.
Its that simple.
And to be honest, there are many neat exotic programming languages out there - all of which I would love to have the time to look into, but don't. Pascal definitely isn't on that list.
My advice to anyone today would be to let go of Pascal and however it is "rated" and learn some other flash exotic language - perhaps one of those countless new ones that run on the Java VM (Scala, Closure, etc.), no?
My 2 cents.
We suffer more in our imagination than in reality. - Seneca
...these days, what's the point of yet another language?
Don't get me wrong, Pascal was the first language I did serious development in and I really like(d) it. However I am struggling to figure out what I could accomplish in Pascal that I could not accomplish in a myriad of other languages.
I am very small, utmostly microscopic.
I used Pascal extensively back in the day... and I really don't remember Pascal ever generating byte code, nor was there a Pascal virtual machine. Plus Pascal supports pointers, doers not have garbage collection, and is very strongly typed.
Wait... can you state again just how Pascal and Java are similar?
I am very small, utmostly microscopic.
OMG! OWL... on Object Pascal. What a blast from the past!
I am very small, utmostly microscopic.
Worst Haiku ever.
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
"Power and simplicity, expressiveness and readability, great for learning and for professional development alike, these are some of the traits of today's Object Pascal."
"A tool for all trades, with compilers and development tools, embracing the mobile era, A language ready for the future, but with solid roots in the past.", (Marco Cantù, 2014) link
What could delphi possibly every offer that in not in not available in C#??? With C#, at least you have a solid company behind it (Microsoft). Ive seen this so-called Delphi cross platform and it is an utter joke. The dev environment is completely locked to Windows, the apps it generates don't even vaguely resemble a native Mac application. Visual Studio is freaking FREE, yes, FREE, and supported by an actual company like Microsoft.
The company has such a great track record as well, lets see, it was borland, then they had this brilliant idea to throw everything away and wrap everything around QT, then they threw all that away, went bankrupt and became inprise. Then that went bankrupt, assets were bought by code gear, that went bankrupt, assets bought by what embarcadero now. How long until this joke goes bankrupt.
You want cross platform, use something that actually has a standard like C#, C++ or Java.
I guess Delphi is great for maintaining your shareware windows applications you wrote back in 1995.
How about interacting with others, well Delphi is such a joke that it can't even use a C++ library compiled with MSVC, and what 3 people on the planet actually use Delphi, so I guess you could work with them???
Funny how every company I've ever worked for "used to be Borland shop". Think about it.
I can write [1,2,3,4,5].map {|x| x + 100 } in Ruby.
I think I've just written off Ruby.
Yes, because those are so popular now.
But then came the USCF P-System and Turbo Pascal, And nobody's asking about Modula.
Pascal is overrated, actually.
Even as a teaching tool, Pascal is overrated.
What an astounding amount of insight you've shown. Why, reading your logic, I wonder how I ever could've been fooled.
Borland's Turbo Pascal was my introduction to serious programming with the Object Windows Library (OWL), before getting on to the multiple disk nightmare and wonder that was Turbo C++.
Pascal lasted exactly long enough to be completely destroyed by C++ at one end taking the object oriented approach, and Modula-2 being the "language of explanation" for CS.
Even that died the death when Visual Basic stomped everything in its path in the commercial arena, with Visual C/C++ taking everything elsewhere. Somewhere along the way Delphi shone very brightly for a few months....
Well, years anyway. There was actually a Microsoft program manager that was quoted as saying something like that Microsoft should thank God for Borland every day. As someone who used both VB and Delphi, I could see all of the things MS was lifting from Delphi. Until they finally lifted its architect.
I am amazed that almost no one seems to be aware that Dr Wirth is 3 generations of software beyond his original Pascal.
He also created Modula, then Oberon and is now working on Project Oberon using Oberon-7.
The spin off company Oberon Microsystems created the framework BlackBox and a superset of Oberon called Component Pascal.
Component Pascal is now maintained by the user community and is open source.
http://blackboxframework.org/i...
I don't especially like Pascal but I love Component Pascal!
That stuff was even before my time - but IIRC that was more akin to an interpreter than a VM... this was running on the PDP-11 where I went to college and I only had access to the VAX... so I cannot say for certain. However there **was** what we would these days call a just in time compiler that generated object (or something ?) code (this must be the P-Code you mention) for the interpreter so I will give you points for that as that is definitely Java like.
I am very small, utmostly microscopic.
Pascal was not an OO language - never claimed to be.
Some of that was addressed by Borland Object Pascal.
I am very small, utmostly microscopic.
It is easy as piss to read - which makes it great for beginners and for algorithm prototyping (that you can actually compile and run).
I am very small, utmostly microscopic.
Pascal is one of those languages like Powerbuilder and even Java that people learn the one language and then drag it through the decades kicking and screaming. At least with Java the language is being kept somewhat fresh but I don't think there is much I respect less in the computer world than a one language programmer.
Well Pascal is a pretty good measure of pressure, one Newton per square meter is a nice metric number. Yet for daily life we always use kilo- and hecto-Pascals, so perhaps it is a bit under-rated.
Maybe that is what happened to the Patriots' footballs?
It's not the language, it's the ecosystem.
The fact is, I don't want to write every function and class from scratch. With JavaScript, C#, C++, or Java, there are tons of source code snips, classes, and libraries out there to do just about anything you could imagine doing on a computer. This lets me (mostly) focus on what I'm trying to get done, rather than focusing on how to make the tools to get my job done.
After using dozens of languages in my career, I'm pretty language-agnostic. Most of them can do the job. But the ones that make me the most productive, are the ones that are thriving on Stack Overflow and Code Project.
Unfortunately the state of desktop applications is now to bad, that Lazarus is now pretty much the only alternative left, particularly if you want to distribute your software in binary. .net requires the user to install a huge and fragile framework. Java does the same and even adds an insecure browser plugin. In both cases your code will need an installation routine. And even then, Lazarus will be able to compile for more platforms than Java and .net support.
On Lazarus you get a statically linked binary you can just plop onto your system and execute it. So up- and down-grading your application is trivial.
Plus you get things like bounds checking simply with a compiler option. In my tests it didn't hurt the speed, probably because the compiler can easily find out when they are needed and when not. However as far as I know you can enable and disable it per line.
Then you didn't do it far enough back. The entire concept of a virtual machine was popularized by the UCSD Pascal p-system (BCPL had the O-system in 67 but no one used it). Not only was it the precursor of the JVM (James Gosling called the p-system the main influence on Java's VM) but it also virtualized the entire OS - UCSD Pascal was one of the three original packaged OSs for the IBM PC.
Even Wirth created p-system/p-code style Pascal compilers. Until the advent of Compas/Turbo Pascal, Pascal was hardly ever compiled into machine code.
UCSD P-system was a virtual machine. introduced back in '78. I think it was most popular on the Apple II, though it ran on PC's and even the PDP-11. I went to UCSD in the mid 80's and we learned Pascal on PC's but the PDP-11's (these were small graphics workstations, not minis) were running RT-11, if I remember correctly and we used them for the assembly language class.
Personally, I'm not one of the critics of Pascal; it was my first, real programming language, and I enjoyed it a lot.
But over the years, although languages have been through a sort of Cambrian explosion, aren't beginning to see that they are converging towards the same end goal? Nearly all major language families now have things like object orientation, functional programming features etc, and I wonder if we are not going to end up one day with 'just one' (ie: a few) language again? One of the effects you can already see is that it is quite easy to move from one language to another - certainly within the C family (C, C++, Java, Javascript, ...) and even from one family to another.
Here are a few similarities, off the top of my head:
* Java's single-inheritance class system is very similar to that in Object Pascal except Pascal did not have interfaces. It's much saner and error-resistant than C++'s byzantine class system.
* System.out.println() is very similar to Pascal's Write, Writeln
* No separate header files: Interface declaration and implementation in the same source file. Java's 'import' is similar to Pascal's 'uses' statement.
* Both have runtime array bounds checking
* Some data types like 'byte' and 'boolean' seem to be taken from pascal.
http://en.wikipedia.org/wiki/UCSD_Pascal
This was a very common Pascal system (Apple II Pascal, for example) in the late 70s and early 80s and was based on a virtual machine interpreting what today would be called byte code. The design of the p-Machine influenced the design of the java VM.
When most people hear "Pascal" what they really have in their minds is "Turbo Pascal" by Borland. So they compare very old Borland IDE with Visual Studio or Eclipse.
You have the original Pascal, Delphi, Object Pascal, etc...
Even if all these language are based on the same syntax, they are all different. It is like saying that ObjectiveC and C++ are C, we can take it even funther and say that Java is C because they share the same operators and have similar syntaxes.
begin/end vs braces and := vs = doesn't matter much in the choice of language, that's just syntaxic sugar.
FPC (this is what I have the money to buy) is a good target for code generation. FPC people need a nimrod for Pascal that extends (and not substitutes) the syntax of FPC so that valid pascal is valid pascal-nimrod. In this language they could add functional features. FPC as it is has nothing more to offer to programming. Even if I find C a low level language, I believe it is very good. Nimrod guys seem to have the same opinion.
The only software tools which I have found as reliable and pleasant to use as TeX (which is said to be so full of cutting edge techinique to have revealedbugs in every Pascal compiler used to compile it) were WriteNow (~100,000 lines of assembly) and Altsys Virtuoso (Objective-C w/ NeXTstep frameworks).
Sphinx of black quartz, judge my vow.
Every language is both over-rated and under-rated by their fans and detractors respectively.
The key thing a professional programmer learns is to use the right tool for the job at hand. That means being fluent in multiple languages, databases, frameworks, and toolkits. While I have been focused exclusively on Java for the past several years, that's because it buys me the cross platform portability that I want, not because it's "better" than C/C++, C#, or even Pascal.
I'd be quite content to do some more C++ work at some point in the future. C# was kind of fun, too.
But PHP I hate with a passion. I'd far rather write servlets with Java than dive into that unholy abortion of untyped interpretation.
I do not fail; I succeed at finding out what does not work.
How often I've wished this were true. Here is an example of why C isn't an assembler. How do you access the condition codes maintained by the underlying machine? Try writing C that adds together two 8 (or 16 or 32 or 64 or whatever) bit binary integers while preserving carry out of the high order bit without having to perform additional integer operations to either synthesize the carry or recover it from an addition wider than the operands. C implements a simplified virtual ALU that has no notion of carry or overflow. It is certainly not the only language that does this, but it does make it impossible (or at least extremely inefficient) to do some things that an assembler allows as a matter of course.
Pascal, the base language created by Niklaus Wirth, was a nice little strongly-typed toy language. I say "toy" for a very good reason: it had no standard way to modularize. In theory, you'd have to write every program all in one source file! There was also no way around the type system, which is good for purity, but makes low-level systems programming impossible (try doing a CRC on record including floats when you can't convert it to bytes!)
They released a new standard in 1990, which I understand did not correct these flaws. There was a further standard released in the same year called "Extended Pascal" which did. However, there are only a few compilers that just use that standard with no extensions.
That's the important thing here. When you see someone saying how great "Pascal" is, they are invariably not talking about Pascal. They are talking about Delphi or they are talking about Object Pascal. While those are both great languages, they are also both different languages. A typical Delphi program cannot be built with an Object Pascal compiler, nor with a standard Pascal compiler. Calling them "Pascal" is about as accurate as throwing Ada on the list, and calling them all "Algol".
So the real answer here is, No. Pascal is not underrated. Those languages Delphi and Object Pascal might be, but Pascal is not.
1. Nested functions: avoids verbose parameter passing for repeating narrow-purpose sub-routines.
2. Type declarations go after the variable name, not before. This is a more natural order than C-style in my opinion.
Table-ized A.I.
I like the End-X style, such as VB's, because if the nesting gets messed up due to a typo, End-X carries info about which block ender went with which block starter. "End While" goes with "While", obviously, not an IF statement. Brackets lack this ability.
It also improves readability to document which kind of block is ending.
(VB is indeed inconsistent, but that's a problem with the language, not the End-X approach in general.)
Table-ized A.I.
My day job is as a Delphi programmer (with some C#). My first language was C on an old Zilog Z80 Unix server back when AT&T gave the source code away. Learned Pascal on both Unix and CP/M. Later used C and C++ on many machine control projects using PC's. Discovered Delphi when it was included as an add-on for controlling ESI trimming lasers. Used it in the entire production line when we were developing a line of solid state pressure transducers. Delphi was used to characterize the sensor strain gauges by temperature cycling and the data used to trim the sensors to spec with the ESI laser all data being tracked using barcodes. I would not have attempted the job using C/C++ at that time when the Watcom and Zortech compilers reigned.
I only bring up ancient history to point out that I've coded in a variety of environments and I still find Pascal in all of its variations to be a very capable tool. Not to say that it is the only tool or the best tool - it is one of many great tools in a good developers war chest.
Delphi had many great aspect, especially compile time. My wife and I put about six person years into a project together, much of the time working in Delphi. I knew (and even had taught at the college level C/C++), but she knew mostly Pascal. We did some work in C++, but got hit by the compile times (this was back working with PCs starting around 1995) as well as all the other issues writing in C++. Then we did some in Digitalk's Smalltalk/V, but got worried about lack of support for the proprietary version we were using (we could not have guessed that later is became a free-as-in-beer Smalltalk Express). Wish we had kept to Smalltalk though, as then we could have moved to Squeak a couple years later, and my wife and I really liked Smalltalk. But Smalltalk back then was also slow and had some other limits. So we moved to Delphi (the earliest versions, never moving to later versions beyond 2.0).
Here is GPL'd source for of our garden simulator in Delphi:
http://www.kurtz-fernhout.com/...
GPL'd Delphi source and translations for two other applications (PlantStudio and StoryHarp software) is here:
https://github.com/pdfernhout/...
https://github.com/pdfernhout/...
In retrospect, I think maybe we could have made the C++ approach also work better by writing unit tests for parts of the code and compiling only them in small projects. And I think I'd have much rather have the code in C++ right now than Delphi as far as long-term portability, including now translating to asm.js for web browser deployment.
But, for good or bad, I made the decision a decade ago to port it, and wrote code to parse Delphi and spit out Java and Python (doing a lot of the heavy lifting, but you need to futz with the GUI stuff and some other changes). I only got the StoryHarp app working (in a limtied way) in Java, plus I got the guts of the PlantStudio drawing algorithm in Python for a test for the OLPC.
I'm moving more into JavaScript now, for easy deployment in web browsers, so I might modify those tools to do JavaScript now? But not sure it was worth it, given the rise of Lazarus and the fact that, generally, you learn so much from writing an application that if you were to build it again, you'd do it differently.
But, in any case, Delphi was overall a pleasure to work in as far as a compiled language. Speedy. Fast turn around. Good debugging (although some library bugs with memory leaks were frustrating in the early versions -- we used memmond and its memory leak patches, plus other patches I created and found for the Delphi VCL).
When Squeak first came out, I played with generating Delphi pascal for its VM to use for Windows, but after the Windows port came out, lost some interest in that, and also got sidelines by looking into Squeak -> Newton porting. In retrospect, I wish I had finished the Squeak to Delphi port and code generation tooling, and never bothered working towards a Newton Port as the Newton OS did not want to support any more C++ than small routines, the OS's event loop conflicted with the Squeak polling architecture, Newtons had too little RAM, and of course the Newton was to be abandoned. Meanwhile, Delphi (especially via Lazarus) is still going strong!
A 21st century issue: the irony of technologies of abundance in the hands of those still thinking in terms of scarcity.
Semi-serious question:
What happens if you use the --verbose command-line option with an APL program?
Granted, the option affects the output at runtime, while APL is the language the program is coded in -- I'm not that confused. But it got me to wondering. :)
"What in the name of Fats Waller is that?"
"A four-foot prune."
I haven't heard of anyone using it in, oh, 20 years or so.
And yes, in '89-'90, I used it (along with C) at work.
Why would you *want* to use it? I mean, for one thing, it was invented as a teaching language, and didn't even have i/o (really!) - that was bolted on afterwards. For another, didn't it become java (I mean, can you say writeln, boys and grrls?)?
mark
I think we need to focus on the question at hand.
Most developers have a language preference. Whatever language you are most experienced in is usually the one you develop in the fastest (with a few rare exceptions). You can also expect to be more accustomed to the syntax, libraries etc. of your preferred language. The question wasn't "what language do you prefer?" it was "Is Pascal underrated?".
Given the comments that went along with the question I think any rational person, weighing Pascal's current standing against the other major languages would have to consider that it is. It still may not prompt you to use the language, but it might prompt a few to have a look at what is new.
I think the motive behind this post is to get all the ex-Delphi devs to go and have another look. If you have moved on to "more modern" languages it may surprise you to find that there are few if any features missing in the latest version. If you are in academics it may prompt you to use Delphi/Pascal as a teaching tool again (it was the language of choice for a long time because of its intuitive and accessible structure). If you are a sole programmer wanting to target an app to multiple platforms it is definitely worth looking at. Yes, there is Java, however Delphi XE7 is the first language that I know of that deals neatly with the UI differences between platforms, and even between form factors (see https://www.youtube.com/watch?...) let me know if another IDE has anything like this? (seriously, let me know!).
One other thing to consider: C is (according to some admittedly debatable language rating websites) the #1 most popular programming language, yet even C11 hasn't evolved as far as Pascal. Delphi is called, old, out-dated, past its prime. Its death has been called so many times Resurrection Man ( http://en.wikipedia.org/wiki/R... ) is amazed at its survival. Yet it has practically every feature found in modern languages and its popularity is increasing (if you believe Embarcadero).
Is it underrated. I program in it, I hear the comments about it, and yeah - practically everybody underrates it.
http://en.wikipedia.org/wiki/A...
"Anders Hejlsberg (born December 1960)[2] is a prominent Danish software engineer who co-designed several popular and commercially successful programming languages and development tools. He was the original author of Turbo Pascal and the chief architect of Delphi. He currently works for Microsoft as the lead architect of C#[1] and core developer on TypeScript."
I would have used dot net and C# alone for that reason based on liking Delphi -- except that the main line of those has long been proprietary and single platform compared to other language options which are free and/or multi-platform.
I'd be curious if you have by any chance tried C# and what you thought of it in comparison to Delphi?
A 21st century issue: the irony of technologies of abundance in the hands of those still thinking in terms of scarcity.
Pascal might be underrated but it doesn't matter. There is no place for Pascal in the modern programming world.
When I went to college, Pascal was the standard teaching language. I have studied it pretty thoroughly and I understand it pretty well.
Pascal was designed as a teaching language. There are features in Pascal that are stripped-down, and I think it was just to make the teaching easier. In particular, why must all goto labels be integers rather than strings? I'd much rather write goto cleanup_after_fatal_error than goto 1000. It was a tiny bit simpler to write a Pascal compiler because of this limitation.
If you know C and really want to understand why Pascal didn't win over C, get a copy of Software Tools in Pascal. Look at all the places they had to work around limitations in Pascal, and consider how to write similar code in C. In all the cases, I realized that they simply wouldn't have had a problem in C.
Also, after writing the above book, Brian Kernaghan wrote an essay Why Pascal Is Not My Favorite Programming Language and if you have rose-colored glasses for Pascal I suggest you read it.
C really is the king of the "third-generation languages". In its earliest form it had dangerously little type-checking, but in its modern form (where you use function prototypes so the compiler can check types) it has type checking similar to Pascal, with all the benefits that provides. And it has all the little things I appreciate, such as terminating a loop early using break. In Pascal, to terminate a loop early you needed to either clutter up the loop conditionals with an extra flag variable (early_exit or some such) or else you had to use goto to break out (with a numeric label target, of course).
"But wait," some of you are muttering. "I used to write Pascal programs and I remember using break..." No, you didn't used to write Pascal programs: you used to write Turbo Pascal programs. When Borland created Turbo Pascal they fixed all of the worst problems of Pascal, pretty much by just doing whatever C did first. I wrote a lot of Turbo Pascal and I liked it very much.
But this points out the biggest problem of Pascal: it was not well specified, and as a result it didn't work a lot of the time. Where a spec is weak, you tend to get different implementations doing different things, which is horrible for portability. The wonderful book Oh, Pascal! discusses the brokenness of the I/O in Standard Pascal, and the various ways that Pascal implementations work around the problem, and summarizes with Cooper's Law of Standards: "If it doesn't work, it doesn't stay standard."
For Pascal to have a niche, it should do something a lot better than C, for it is C that it needs to displace. But IMHO there really isn't anything it does very much better than C, and there are numerous areas where it's a non-starter unless it copies features from C.
Given the massive installed base of C, C isn't going anywhere, and that leaves no room for Pascal; Pascal does the same sort of things as C does, but not as well.
lf(1): it's like ls(1) but sorts filenames by extension, tersely
Everyone here seems to forget that a variant of Pascal is, for better or worse, also standardized as an IEC 61131-3 language. It's called Structured Text (ST). It is in rather widespread use in industrial automation. ST is also one of the languages you can use to write the actions of the Sequential Function Charts (SFCs), also known as Grafcet. SFCs provide most of UML State Diagram functionality. Standardized support for state machines is still not in C++, after so many years!
So Pascal isn't dead in the mainstream, it's just that it's not the mainstream you might think of. A lot of products in your fridge have been packed in machines controlled in part by Pascal code.
A successful API design takes a mixture of software design and pedagogy.
Your post got me thinking. What did they use for programming for the mission to land on the moon. They only did it once, so their was really only one programming language used.
http://en.wikipedia.org/wiki/A...
The answer: Assembly Language or specifically AGC. So there you go...
Perhaps the development of database centric programming languages (at least in enterprise environments) diminished the demand of general purpose programming languages to do that sort or work.