 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Randall Parker Guest
|
Posted: Fri Oct 24, 2003 11:02 pm Post subject: What kinds of BCB limitations to avoid? |
|
|
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
|
Posted: Sun Oct 26, 2003 11:26 am Post subject: Re: What kinds of BCB limitations to avoid? |
|
|
| 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
|
Posted: Mon Oct 27, 2003 8:33 am Post subject: Re: What kinds of BCB limitations to avoid? |
|
|
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
|
Posted: Mon Oct 27, 2003 3:54 pm Post subject: Re: What kinds of BCB limitations to avoid? |
|
|
"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
|
Posted: Mon Oct 27, 2003 4:24 pm Post subject: Re: What kinds of BCB limitations to avoid? |
|
|
Rodrigo Gómez wrote:
| Quote: | List index out of bounds anyone?
|
That and an AV in COREIDE.DLL or whatever it's called :(
--
Andrue Cope
[Bicester, UK]
|
|
| Back to top |
|
 |
Rodolfo Frino Guest
|
Posted: Mon Oct 27, 2003 10:23 pm Post subject: Re: What kinds of BCB limitations to avoid? |
|
|
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
|
Posted: Tue Oct 28, 2003 2:15 am Post subject: Re: What kinds of BCB limitations to avoid? |
|
|
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
|
Posted: Tue Oct 28, 2003 2:54 pm Post subject: Re: What kinds of BCB limitations to avoid? |
|
|
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
|
Posted: Tue Oct 28, 2003 3:25 pm Post subject: Re: What kinds of BCB limitations to avoid? |
|
|
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...
|
Oink, oink. Flap flap :)
--
Andrue Cope
[Bicester, UK]
|
|
| Back to top |
|
 |
Hendrik Schober Guest
|
Posted: Tue Oct 28, 2003 4:29 pm Post subject: Re: What kinds of BCB limitations to avoid? |
|
|
Chris Uzdavinis (TeamB) <chris (AT) uzdavinis (DOT) com> wrote:
| Quote: | [...]
Maybe this will be possible someday...
|
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 |
|
 |
|
|
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
|
|