views:

507

answers:

7

I've been a long-time Delphi developer and honestly day by day it started to feel more and more cumbersome especially in this age of dynamic languages like Python or Ruby. And not only the dynamic ones are progressing fast, C# and Java too are progressing at a fast rate due to competition (which were more or less comparable to Delphi's language features 5 years ago but Delphi really fell short in the coming years).

New features in 2009 version look promising and we surely need more. So, as a fellow Delphi user, what kind of language features do you think Delphi should have in order to compete with the other languages at least at the syntax level (that is to exclude high level issues like cross platform, garbage collection, etc..).

Edit: changing the subject to NATIVE version.

+2  A: 

Native regular expressions. I currently use TPerlRegex from the guy who makes RegexBuddy (which is an AWESOME product). I'd really like to see this from the CodeGear team as part of the standard libraries.

I'd also be interested in seeing some Active Directory and OpenLDAP components from CodeGear.

Mick
The guy who makes RegexBuddy would be happy to donate TPerlRegEx to CodeGear, but accepting it (or one of the many other PCRE wrappers for Delphi) doesn't seem to be a priority for them.
Jan Goyvaerts
I don't think the addition of components or libraries is what the OP was asking for. And adding regexes to the Delphi language itself - how would the syntax look like? Would such an addition even be in the spirit of current Delphi?
mghie
Mick
Making regexes part of the Delphi *language* would probably need a new operator. Say you want to set a boolean, depending on whether a string has a regex match. How would Delphi code look like? Something like b := myString ~ "[fF][oO][oO]"; (b is boolean, myString the string var to be tested) ???
mghie
That's what I mean by syntax, Delphi syntax. If it is not changed we are not speaking about language enhancements, are we? Adding the TPerlRegex library, however good it is, does not constitute a language enhancement. It's a library addition, as you said yourself.
mghie
Ah, now I understand. You are correct.
Mick
+3  A: 

Better SOAP handling is a bare requirement in order to survive, let alone advance.

Darian Miller
+3  A: 

One thing that I really would like to see, is native hash-handling like php and ruby. Both the native array and the desired hash should be assignment-compatible with a TList and TDictionary descendant, or even better - any class implementing a given interface.

var
  map: TDictionary;
  l: TList;
begin
  map := [1 = a, 2 = b, 3 = c];
  l := [1, 2, 3];
end
Vegar
Delphi 2009 has added generics and this should satisfy your desire for associative arrays...unless I'm mistaken.
Mick
+3  A: 

I would really like a qualified 'with' statement, because as it is now, people abuse 'with' way too much (it is actually considered a bad code 'smell' nowadays). The great thing about this is, that it can be used as a poor-mans version of local-variable at the same time (!)

Here a mock-up to show you what I mean by this :

procedure Example;
begin
  with s: TStringList.Create do
  try
    s.Add('Hello world');
    ShowMessage(s.Text);
  finally
    FreeAndNil(s);
  end;
end;
PatrickvL
Interesting, although I wonder how much it really saves over the local var approach.
skamradt
You could use another procedure/function instead of this but sometimes it's not good to break up your code in too many pieces. When working with mathematical algorithms it's sometimes useful to have the code in one place instead of scattered all over the place.
Tom
+3  A: 

I'd like if the compiler would fill in missing parameters when using COM interfaces, so instead of writing

  ExcelApp.Run('foo', EmptyParam, EmptyParam, EmptyParam,
    EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
    EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
    EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
    EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
    EmptyParam, EmptyParam, EmptyParam);

I could simply write

  ExcelApp.Run('foo');

and be done with it. It would also be great if named parameters would be supported, so I could only pass the first and for example fifth parameter and omit the others.

The same could be implemented for standard function calls, but this is not so important as there should not be that many parameters to begin with.

mghie
A: 
  • Lamda Expressions / Closures
  • Yield

(in native delphi, don't really care about Prism)

Tim Jarvis
Delphi 2009 has closures, they are called anonymous methods.
Barry Kelly