Solved

Delphi 'Robustness' - Larger Apps ?

Posted on 2004-10-13
9
239 Views
Last Modified: 2010-04-05
Let me start by saying that I LOVE Delphi, having used it since version 1.0, though must also confess that I'm a part-time programmer who has largely worked on my own ...

I have a project that 'growed', now has well over 100 pages of code, this is in some 16 units.  For the most part this has gone pretty smoothly ...  However, recently I've noticed the occasional spot of unusual behaviour.  For example, last week when running from the IDE the program would stop at a certain line of code as if a break point was set there (it wasn't), doing a full build didn't change it, & it persisted on & off for a few days.   The solution - I simply swapped the 6-8 line block of code with the following block of code (fortunately in this situation it didn't matter the order) and the problem went away.   Another situation I had a problem that worked OK when running the exe but not when running from the IDE.   I think there might have been one or two other instances which I've forgotten the detail of ...

Is there some sort of 'ceiling' above which the compiler becomes less robust ?   Has anyone else experienced this sort of thing (that they couldn't explain) ?    

( BTW, I'm using D6, though I have D7 (&D8) I started this project with D6 & have stuck with this )

Comments appreciated.
Geoff
0
Comment
Question by:geoffdb
9 Comments
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 12296819
All I know is that the bigger the project, the more bugs it will have... :-)
The Delphi IDE might sometimes remember old breakpoints and unfortunately, in the Windows API the Microsoft developers included a few hard-coded breakpoints. It could be related to anything. I recently had a nasty bug to solve in a small console application. It kept raising a runtime error 207 and I just didn't understand why. But it was a simple bug that resulted in a division by 0 sometimes. :-) It could be that there's a bug in that part of code.
It sometimes also helps to turn off optimization. Optimization can inprove performance quite a bit sometimes but it could also introduce some unexplainable problems.
0
 
LVL 6

Accepted Solution

by:
david_barker earned 125 total points
ID: 12296841
For your breakpoint problem, this is fairly common.
Go to View -> Debug Windows -> Breakpoints and delete any "orphan" breakpoints.
For the question of "robustness", I don't think, by experience, this has anything to do with the size of your program.
100 pages of code, at 70 lines per page is 7,000 lines. I have Delphi applications with over 50,000 lines, and yes, Delphi somethings crashes, but it does also with much much smaller apps.
Stick to Delphi, you've got the best RAD product around !
0
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 12297053
about the exceptions ... I had this with a project ot 400 000 lines of code. It stopped on about 20 points without breakpoint...  I don't know why. Then a friend of mine told a trick which helped.

Delphi call breakpoint by :

  asm
    int 3;
  end;

  put is somewhere in the "beginning" of your project, for example in the DPR after begin. When Delphi stops there - CTRL + F2 to terminate the session and run again. This time it should be fine...
0
 
LVL 6

Expert Comment

by:Sergio_Hdez
ID: 12305898
I work several hours a day on a project that already has 464 forms and about another 70 code only units... it compiles smothly and I have never have the feeling of reaching any limit in Delphi7. May be some problems from time to time as mentioned, usually when debugging DLLs, but the average workday with delphi includes no errors at all... more oftenly it is windows explorer that will hang ;-)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 14

Expert Comment

by:DragonSlayer
ID: 12306401
464 forms? ... that's... scary.
0
 
LVL 6

Expert Comment

by:Sergio_Hdez
ID: 12306715
DragonSlayer, 464 is a lot, BUT 90% of them use "visual inheritance", so there is "base form", with two more inherited forms (grid and record views of DB data tables), so most of those final forms have almost no code inside... anyhow, it a BIG app (6.33 Mb uncompressed).
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 12310449
ah... then in that case, that's not *too* many forms, hehehehe...

As for me, nowadays I'm using a slightly different method to re-use similar forms... e.g. for a form that displays some query results... let's say 1 for Customer query, the other (which looks similar, except for, perhaps the form caption and the ListView columns... and the query itself, of course) a let's say, Inventory query.

So I would design a form, with the ListView and everything there.

and in that form, I will make some procedures such as

procedure DoShowCustomer(AOwner: TComponent; const sCaption: string);
procedure DoShowInventory(AOwner: TComponent; const sCaption: string);

and in the procedures, the columns for the form will be dynamically created, the query, caption, etc will be done dynamically too.
0
 
LVL 6

Expert Comment

by:Sergio_Hdez
ID: 12316695
This method you use is "obsolete"... imagine a TGenericShowRecord(sender) derived from a plain TFom, with a DoShowRecord method that show all the fields of the table (you just set a SQL property with the table stuff) but that is usually overloaded in most of your forms (let's say you have 200 forms to show 200 types of records)... if you play well with properties and method, you can finally have a TFromCustomer with just 10 lines of code in... the rest is common for all the Forms!

For instance, after having all those froms running, we added a new "Print Form" button to ALL of the 200 forms in 5 minutes... just added it to the generic form... THIS is powerfull! Thanks god we discovered it before coding this app!!!!!
0
 

Author Comment

by:geoffdb
ID: 12326515

>> [David] Stick to Delphi, you've got the best RAD product around !
Yes, while I've always thought that, my range of (tools) experience has been rather limited.   I got a bit caught many years ago with a largish project using C  ... but that's another story.

I was just concerned, as I can see quite a bit more time & effort going into this app, I did a count today and in fact I'm much closer to 200 pages of code than the 100 guessed at above - and that's in the main executable !!   So your collective assurances - and the explanation of the break point issue makes me much more comfortable.

The other thing that gave (and gives) me some cause for concern is the 'help' Delphi gives to hackers in terms of the function names being stored directly in the executable (refer http://www.inner-smile.com/nocrack.phtml, "Special on Delphi Reverse engineering").  

How have other people handled this ??.   OK, you don't use obvious names for "Password_Check" routines, etc, but it seems that hackers get a jolly good jump start whatever you do.  

Comments ?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now