BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

What kinds of BCB limitations to avoid?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Non-Technical)
View previous topic :: View next topic  
Author Message
Randall Parker
Guest





PostPosted: Fri Oct 24, 2003 11:02 pm    Post subject: What kinds of BCB limitations to avoid? Reply with quote



I'm coding away furiously to make some existing BCB apps more capable
and using BCB v6 sp4. The apps are growing in the number of lines of
code and in complexity. I'm using STL containers more in place of some
older simpler template libs. I'm adding more methods, classes, forms,
dialogs, controls on forms, et cetera.

What I'm wondering is what sorts of coding styles make one more likely
to hit against bugs in the compiler and linker. Anyone have useful tips
on what to avoid doing when possible in order to avoid hitting problems?

Does anyone have an idea of approximately how big a BCB app has to get
before hitting problems? Number of classes? Number of forms? Number of
VCL controls or STL containers?

Is STL dangerous in general or are there specific ways of using it that
put you more at risk?

I'm already doing one weird incantation: I can avoid certain kinds of
internal errors on starting up BCB by first compiling a single unit. If
I immediately try to do a make I get internal errors about half the time
and it takes me to some source code lines that were generated by Borland
(will make note of the lines next time I hit this problem). If I compile
a single unit first then I don't hit that problem. No idea why.

Back to top
Rodolfo Frino
Guest





PostPosted: Sun Oct 26, 2003 11:26 am    Post subject: Re: What kinds of BCB limitations to avoid? Reply with quote



Quote:
Is STL dangerous in general or are there specific ways of using it that
put you more at risk?

Nothing is dangerous if you use it properly. :-)


"Ok, I understand what virtual reality is, but, can someone explain to me

what is reality?" (Unknown android)

Rodolfo





Back to top
Andrue Cope
Guest





PostPosted: Mon Oct 27, 2003 8:33 am    Post subject: Re: What kinds of BCB limitations to avoid? Reply with quote



Randall Parker wrote:

Quote:
I'm already doing one weird incantation: I can avoid certain kinds of
internal errors on starting up BCB by first compiling a single unit.

Here's another:When reopening a project wait a few seconds before
closing down any edit buffers. When closing down lots of edit buffers
don't close them all down in one long run. Close them two or three at a
time and give the IDE a break in between.

--
Andrue Cope
[Bicester, UK]

Back to top
Marcelo R. Lopez, Jr.
Guest





PostPosted: Mon Oct 27, 2003 3:54 pm    Post subject: Re: What kinds of BCB limitations to avoid? Reply with quote

"Rodolfo Frino" <rodolfowrvxg527u7qfrino (AT) yahoo (DOT) com.jki> wrote

Quote:
Is STL dangerous in general or are there specific ways of using it that
put you more at risk?

Nothing is dangerous if you use it properly. :-)

Yeah, tell this to North Korea, and substitute the phrase "Weapons Grade

Plutonium" instead of STL.
C'mon, get real.




Back to top
Andrue Cope
Guest





PostPosted: Mon Oct 27, 2003 4:24 pm    Post subject: Re: What kinds of BCB limitations to avoid? Reply with quote

Rodrigo Gómez wrote:

Quote:
List index out of bounds anyone? Wink

That and an AV in COREIDE.DLL or whatever it's called :(

--
Andrue Cope
[Bicester, UK]

Back to top
Rodolfo Frino
Guest





PostPosted: Mon Oct 27, 2003 10:23 pm    Post subject: Re: What kinds of BCB limitations to avoid? Reply with quote

We are talking about *software*, not about weapons. If you don't use the STL
properly
you could get into trouble, such as undefined behaviour, program crash,
wrong results, etc.
But that is applicable to almost all programming languages to certain degree
(without using the STL,
or those that do not have the STL)

Of course if you hit a bug your program could crash or give you wrong
results or unwanted behaviour,
but these are special cases. In general if you know how to use the STL, you
the risk is either very small or
zero compare to the benefits it will bring you.

Rodolfo


"Marcelo R. Lopez, Jr." <mlopez (AT) voicerite (DOT) com> wrote

Quote:
"Rodolfo Frino" <rodolfowrvxg527u7qfrino (AT) yahoo (DOT) com.jki> wrote in message
news:3f9baf58$1 (AT) newsgroups (DOT) borland.com...
Is STL dangerous in general or are there specific ways of using it
that
put you more at risk?

Nothing is dangerous if you use it properly. :-)

Yeah, tell this to North Korea, and substitute the phrase "Weapons Grade
Plutonium" instead of STL.
C'mon, get real.






Back to top
AlisdairM
Guest





