-
Content Count
3499 -
Joined
-
Last visited
-
Days Won
174
Posts posted by David Heffernan
-
-
There are a few common reasons why people write software.
1. They get paid to do it.
2. They find intrinsic reward for it.
I doubt anybody here not already a developer on this project is going to fit in those categories. Such a person has a steep learning curve, and what would be their reward?
- 1
-
Have you any Delphi experience yourself? What is your involvement in this project?
-
There's absolutely no reason why you should not do this.
- 4
-
It's important to learn how to try finally is used. Like this
resource := acquireResource;
try
resource.doSomething;
finally
resource.release;
end;
I've not use standard names here, but gone for a more conceptual presentation.
The key is the order of things.
-
15 hours ago, Rudy Velthuis said:RAII is for things that must be reversed, i.e. pointers that must be freed/deleted, screen cursors that must be returned to crArrow, files or ports or streams that must be closed again, etc.etc. But many objects in C++ are not used from a pointer or reference (except if they are supposed to be inheritance-polymorphic), they are used as stack (local frame) objects. That is the main automatic memory management. Actually RAII also builds on that principle: the reversals are done in the destructors of the stack-based RAII objects.
And C++ has had from the beginning what Delphi got now too: limited scopes, i.e. variables that live only during the scope of a block, not just an entire function frame anymore. Together with mrecords with automatic destruction (you don't even really need automatic construction for that, IMO), that provides a simple way to do RAII too, one that does not involve interfaces and is probably far more lightweight and faster than the current smart pointers/guards/whatever using interfaces. But even with interfaces: an interface declared as inline variable must be released at the end of the block in which it was declared, not just at the end of the enclosing function anymore.
I'm not sure what the purpose of this post is but it is pretty off topic.
-
5 hours ago, Микола Петрівський said:Interesting observation: Android ART is written in C++ and core of Unity (game engine) is also written in C++. In both cases code with manual memory management is doing all hard work, and garbage collected code (Java and C#) sits on top of it. So authors of this codebases also were perfectly aware of problems related to mixing different memory management models, and have separated them on language borders. Delphi has to be good in both low level stuff and business logic, so it had to switch to simpler memory management model.
Well, typical C++ code has automatic memory management too using the RAII principle. So that argument falls down I think.
- 1
-
1 hour ago, Lars Fosdal said:@David Heffernan, isn't there a variation where the iteration is done before the statement?
No. The only C++ loop with an interaction statement is for.
-
1 hour ago, dummzeuch said:This was not about a video but about a blog post. But feel free to continue not reading anything I post. It's completely voluntary.
I agree that most videos on programming are a waste of time.
It's still my opinion that somebody who comments on a blog post should at least have read it. If you had, you would have noticed that I already mentioned RtlGetVersion and discarded it because it does not give me the information I wanted.
Just in case you are interested nonetheless: I have just written another blog post crediting your hint. If you don't want to be credited with something that you apparently deem to be too trivial for your attention please let me know.
I think that the point Angus was making was that he read the text, and did not follow the link. The text seemed to be the first two paragraphs of the blog post, but without mentioning that there was more to be found by following the link.
I have to say that I read the post two or three times wondering what it was that you were trying to tell us. Since the text you did include was only part of the story, it would in my view, have been better not to have included any text and just referred us to the offsite link to your blog post.
That's at least three people that were confused by the post. Listen to our feedback or not. It's completely voluntary. 😉
-
🤦🏻♀
- 1
-
The Delphi code will look just like the C++ code. I don't think you draw on the canvas at the same time though, the examples show that a lock has to be used.
-
The C++ for loop, in its general form, is trivially translated into a while loop. So
for (init; condition; iteration) statement
becomes
init;
while (condition) {
statement;
iteration;
}
It is well worth knowing this if you are in the business of translating pieces of code.
So in C++ the for loop is syntactic sugar on top of the while loop.
In Delphi also the classic for loop can also be trivially expressed as a while loop. This for loop is simpler than that of C++ but it's still just a while loop (condition tested before body executed) with implicit increment.
They Pascal repeat loop is like the C++ do loop. They key being that the condition is at the end of the body rather than the beginning.
- 2
-
We can only dream.......
- 2
-
Load into memory, close, then parse is likely wasteful and risks memory exhaustion.
I would urge you to choose the simplest solution that meets your needs, at every decision point.
- 1
-
23 hours ago, Mike Torrettinni said:That is definitely different that what I would... I try to open and close files as fast as possible, but maybe this is not such a bad idea. So, i lock the file and use it until I don't need it anymore. Which could actually work, because files are in 99% local files.
Why are you so worried about reading from files. It's perfectly normal to open a file, read it, parse as you go, then close. In fact trying to do other than that is just going to create more complexity for you. To what benefit?
What is the problem here? What do you see going wrong with the most simple way to read files?
It looks like you are inventing a problem where none exists.
- 1
-
I'm just curious. Do either of you have a stopping condition?
- 5
-
2 hours ago, Attila Kovacs said:Throw them an exception. Then they (your callers) will start checking by themselves and throwing an exception to its callers etc.. at the end you will have a solid app.
That's not how you do exception handling. You don't need to catch and re-raise. You can just let them float up to wherever in the code knows how to deal with them with finality.
- 1
-
You shouldn't put checks for parameter validity in every method. Your code will just be full of that and you will drown in clutter.
- 2
-
Perhaps you should step back and ask why you want two distinct things to have the same name. That, rather than the banal compilation warning, is surely the real issue here.
-
You've really raised an army here Alek
- 1
-
1 hour ago, edwinyzh said:it's closer to the China mainland than Scotland is to the UK
Dude, Scotland is literally inside the UK
- 1
-
1 hour ago, Lars Fosdal said:Giving up their own compiler is completely different thing.
Open source isn't giving up. It's allowing contributions from outside. Emba would still be in control.
The only open source project I have any involvement is Spring4d. Who do you think is the boss of that? It sure ain't me. And that's exactly how it should be.
A good open source project has strong management and leadership, and those contributors that can fit in and add to the development effort are facilitated. You don't just hand control to random collaborators.
Stefan's point about open source collaborators is spot on. Good programmers aren't going to spend their time on open source projects unless it's rewarding and fun. I certainly could never see myself working with the OP here.
- 6
-
8 minutes ago, Remy Lebeau said:Borland tried that once before. The CLX framework in Delphi 6 was a cross-platform version of the VCL. Most of the interfaces remained the same, just the internal implementations changed. That didn't work out so well for them, CLX had to be scrapped.
CLX was actually alright. I built a cross platform app with it back in the day and lived for quite some time
-
6 hours ago, Ugochukwu Mmaduekwe said:Using C++ libraries was ok at a time when Delphi was Windows only but please we are in the Cross Platform era now.
Which platform doesn't have good C and C++ compilers?
- 2
-
31 minutes ago, Bill Meyer said:History shows that the US looking after its own interests has had us paying most of the costs of defense for Europe since WWII.
You are entitled to your own opinion, but not your own facts.
Those aren't facts though. If you are going to make a claim, back it up with credible evidence. Just because 45 said it, doesn't make it true.
Looking for someone to fix TardsPlaya (A program that buffers Twitch Streams to an external media player)
in General Help
Posted
Personally I think it would take a little more than that to get someone motivated. Just giving you a view from a programmer.