-
Content Count
3586 -
Joined
-
Last visited
-
Days Won
176
Everything posted by David Heffernan
-
A gem from the past (Goto)
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Presumably it all depends on what is inside the try. -
A gem from the past (Goto)
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Really? Which architecture are you talking about? -
Personally I think it's unrealistic to expect to be able to solve this problem without understanding it, but I can see why people might want to do that. Anyway, good luck with this, I hope it works out for you.
-
There are probably issues in your code that are the real problem here, rather than it being an issue with the VCL. But there are certainly issues with the VCL too. Whether they impact you it's not clear. Certainly trying to set the dpi awareness at runtime, based on the os or some other environmental factor, is not the right solution. This is a complicated subject that needs a lot of understanding from developers, and testing. There's probably quite a bit of work required from you to understand the issues with the subject, and your specific app. It might also be a good time to concentrate on supported Windows versions and stop worrying about the pre Windows 10 users.
-
A gem from the past (Goto)
David Heffernan replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
I guess you know to use try/finally for this -
Docs for GetComputerName say "A pointer to a buffer that receives the computer name or the cluster virtual server name. The buffer size should be large enough to contain MAX_COMPUTERNAME_LENGTH + 1 characters." You should do that. Use the constant in your code.
-
Wait until you have a bit more complexity and then you won't love it so much!
-
In reality you aren't going to have 32k forms. However as a general rule you don't want to be thinking about stuff like that. Just use Integer everywhere and avoid it being something to consider. Now, there are sometimes situations where a 64 bit loop variable is required but they are exceptional.
-
Never mind what the ide says. What does the compiler say?
-
You should use Integer for loop variables otherwise some day you'll be caught out with an unexpected overflow.
-
The biggest issue is the use of Smallint
-
The original question concerned code that called a constructor, then set a bunch of properties. I said, it may be better to pass that information as arguments to the constructor. I'm not proposing overloading anything. I feel that you are using a specific code style from your code base to make a general point that is not valid. I understand why you might have written a bunch of classes to be parameterless and then read state from a DB. But that's really specific to your code base. Why is it bad to pass arguments to constructors? I see absolutely no reason at all to make a blanket recommendation that constructors should not have parameters.
-
Who said anything about needing multiple overloaded constructors?
-
Hmm, not quite the same thing
-
If the information needs to be transmitted, it has to get there somehow.
-
I don't really understand this. If you need to make multiple instances of the same class that are to be initialised with different values, how are you going to do that? Why does doing that initilisation in a separate stage help?
-
No, I don't think so.
-
Seems like dogma to me. Are you really saying that if a method uses more than 5 values of input data then it needs to be passed via properties rather than arguments? Many problems with that. Let's consider just one, thread safety.
-
Is 32 bit OS still a thing these days? We are about to drop support for it and probably should have done so some time ago.
-
Very likely this would give a bad UX
-
That's trivial to deal with these days by putting all dependent DLLs into an assembly that sits alongside your executable.
-
Just add more arguments. If they need to be provided, then there's no shortcut. You could make the point that when looking at the arguments at the call site you don't see the name of the parameter, but that's something that the tooling should provide you.
-
There was an issue with some older versions of Delphi where the zlib .obj files supplied by Emba with the RTL were compiled without optimisation and the performance was poor. Can't remember the version, but you'd be able to find the details by searching in Quality Portal to make sure you weren't suffering from that.
-
Given how poor the Delphi compiler is in terms of performance of generated code, I'd expect this to be slower. Is it?
-
I'd expect a 64 bit version to be faster.