PostPosted: Tue Oct 28, 2003 2:15 am    Post subject: Re: What kinds of BCB limitations to avoid? Reply with quote

Randall Parker <STOPtechiepundit (AT) EVILfuturePOXpunditSPAM (DOT) com> wrote in
news:3f99ae98$1 (AT) newsgroups (DOT) borland.com:

Quote:
What I'm wondering is what sorts of coding styles make one more likely
to hit against bugs in the compiler and linker. Anyone have useful tips
on what to avoid doing when possible in order to avoid hitting problems?

Limit your use of borland extensions to the minimum. Eg __property can
introduce odd problems if your class does not derive from TObject,
__finally is not clear in all circumstances.

Ideally, avoid extensions entirely unless they become necessary.
'Necessary' usually means you are already deriving from a VCL class
(typically TForm) in which case embrace them wholeheartedly, as they work
very well in concert.

In all cases avoid using OnCreate/OnDestroy events, as these occur at
strange times in the object lifetime.

Quote:
Does anyone have an idea of approximately how big a BCB app has to get
before hitting problems? Number of classes? Number of forms? Number of
VCL controls or STL containers?

Application size is not a great problem for us any more. Up until BCB6 SP2
there was a problem when the debugger file (.tds) grew bigger than 32Mb.

We use over 100 forms in our large apps, and .tds files approaching 50Mb.
We have over 1,000,000 lines of code, but have broken that into many .lib
projects.

Quote:
Is STL dangerous in general or are there specific ways of using it that
put you more at risk?

STL is your friend. Once you understand and use it well your code will be
much clearer to read.

STL is also the debuggers foe :¬ ( It can be quite hard to inspect the
state of the program when all your data is stored in STL containers. I
believe this pays for itself with the simplified code though.

Quote:
I'm already doing one weird incantation: I can avoid certain kinds of
internal errors on starting up BCB by first compiling a single unit.

We still occasionally hit wierd linker errors. When this happens we close
BCB, delete all precompiled headers, linker files and .obj files. Then
restart BCB. This usually fixes our problems.
Failing that, check all libraries used to build the .EXE project use
identical project options. Not required but helpful.
NEVER enable inline functions as an optimisation. Been bitten by too many
code generator bugs.
Build everything as monolithic .EXEs without any DLL dependencies (beyond
Windows itself) Never enable packages/dynamic RTL. Although these can be
used, there are fewer problems to master if you simply avoid them.
If you make any changes to project files outside the IDE (such as
synchronizing with your CVS) you will not see these changes until you
restart BCB.

AlisdairM

Back to top
Chris Uzdavinis (TeamB)
Guest





PostPosted: Tue Oct 28, 2003 2:54 pm    Post subject: Re: What kinds of BCB limitations to avoid? Reply with quote

AlisdairM <no (AT) more (DOT) swen.please> writes:

Quote:
Is STL dangerous in general or are there specific ways of using it
that put you more at risk?

STL is your friend. Once you understand and use it well your code
will be much clearer to read.

STL is also the debuggers foe :¬ ( It can be quite hard to inspect
the state of the program when all your data is stored in STL
containers. I believe this pays for itself with the simplified code
though.


....Unless you can write a debugger "inspector" plug-in for the various
containers in the STL. If the debugger worked with such a plug-in and
the vendor supplied inspectors for the "stock" stl, then wouldn't that
be nice? Whenever you look at a vector, for example, your inspector
would be used and could show the vector in a reasonable representation.

Maybe this will be possible someday... :)

--
Chris (TeamB);

Back to top
Andrue Cope
Guest





PostPosted: Tue Oct 28, 2003 3:25 pm    Post subject: Re: What kinds of BCB limitations to avoid? Reply with quote

Chris Uzdavinis (TeamB) wrote:

Quote:
Whenever you look at a vector, for example, your inspector
would be used and could show the vector in a reasonable
representation.

Maybe this will be possible someday... Smile

Oink, oink. Flap flap :)

--
Andrue Cope
[Bicester, UK]

Back to top
Hendrik Schober
Guest





PostPosted: Tue Oct 28, 2003 4:29 pm    Post subject: Re: What kinds of BCB limitations to avoid? Reply with quote

Chris Uzdavinis (TeamB) <chris (AT) uzdavinis (DOT) com> wrote:
Quote:
[...]
Maybe this will be possible someday... Smile


You can customize VCto do this
up to a certain point.

Schobi

--
[email]SpamTrap (AT) gmx (DOT) de[/email] is never read
I'm Schobi at suespammers org

"And why should I know better by now/When I'm old enough not to?"
Beth Orton



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Non-Technical) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.