-
Content Count
655 -
Joined
-
Last visited
-
Days Won
12
Everything posted by Bill Meyer
-
The interfaces in Delphi are bad?
Bill Meyer replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
I use interfaces and find them very effective -- in their place. But I curse the unimaginative implementation, which seems unlikely ever to be improved. I understand that they came about to support COM. But I rarely make use of them in that context. Instead, they have become a tool for memory management, and for limiting exposure of class internals. That said, it would be very nice to be able to make getters and setters in interfaces private. That you cannot do so makes the use of properties in interfaces almost silly. But I would prefer to expose the properties, and hide the underlying methods. There has been much change since D3 in the ways most of us design our code, but the interface is like a fly captured in amber. -
Is a standard comment before each procedure implementation useful?
Bill Meyer replied to dummzeuch's topic in GExperts
I'd remove it. I have seen comments inserted as a matter of style, and consider them noise. The worst, in my view, is the comment inserted after end. procedure SomeOp; begin end; { SomeOp } First because unless the routine is very long, it is pointless, but more importantly because when you are removing code, the IDE will strip empty routines on save, and this trailing comment defeats that behavior. Comments are useful where they explain the motivation, the reasons why non-obvious operations are performed. Boilerplate comments are worse than useless. -
I have been searching online for a Delphi interface to OpenType font files. I have found many links regarding OpenType, but little or nothing for Delphi. If anyone here can suggest a link, I would appreciate it. It's a matter of curiosity, not something I expect to lead to any commercial work. TIA....
-
Yes, an obvious alternative. Was just hoping someone may have gone down that path already.
-
Using Delphi in Virtual machine for a month
Bill Meyer replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
Interesting. I've been very happy on VBox, and the changeover would be tedious, but the main thing holding me back would be that VBox apparently does not work well with Hyper-V enabled, so it is one road or the other. In my work, graphics play no part, so I have not seen any reason to be unhappy on that score. -
Boolean evaluation
Bill Meyer replied to Ole Ekerhovd's topic in Algorithms, Data Structures and Class Design
Another suggestion I offer is that when you must evaluate more than a few terms, it can be helpful to make use of local variables. This is especially true where each of your terms is itself lengthy, such as SomeObj.SomeMember.AProperty. Similarly, if several terms evaluate properties in a complex object, then rather than writing: if SomeObj.SomeMember.TermOne and SomeObj.SomeMember.TermTwo and SomeObj.SomeMember.TermThree then You might instead do: var obj: TMySubClass; begin obj := SomeObj.SomeMember; if obj.TermOne and obj.TermTwo and obj.TermThree then I also find that with many terms and long reference names, the odds of making errors in precedence increase rapidly. And the reason for that is that the mess in front of your eyes is approaching incomprehensibility. 😉 -
Boolean evaluation
Bill Meyer replied to Ole Ekerhovd's topic in Algorithms, Data Structures and Class Design
My roots were in hardware logic. Excess terms in hardware translates to using unnecessary parts, each with a measurable cost. Logic reduction is as important in software as in hardware. We don't see a hard cost for the unnecesary terms, but the cost is there, nonetheless. Look at the simplified form Lars presents. Not a big deal in small cases, but in complex chains of logic, failure to minimize becomes a maintenance issue; it impedes understanding. -
You appear to assume that this environment will continue to be viable as new versions of Delphi roll out. Unfortunately, the prevailing assumption in the development world is that a) memory is cheap, and b) it is measured in GB. Even without generics, the difference in an application built in Delphi XE and Delphi 10.2 is huge. In the case of a small app of my own, XE produced a 3MB executable, while 10.2 was over 70MB. These numbers are not horrible, but in the context of Windows 2000 treated as an embedded system, I think you are nearing the end of the line for those old systems. You may buy some time by avoiding generics, but sooner or later, you will hit a wall. In a system where your available resources are soldered into the product, you may well need to support a version for those systems which builds in an earlier version of Delphi, and perhaps cannot acquire the same new features as your main application.
-
I need to replace components in a large project. Have not previously tried to do this with GExperts, but routinely use it in single forms. On trying to run against all forms in the project, I got this error: The total count of the target components was 193. After the failed replace, it was 146, so has done some of the work before failing.
-
This may be worth exploring: https://torry.net/quicksearchd.php?String=joystick&Title=Yes
-
Tool to fix up uses clause unit namespaces?
Bill Meyer replied to Vincent Parrett's topic in General Help
Spent a bit of time with your source. So far, it appears to correctly handle some of the thornier issues which we have in our legacy code. I do need to do some additional testing, and find my way to some of the settings, but what I see so far is very encouraging. -
Dictionaries, Hashing and Performance
Bill Meyer replied to Clément's topic in Algorithms, Data Structures and Class Design
From Primož Gabrijelčič's latest book: vs.- 53 replies
-
- tdictionary
- tstringlist
-
(and 2 more)
Tagged with:
-
Perhaps there has been some change over versions in when the desktop save is accomplished. In D2007, where I spend a good deal of time, the behavior I described is so consistent that I sometimes treat it as a feature.
-
If you found it necessary to kill Delphi, then the desktop would not have been updated, and on the next open, the files presented would be from the last saved desktop state.
-
As a Delphi expert, do you ever need to refactor or improve your code?
Bill Meyer replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
I think we all recognize that our skills evolve. And so does our thinking. Moreover, today's "best practices" will someday probably be superseded. Any non-trivial code can be improved. -
Tool to fix up uses clause unit namespaces?
Bill Meyer replied to Vincent Parrett's topic in General Help
If I get out from under some of my other tasks, I will. My TODO list is a bit long at the moment. 😉 -
Tool to fix up uses clause unit namespaces?
Bill Meyer replied to Vincent Parrett's topic in General Help
Is it not true, though, that they both refuse to tangle with comments -- and compiler directives -- in the uses clauses? That is an issue for the couple of thousand modules I need to process. And yes, it is a less simple problem than it looks. I spent some time on it, and was not willing to spend more, as I have other priorities which demand my time. -
Perhaps I should have said "disappointing" defect repair. Although there has been some renewed effort in the last year or two, there remains a long list of issues, some of which have been around for a very long time.
-
Have you followed the last decade of uneven support efforts?
-
On https://blog.dummzeuch.de/experimental-gexperts-version/gexperts-1-3-15-experimental-twm-2019-11-23/ The links now resemble: https://www.virustotal.com/gui/file/22eb6503c8011a347a54a98f2ff62719eb4bc0bf5a5ebe1d62aeb5da90e53b89/detection Nasty stuff.
-
I see. I guess I was moving too quickly and didn't read your notes.
-
I have seen the basic message before, but this one leaves me scratching my head: [DCC Error] E2161 Warning: Duplicate resource: Type 14 (ICON GROUP), ID MAINICON; File D:\MyProj\MyProg.RES resource kept; file D:\MyProj\MyProg.RES resource discarded. The file kept and the file discarded are the same file?
-
I have found that Shift-Ctrl-Alt-Up/Dn is a great benefit in dealing with large uses clauses. But as well as it works on the desktop, it does not function at all when I am on RDP. Whether this is a consequence of something in RDP which could be altered, I have not discovered. I wonder whether this is a known issue.
-
I see. I have been conditioned to expect top of category pages to be empty, so had not looked at that one. Thanks!
-
I did not find a way to do that, short of editing the registry entries directly. Is there a menu path I have missed?