Ad blocker interference detected!
Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers
Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.
Features Present in Other Languages Edit
Although Delphi is a fairly extensive language (and IDE) there are still quite a few features that would bring it up to parity with existing languages. These features are listed below.
String support in case statements Edit
Other languages have switch, select, or case statements that support strings. Delphi only supports Ordinal Types. For example, the following statement doesn't compile in Delphi 2005 or earlier versions:
case SomeVariable of 'StringValue': DoSomething; 'StringValue2': DoSomethingElse; end;
However, the following does compile:
case SomeVariable of 'A': DoSomething; 'B': DoSomethingElse; end;
- Developer comment: This would go entirely against the objective of the case statement which is to make optimisation possible, and thus only allows types that fit in registers more or less (exception: int64, but that fits in two)
- Reply: Introducing this new addition to the case statement syntax doesn't prevent optimisation. The compiler can just check the type and perform optimisation when ordinal types are used. The flexibility of the new syntax would outweigh the optimisation benefits. It would be left up to the developer to use the new construct or not. Perhaps it could even be a compiler option.
- Another Reply: On the contrary! I think a built-in should be better to optimize! If the compiler knows more about the real intent of the programmer, it's freer to choose a better optimization strategy. The D language follows this principle. For example, if you carefully write a binary search algorithm to fake a case on strings, the compiler can't say: "Well the programmer is trying to do a case on strings, let's change that binary search to a hashtable!". On a side note, wouldn't it be awesome if we had sets of more complex objects?
- Another Reply: The language is the medium between the programmer and the compiler and should be more accommodating to the programmer's intuition rather than the compiler's restrictions.
One of Delphi's deficiencies (from version 1.0 to 2007) is its limited, badly scaling container types. A good library based on templates could remedy this.
Delphi 2009 has introduced Generics (not templates) similar to those possible in .NET. The debugger in 2009 needs some improvements to handle the Generics better.
Existing languages that implement templates (otherwise known as generics): Ada, C++, Java 1.5. In addition, any .NET 2.0 based language will be able to implement generics because the runtime and framework will provide this when it is released.
- Thomas Mueller's solution to templates for Delphi: Object Pascal Templates
Some Delphi features seem half-baked. Interfaces seem to be tightly coupled with Windows features that don't exist anywhere else in the language (I'm talking about GUIDS, keywords used only for windows integration and more specifically, about "Automation object method-call syntax" which can be found in Delphi 5 help file. I guess things haven't improved much since then). Open array constructors, differences between strings (very ease to use) and arrays (a mix between C and Pascal, without any easy way to iteratively append items) are weird. Global variables can be initialized at declartion point but local variables cannot. Const arrays are initialized with a different syntax than open array constructors. Delphi has a cleaner language than Visual Basic, sure, but it also has VB-like warts. And last, but not least, the precedence of "and" and "or" are laughable... But this comes from the original Pascal, so Wirth is to blame.
Regular Expressions Edit
Native support for Perl-compatible regular expressions. Delphi for .NET supports regular expressions through the .NET framework, but Win32 Delphi doesn't support perl style regular expressions.
See Libraries for a third party library that will work for Win32.
New Features That Would Be Unique To Delphi Edit
Users can add new feature requests to this section. If you're not sure whether other languages support it add the feature request here. Someone is bound to see this and move it to the other section if they know that some other language or IDE supports this feature already.
- Designtime Web Mashup RAD*
Delphi needs some improvements to the RAD tools that will raise it back above what is possible right now with Visual Studio 200X and its WPF designers. Designtime instances of Delphi classes are the same code/objects that are instantiated at runtime, making all kinds of amazing things possible in Delphi such as loading up a database table object (dataset) full of data and showing it in a data aware control. This kind of rapid-prototyping (zero-code) capability is really powerful, and should be extended to extend the range of applications you could quickly prototype on a desktop. The internet and web-services, for example, could create some compelling content sources which could be used as live-data. The ability to clip part of a web site (a web clip) and paste it at designtime into the delphi IDE, for example.