Board index » cppbuilder » Re: Borland has broken it's promises once again

Re: Borland has broken it's promises once again


2005-11-23 08:21:44 PM
cppbuilder10
Alan Bellingham wrote:
Quote
>are perfect. Coding work arounds is part of everyday (or at least
>everyweek <g>) life for a developer.

As is moaning about having to work around. You're not trying to
deprive me of my right to moan, are you? Are you?
Oh no. Not unless you deprive me of my right to be sarcastic :)
Quote
(I accept that your company is different - you're paid to deal with
*problems*. No, make that PROBLEMS.)
True although coding shouldn't have the same issues. I suppose it's
likely that we take a more pragmatic view of life :)
Quote
This is an interestingly different thing which is probably going to
cause some confusion. But that goes with the territory, I suspect.
However, a lot of the time, you have a big window with known smaller
windows inside it.
I think the issue is non-modal windows interacting with each other.
Then again I've never tried any serious GUI design code and wouldn't
really want to. I wouldn't mind a job in OS development though and
there my ability to tolerate ugly code could be an asset :)
--
Andrue Cope [TeamB]
[Bicester, Uk]
info.borland.com/newsgroups/guide.html
 
 

Re:Re: Borland has broken it's promises once again

At 13:05:23, 23.11.2005, Alan Bellingham wrote:
Quote
I'd prefer in such cases to have a construction that looked more like:

Parent->add(new SubWindow());

than

new SubWindow(Parent);
It may be clearer, but also easier to forget to add the subWindow to the
owner (a parent is not necessarily the owner). Since Owner is a required
parameter, you'll have to give it at least some thought what it should
be. <g>
--
Rudy Velthuis [TeamB] velthuis.homepage.t-online.de
"Any man who is under 30, and is not a liberal, has not heart; and any
man who is over 30, and is not a conservative, has no brains."
- Sir Winston Churchill (1874-1965)
 

Re:Re: Borland has broken it's promises once again

Alan Bellingham < XXXX@XXXXX.COM >writes:
Quote
It's like wandering into a small North Oxfordshire town and seeing
that all the inhabitants have six fingers.
Isn't Oxfordshire the place where we met some years ago? :-)
And I always thought it was the C++ meeting that brought you there ...
 

{smallsort}

Re:Re: Borland has broken it's promises once again

Thomas Maeder [TeamB] wrote:
Quote
>It's like wandering into a small North Oxfordshire town and seeing
>that all the inhabitants have six fingers.

Isn't Oxfordshire the place where we met some years ago? :-)
I only /work/ in Oxfordshire so I'm not worried about what he's seen :D
--
Andrue Cope [TeamB]
[Bicester, Uk]
info.borland.com/newsgroups/guide.html
 

Re:Re: Borland has broken it's promises once again

Quote
First, there are several stages to being "created". I guess you meant
initialization, i.e. filling the object with values. In Delphi, most
Not sure what you mean here. What stage of "created" exists
beside initialization?
Quote
constructors have the word "inherited" as first line, which means that
the inherited constructor is called first, so in effect, the base class
is "created" first. Some VCL objects use some of the earlier stages
(which are open to the programmer, in Delphi) to do some trickery. This
should however never cause recursion.
Check the help for TForm.
 

Re:Re: Borland has broken it's promises once again

"Rudy Velthuis [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
At 12:10:00, 23.11.2005, Duane Hebert wrote:

>
>I've seen too many times that a dtor isn't even
>called because something decided to "free" the object.

