Free Pascal 2.0 Released
Eugenia writes "After five years of development, Free Pascal 2.0 is ready and it includes support for many architectures and OSes. It now has threading support, interfaces, widestring and better Delphi support among many other new features. OSNews posted an article introducing the updated GPL compiler." petermgreen adds a list of some of the major changes since the last stable release: "Much better support for Delphi language features (especailly method pointers); more supported CPUs (AMD64, SPARC, PPC (32 bit), ARM) and platforms (Mac OS classic, Mac OS X, MorphOS, Novell Netware); a new and better structured Unix RTL Threading support; and a large number of internal changes including rewriting large parts of the compiler to make it more maintainable and easier to port to new architectures," and notes that "Visual parts of Delphi are being handled by a seperate project known as lazarus, which has not yet reached 1.0 but should do so fairly soon."
Yes, I do use C++/Objective-C (when I have to program in OS-X with the Cocoa framework), and C# and Java. The productive gap I fell between the two first C-like languages is that, in Delphi, the work is done in a tenth of the time, specially for GUI and Database-enabled apps. When compared with Java and C# I would say that the time spent is twice or three times lower in Delphi.
Of course, the fact that I develop mostly in Delphi makes easier to me to be productive in this language. But I have a friend who went to work in a full-Java environment, being good at it to the point of being a lecturer, and he agree that the Java world is still way behind when it comes to RAD.
Having said all of this, many windows applications are built in Delphi. Here's a list of only the most famous.
Delphi is generally considered the best tool for development in Windows. Simply put, its strengths are:
- Complete OO language, including real properties that were now copied by C# (actually, chief architect of Delphi-1 and 2, Anders Heijlsberg, is doing the same role in MS for C#).
- Easy to use IDE.
- Targets Win32,
.NET (and Linux if you use Kylix, which was somewhat abandoned by Borland).
- A complete and mature framework, the VCL, with thousands of free components available on the web.
- Compiled code (when in Win32), which generates executables comparable in speed to those in C++.
So why isn't it more widely used? I would say that one thing is because of Borland is a tiny company when compared to MS or Sun. The other is that it is a proprietary tool. And the third, generally the most commented, is that Borland maybe didn't know how to sell it properly.I did a whole lot of programming in pascal as a hobby many years ago, after moving from it in Basic. Since that time, I've learned C, although I haven't done anywhere near as much programming in it, partly because I lost interest in programming in general - I've found a few other IT related things that have interested me more eg., networking.
I like C a lot, as it allows you to break a lot of "general" programming the rules. However, I think it is a terrible language to learn programming in, because it doesn't enforce general programming rules that should normally be followed, unlike pascal.
After you've learnt the rules of programming in a language such as Pascal, you can usually break the rules in C relatively safely, because you realise when you're stepping across the line, can work out what the consequences will be, and how to do it safely.
Of course, you're still being a bit naughtly, and, the D you deserve will need to be sort from some other source than the programming language you're using :-)
The Internet's nature is peer to peer - 20050301_cs_profs.pdf
I'll try and answer some of your questions, or at least shed some light on them. A lot of this really comes down to "historical reasons" -- it was created that way 30+ years ago, and so we're still stuck with it today. Kinda like the "creat()" function in C/Unix. :-)
:)
.c file for a .h file). It provided a form of encapsulation. If you were distributing a unit, you could distribute just the "interface" part and others could still use the unit.
"...randomly placing components around a window makes it hard to group and line up things..."
I think they expect you to use the alignment tools to fix that up. Like you say, Windoze background. The idea of having software arrange your widgets/controls for you is too foreign.
"...every expression is terminated with a semi-colon, like C, except for the last one in a code-block, which is optiona."
Not quite. In C, semicolons are, indeed, statement terminators. In Pascal, they
are statement separators. That's why you see the behavior you do. For better or worse.
Like you, I took to putting semicolons at the end of most things. I solved the IF problem by using BEGIN/END blocks nearly everywhere. It can be argued that is the right way to go in the long term anyway. Remember, Pascal is designed to encourage good programing practices, and sometimes that increases the short term effort required. Sure, newer languages like Python do a better job, but building Python on the hardware of 30 years ago wouldn't be practical.
"Furthermore, blocks start with 'begin', and end with 'end'. That's alot of characters to type... "
That's why God invented macros.
"Finally, a unit is split up in sections like 'interface', 'implementation'."
Turbo Pascal (the ancestor to Delphi and Object Pascal) created units as a way to easily define libraries. You created an "interface", which was the published API for the library -- kinda like a C header file. The "implementation" was the code (like the
"Why aren't these simply blocks?"
Mainly because they function at a higher level then the normal lexical scopes that BEGIN/END define. In particular, you can define globals that are part of the implementation only, or are also published in the interface.
"And why is the unit itself some sort of half block terminated with 'end.'"
A Pascal program begins with "PROGRAM Foo" and ends with "END."; the Unit syntax just follows suit. No BEGIN was used for the global scope. I expect it's mainly because the "PROGRAM" (or "UNIT") implies you are starting; it also means BEGIN/END are only used to create lexical scopes. The period at the end just signifies the end of the program, same as with an English sentence. It fits Pascal's general approach of trying to provide redundency for safety.
"It's all a matter of taste in the end."
Absolutely.
dragonhawk@iname.microsoft.com
I do not like Microsoft. Remove them from my email address.