I’ve quotes two of the G+ comments as they perfectly reflect my point of view: the non-modal search and IDE Insight – introduced somewhere after XE3 – are a dork to use.
I’m doing more Delphi work lately and these being non-modal seriously hinder my work (and it gets progressively worse on a 3K or 4K monitor).
In my book: why implement a feature to emulate the competition when you do it so badly?
So: are there any experts around that bring back the old search and IDE Insight behaviour back?
+Marco Cantù I’m pretty sure I’ve mentioned it before, but hey:
The new edit field cannot be placed in a position which does not require significant eye-focus change to read. This means it is significantly more cumbersome to use, as focus must be transferred to some “out of sight” area. In addition one does not get the same instant feedback that the IDE did register your F6 keypress. The old one was “in your face” instantly when you pressed F6, so no need to take your eyes off the form you’re designing, and it left no doubt about F6 being registered or not.
The dropdown list with suggestions that pops up when you type is much more difficult to read than the list in the old one, both due to positioning (thanks to the above) and due to length until it’s heavily constrained by input.
From what I recall, the new edit field does not behave the same when invoked repeatedly, requiring more keystrokes to get the same effect compared to the old. I haven’t used XE3 in ages though so I don’t recall the specifics anymore, just that the new feels more clunky to use.
That’s just off the top of my head. Yes I still use it, but not nearly as much as I did, and when I do it’s one to two orders of magnitude slower to use compared to the old one. Not because it searches slower, but because of the issues described above.
+Marco Cantù I second what +Asbjørn Heid said. When I press F6 now, I never know where to put my eyes. In XE3 a dialog popped up which took my attention.
Similarly for the non-modal search, although somehow I’m more used to the modern version now. When compared with VS though the Delphi search is very lacking. The great thing about the VS search is that it gives live feedback on which text in the edit window match the text in the search window. If Delphi would do that it would make an immense difference. It’s definitely worth spending some time in VS using their search facility. And indeed in other IDEs / editors.
There was a lot of negative feedback on both of these changes when they were released. Surely Embarcadero noticed that.
A while ago, StackOverflow user Kobus Smit did some brilliant editorial work that – due to current state of StackOverflow – sort of fired backwards: his question got marked as duplicate before he could post his excellent answer. After that answer was posted, the oh-so pride SO-demi gods never took any energy to revisit to see which answers were best.
His simple question:
How can my Delphi app easily write to the Windows Event Log?What is the difference between TEventLogger and ReportEvent? How do I use the ReportEvent function?
Which somehow should be encompassed by this Delphi 5 question (apparently that 15+ year old Delphi version is still considered current by the SO demi-gods).
The answer summarises and extends existing answers spread out over StackOverflow and adds an EventLog git repository wrapping the ReportEventandRegisterEventSource (which somehow is always a pain: Delphi services for instance often forget that).
Lesson learned when doing editorial work:
prepare both the answer and question in markdown off-line
ensure you mention in the question that the answer is meant as collection of “best of” answers found elsewhere
post the question and answer in rapid succession
cross your fingers for the StackOverflow demi-gods being in a good mood
Recently I bumped into a thing that I’d long forgotten: the Delphi compiler treats searching for include files (any files used with the {$I} or {$include} directive differently:
The compiler first searches the directory where the file that is including resides and then uses the project and IDE search paths.
The IDE only uses the project and IDE search paths.
This means that when you press Ctrl-Enter on the filename to be included you might edit a different file than the compiler will include.
So when a product has multiple include files with the same name in different sub-directories, then you must modify them all.
I’m not sure this is a bug or feature, so Embarcadero is free to put this in either their QA system or documentation system.
There are many implementations of this in other languages, for instance Ruby’s ‘times()’ function in C# | Of Code and Me (which the WordPress.com editor fucked up as it replaced Action<int> with Action which is a totally different thing, so the gist with code is below.
public static class IntExtensions
{
public static void Times(this int i, Action func)
{
for(int j = 0; j < i; j++)
{
func(j);
}
}
}
Since the WordPress.com editor fucks up TProc<Integer> into TProc and TProc behaves differently from TProc<Integer>, I’ve included a gist link with the actual code below.
program RubyManiaConsoleProject;
uses
System.SysUtils;
type
TRubyMania = record helper for ShortInt
procedure times(const IterBody: TProc);
end;
procedure TRubyMania.times(const IterBody: TProc);
var
i: Integer;
begin
for i := 0 to Self-1 do
IterBody(i);
end;
begin
5.times(
procedure(i: Integer)
begin
Write(i, ' ');
end
);
end.
It also shows why I hardly use anonymous methods in Delphi: they’re way too verbose.
Stefan Glienke worded it perfectly: Default(typeIdentifier) is a “magic” function that is implemented into the compiler and causes it to generate the correct code – like for records with managed fields it generates a call to FinalizeRecord and some instructions to zero the remaining fields.
Because the IDE uses this on-line content, potentially any code could be executed inside the IDE (apart from that page being loaded over http, so any man-in-the-middle could abuse this, but I digress). This imposes a security risk as many developers run the IDE from accounts having more rights than the average user.
I think the reason forward declaration of classes and interfaces is possible because they both are reference types, so referring does not impose copying.
Anyway, the trick is this:
You can’t have forward declarations for record types. Define both Implicit operators in the second type