I don't quite follow. Delphi objects' Free calls the dtor, if this is not
nil, and simply does nothing otherwise. You can't deallocate an object in
any other way.
Rudy, I don't know what Delphi does in Delphi. In BCB,
there are several ways that objects can get deleted.
The owner can get deleted. The parent can get deleted.
The caller can delete it. The dtor does not alway get
called in cases like the parent getting deleted.
Even if the dtor does get called, it's not always easy to
determine when. I think it's because of dependancy on
messages being sent and processed but I don't know
that for sure. It just seems to be that way to me.
For example, I have a form. It has a parent and an owner.
In my form, I have a button. It has a parent and an owner.
I put it in an auto_ptr. The form's parent goes away.
The button's parent goes away. If this happens before
the auto_ptr is destroyed, the button is freed or deleted,
whichever but not set to null. The auto_ptr goes out of
scope. It tries to remove its contents. It crashes.
Not sure what happens if the auto_ptr cleans up first
as it doesn't set it to null either.
I don't have BCB installed presently so I can't give you
a test case. I can tell you that it's a bad idea to have
VCL objects with owner and or parent in an auto_ptr.
I can also tell you that the cleanup is different when owners
delete children and when parents get deleted.
I can also tell you that dtors aren't always called. For
a quick example of this, create a simple project with a form.
In the dtor, write to a text file. Run it. Log off windows.
 

Re:Re: Borland has broken it's promises once again

"Rudy Velthuis [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
At 00:11:17, 23.11.2005, Duane Hebert wrote:

Delphi, C#, other OO languages designed with RAD in mind. C++ would have
to emulate some of the features these languages have natively. It would
never be quite the same.
When you say RAD, I assume you mean GUI stuff.
I don't find Qt clumsy. I also don't find that there's any c++
thing that I can't do in my Qt projects. I can create Qt
visual objects on the stack. I can use multiple inheritance,
though I don't usually. I can put them in auto_ptrs, shared_ptrs,
whatever. NONE of my straight non gui business code is
affected in the least.
Borland chose to implement VCL in BCB by using their
existing Delphi stuff. Because of their choice, and their
implementations, there are some restrictions in usage.
For the most part, it works well as a GUI/RAD tool.
This doesn't mean that it's not possible to impliment
GUI/RAD in straight C++. Actually, I would be at a lost
to describe any software that couldn't be implemented
in C++. Whether or not it's clumsy, would depend first
on the implementators and second on your definition of
clumsy.
 

Re:Re: Borland has broken it's promises once again

Duane Hebert wrote:
Quote
"Rudy Velthuis [TeamB]" < XXXX@XXXXX.COM >wrote in message
news:xn0ea2gwi22axje017-velthuis@www.teamb.com...

>At 00:11:17, 23.11.2005, Duane Hebert wrote:
>
>Delphi, C#, other OO languages designed with RAD in mind. C++ would have
>to emulate some of the features these languages have natively. It would
>never be quite the same.


When you say RAD, I assume you mean GUI stuff.

This doesn't mean that it's not possible to impliment
GUI/RAD in straight C++. Actually, I would be at a lost
to describe any software that couldn't be implemented
in C++. Whether or not it's clumsy, would depend first
on the implementators and second on your definition of
clumsy.
C++ not having a reflection mechanism that is part of the language
specification makes it more difficult to implement RAD in standard C++.
It means that RAD must either be done through language extensions and/or
through extensions to a given compiler at compile time which allow the
equivalent of reflection data to be written to persistent storage and
read back again at run-time.
While I would have liked to see a run-time reflection mechanism built
into the language itself, the C++ standards committee appears to be
going in the direction of the latter method. But exactly what that is,
except for its current name, and what is being done in that regard is a
closed door to all of those who are not part of the committee. I wish
them the best but if it does not succeed by the time of the next C++
standard, I will be personally very disappointed.
 

Re:Re: Borland has broken it's promises once again

XXXX@XXXXX.COM (Thomas Maeder [TeamB]) wrote:
Quote
Alan Bellingham < XXXX@XXXXX.COM >writes:

>It's like wandering into a small North Oxfordshire town and seeing
>that all the inhabitants have six fingers.

Isn't Oxfordshire the place where we met some years ago? :-)
The city of Oxford itself. The city where I was born, as it happens.
Quote
And I always thought it was the C++ meeting that brought you there ...
The place to which I allude is somewhat smaller, and further to the
north. And it's a place I suspect I knew long before Andrue.
Alan Bellingham
--
ACCU Conference 2006 - 19-22 April, Randolph Hotel, Oxford, UK
 

Re:Re: Borland has broken it's promises once again

