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
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.
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.
You're thinking of Kylix from the bad old days; wine was needed for both the IDE and the apps. From what I can find it still appears to use winelib.
In a way, this makes sense (even though it's disappointing) because it's easier to make a shim to each os/display manager than it is to rewrite everything. But still ...
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
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.
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?).
You can take the PARSE VAR statement from my cold dead hands ;-)
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.
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.
Worst Haiku ever.
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
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 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!
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'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.
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.
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.
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.
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.
"Lacks" is a strong word; it's just not inherent. Back when I used to write software in C and C++ for money, I would religiously put "}//end if" to make sure I could keep track of which braces went where. If I needed even more context, I would put " }//end if(var1 == var2). It's not that hard. Like many things in C, you have plenty of rope to hang yourself if you really want to, but you can also make it tidy and sensible if you care to. C is not your friend, and is not your enemy.
C is like an M1 rifle. Sturdy, proved in battle many times over, occasionally finnicky, and ready to put a high-powered round precisely where you aim it without apology. Whether you aim at your foot is your business.
Today's Sesame Street was brought to you by the number e.