Delphi language
![delphi language delphi language](https://i.pinimg.com/originals/c4/17/b2/c417b2310500f7ff71c233bcf7bef509.png)
Honestly I'd consider it an unholy abomination. That's not exactly readable, and it certainly isn't pretty. Result := SysUtils.CompareStr(L.Key,R.Key) Not more readable? Let's look at some of Delphi's wonderful anonymous methods. It >probably boils down to personal taste, but I also don't find it more readable > Stuff like your "ResizeChildren" costs like two lines more in Delphi. ANYTHING must seem less verbose than Java. I think the explanation for the disconnect is that you come from Java, a language even more verbose than the legendary COBOL. >What's the problem with anonymous methods? They are, by no way, not >Coming from C++ and Java, I'm still new to Delphi. I still have less than a year experience with Delphi, but from what I've seen so far, the language itself is fantastic. I don't see how declaring local variables somewhere within a method is going to make my life easier. The "lack" of in-line variable declarations is one of the things I have quickly learnt to LOVE after switching to delphi.
DELPHI LANGUAGE CODE
If comparing or discussing class hierarchies and architectures, you're not going to use pure source code either way. I don't really see what I earn by making my class declaration a few lines shorter. I also don't understand the motivation for stuff like anonymous property storage. It probably boils down to personal taste, but I also don't find it more readable either. Stuff like your "ResizeChildren" costs like two lines more in Delphi. What's the problem with anonymous methods? They are, by no way, not long-winded. When I have to write a multiline string constant, multiline strings come handy.Įven better – DWS will ignore leading common indentation if string is introduced with #” (or #’).Īnd last (but definitely not least), DWS implements a true conditional operator.Ĭoming from C++ and Java, I'm still new to Delphi.
![delphi language delphi language](https://cdn2.vectorstock.com/i/1000x1000/22/41/delphi-programming-language-code-vector-12502241.jpg)
![delphi language delphi language](https://cdn4.iconfinder.com/data/icons/coding-files-extensions/512/coding-file-extension-delphi-512.png)
I also love type inference and in-line variable declaration which allow me to write code like this: Procedure TToDoListTemplate.SetTask(value: string) Procedure TToDoListTemplate.SetDetail(value: string) Property Detail: string read GetDetail write SetDetail įunction TToDoListTemplate.GetDetail: string įunction TToDoListTemplate.GetTask: string Property Task: string read GetTask write SetTask If I redo this the Delphi way, I end up with a much longer code. Property Detail: string read (W3lblDet.Caption) write (W3lblDet.Caption) Property Task: string read (W3lblTask.Caption) write (W3lblTask.Caption) Property Data: integer read FData write FData Īnother nice feature are property expressions – a way to write anonymous getters and setters. If my property only exposes a field and doesn’t use getter or setter, I can shorten the code by 50% by not defining the field at all.
![delphi language delphi language](https://www.embarcadero.com/images/rad-studio/features/smart-responsive-designing_riseoflegions.jpg)
Lambda (layout, value) (value) end) Īlso useful are properties with anonymous storage. In DWS, however, I can use var repeater := TW3EventRepeater.Create( lambda (Sender) => MyFunction, 5000) Delphi’s approach to anonymous methods is so damn long-winded (even for us Pascal programmers who love to type) that lots of programmers reject it just because of the unwieldy syntax.
DELPHI LANGUAGE FULL
In particular, I like what Eric is doing with the DWS and I absolutely enjoy coding in Smart Mobile Studio where I could use the full power of Eric’s improvements to the language. While I love the way Delphi is expanding to multiple platforms (but please, guys, stop the horses once in a while and fix some bugs!), I think the Delphi language could use a facelift.