"Edward Diener" < XXXX@XXXXX.COM >wrote in message
Quote
C++ not having a reflection mechanism that is part of the language
specification makes it more difficult to implement RAD in standard C++.
It means that RAD must either be done through language extensions and/or
through extensions to a given compiler at compile time which allow the
equivalent of reflection data to be written to persistent storage and
read back again at run-time.

While I would have liked to see a run-time reflection mechanism built
into the language itself, the C++ standards committee appears to be
going in the direction of the latter method. But exactly what that is,
except for its current name, and what is being done in that regard is a
closed door to all of those who are not part of the committee. I wish
them the best but if it does not succeed by the time of the next C++
standard, I will be personally very disappointed.
Yep. I'm paying attention to this as well. It would be cool.
 

Re:Re: Borland has broken it's promises once again

"Andrue Cope [TeamB]" wrote:
Quote

Matt Jacobs wrote:

>If VCL was written in C++ it would have attracted more C++
>programmers.

It might have done. There have certainly been many people over the
years who have posted here bemoaning the use of Pascal and calling for
a C++ rewrite. It's not a group I've ever joined though :)
Actually the C++ community told Borland back in '93 that they did not want the
VCL in C++. When Borland did its market research on Delphi one of the things
they wanted to do was base it in C++, but the C++ community in that research
told them in no uncertain terms that if the framework was not straight ANSI C++
(or adhering to the current spec since the standard at that time had not been
approved) they were not interested and Borland felt they had to extend the
language to give the full RAD experience that they delivered in Delphi and BCB.
This actually follows what Borland had been told before when they dumped OWL 1.0
(non ANSI C++ framework) and re wrote it as OWL 2.0 (ANSI standard). There has
never been any evidence that not having the VCL in C++ has been a significant
detriment to the adoption of BCB.
--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Your friends will know you better in the first minute you meet than your
acquaintances will know you in a thousand years. (R Bach)
 

Re:Re: Borland has broken it's promises once again

Duane Hebert wrote:
Quote
normal c++ class. That's why you can't derive a class
from TForm and initialize it like:
MyForm(TObject *owner) : TForm(owner) ...
but have to do:
MyForm(TObjet *owner) :TForm(owner,1) ...


Here is from my code:
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner),
.a
 

Re:Re: Borland has broken it's promises once again

Duane Hebert wrote:
Quote
Actually, if you try the first form you'll get a crash
from recursion. From a c++ point of view, this doesn't
make sense.


No, you don't.
.a
 

Re:Re: Borland has broken it's promises once again

At 16:03:31, 23.11.2005, Duane Hebert wrote:
Quote

>First, there are several stages to being "created". I guess you meant
>initialization, i.e. filling the object with values. In Delphi, most

Not sure what you mean here. What stage of "created" exists
beside initialization?
Look at TObject: allocation, initialization (with 0), calling the
constructor, and AfterConstruction.
Quote

>constructors have the word "inherited" as first line, which means that
>the inherited constructor is called first, so in effect, the base
>class is "created" first. Some VCL objects use some of the earlier
>stages (which are open to the programmer, in Delphi) to do some
>trickery. This should however never cause recursion.

Check the help for TForm.
What should I be looking for? Do you mean that one should call Release
instead of Free? That is actually only necessary if you would like to
call Free from one of the message handlers of the form.
--
Rudy Velthuis [TeamB] velthuis.homepage.t-online.de
"Am I lightheaded because I'm not dead or because I'm still alive?"
-- Heidi Sandige.
 

Re:Re: Borland has broken it's promises once again

At 16:15:25, 23.11.2005, Duane Hebert wrote:
Quote
For example, I have a form. It has a parent and an owner.
In my form, I have a button. It has a parent and an owner.
I put it in an auto_ptr.
Oh, don't do that. The button is already owned by the form, and auto_ptr
would be a second owner, but without knowledge of the VCL mechanism. That
is not a problem with the Delphi language, it is a problem with how you
use the framework, i.e. the framework relies on the fact that both
parents and forms will take care of child components/controls when they
are freed.
--
Rudy Velthuis [TeamB] velthuis.homepage.t-online.de
"Ask her to wait a moment - I am almost done."
-- Carl Friedrich Gauss (1777-1855), while working, when informed that
his wife is dying