Board index » delphi » Re: Myths of our time...
Ingvar Nilsen
![]() Delphi Developer |
Ingvar Nilsen
![]() Delphi Developer |
Re: Myths of our time...2003-10-12 03:06:45 AM delphi253 Rudy Velthuis (TeamB) writes: QuoteHmmm... I usually do exactly the opposite. I only use interfaces with Ingvar Nilsen |
C4D - Kim Madsen
![]() Delphi Developer |
2003-10-12 05:23:17 AM
Re: Myths of our time...
Hi,
QuoteNot really. Like I said, doing a loop like that should always perform reallocate and copy data. This is not what the discussion is about IMO. The purpose of creating new generation of languages must be to abstract whats going on under the hood more and make things easier for developers. Thats anyway what everybody is trying to sell garbage collection on. People dont have to worry anymore about loose pointers and memory leaks. But what have been created in both Java and C# (and perhaps the underlying dotNet, although I'd think that a smart compiler should be able to solve the problem) with regards to string handling is not an abstraction that makes things easier and less errorprone. On the contrary. Many people responding on this thread have been very fast in pointing out the 'problem' in Eric's sample code, but only few seem to understand the essential, basic problem. I believe Eric is not a newbie in the world of programming, and ofcourse know how to make it perform good, also under dotNet. I have been around for many years, and know most of the inner reasons for why a compiler does what it does, how things operate etc. Thus I can also optimize stuff to run as fast as possible. But in real life, most programmers will not write super structured, super hand optimized code. Thats not what they are paid to do. They will write business code. In business code strings are used just as often as numbers, and when a programmer adds two strings, the programmer expects the compiler/framework to do just that without any severe hidden sideeffects. They have been able to do so in Cobol, Fortran, VB, Delphi, C++ and just about any other major development language for years, but suddenly now they cant without risking severe problems. -- best regards Kim Madsen XXXX@XXXXX.COM www.components4developers.com The best components for the best developers kbmMW - kbmMemTable - kbmWABD - kbmX10 |
Ingvar Nilsen
![]() Delphi Developer |
2003-10-12 06:16:02 AM
Re: Myths of our time...
C4D - Kim Madsen writes:
QuoteI believe Eric is not a newbie in the world of programming QuoteBut in real life, most programmers will not write super structured, defend this. I just have to accept it is like it is, no matter. -- Ingvar Nilsen |
Jon Shemitz
![]() Delphi Developer |
2003-10-12 06:37:20 AM
Re: Myths of our time...
"Luigi D. Sandon" writes:
QuoteIt is a much bigger overhead. Only it is hidden. I never found memory don't have to track down. If you claim you never ever spent days tracking down an "intermittent" bug that turned out to be a miscast, or a tombstoned pointer, or something of the sort, then ... I will say you're lying. -- programmer, author www.midnightbeach.com and father www.midnightbeach.com/hs |
Michael D.
![]() Delphi Developer |
2003-10-12 07:37:40 AM
Re: Myths of our time...
Ingvar Nilsen writes:
QuoteMichael D. writes: |
Michael D.
![]() Delphi Developer |
2003-10-12 08:04:42 AM
Re: Myths of our time...
Ingvar Nilsen writes:
QuoteRudy Velthuis (TeamB) writes: and how you use the interfaces |
Jon Springs
![]() Delphi Developer |
2003-10-12 09:59:20 AM
Re: Myths of our time...
"Rudy Velthuis (TeamB)" <XXXX@XXXXX.COM>writes
QuoteLuigi D. Sandon writes: solve the problem more efficiently? I think this discussion has been held in the vacuum of language centric thought patterns, not real world requirements. -----Jon----- |
Jon Springs
![]() Delphi Developer |
2003-10-12 10:17:40 AM
Re: Myths of our time...
Then how would you build the string? Especially if the contents of the
string are delivered to you one piece at a time? -----Jon----- "Rudy Velthuis (TeamB)" <XXXX@XXXXX.COM>writes QuoteColin Wilson writes: |
Frank Andreas de Groot
![]() Delphi Developer |
2003-10-12 10:35:35 AM
Re: Myths of our time...
"Jon Springs" <jspringsATjontandsheDOTorg>writes news:3f88b998$XXXX@XXXXX.COM...
QuoteThen how would you build the string? Especially if the contents of the |
Chris Burrows
![]() Delphi Developer |
2003-10-12 11:59:46 AM
Re: Myths of our time...
"Jon Springs" <jspringsATjontandsheDOTorg>writes
Quote"Rudy Velthuis (TeamB)" <XXXX@XXXXX.COM>writes isolation with no indication of the requirements of the problem that was to be solved. Some of the possible technical requirements include portability, memory efficiency, time efficiency, maintainability, reliability etc. etc. However, Rudy's response is a good example to demonstrate that amateur programmers don't need a .NET language to help them to write inefficient code. Every practical real world programming task has more than one possible solution. It is a programmer's responsibility and duty to choose the optimum solution to satisfy all of the requirements. Chris Burrows CFB Software www.cfbsoftware.com |
Rudy Velthuis (TeamB)
![]() Delphi Developer |
2003-10-12 03:49:50 PM
Re: Myths of our time...
C4D - Kim Madsen writes:
QuoteHi, QuoteBut in real life, most programmers will not write super structured, QuoteThats not what they are paid to do. They will write business code. -- Rudy Velthuis (TeamB) "Deliver yesterday, code today, think tomorrow." -- unknown |
Ingvar Nilsen
![]() Delphi Developer |
2003-10-12 04:42:22 PM
Re: Myths of our time...
Michael D. writes:
Quoteis it that "good design" mentioned a couple of posts earlier? to me Interfaces who have function scope will be freed as soon as they are not needed anymore in that function. Also simple and reliable. Sometimes you however need to create interfaces at runtime, interfaces that have no reference at design time. These need to be maintained somewhere, since the compiler is not aware of them. There is a special list, TInterfaceList or something like that that can hold them. I tend to use TList (my all time favorite) and call _Addref and then _Release until the actual interface returns zero. With a new design, I always insert debug code in the constructor and the destructor of the class implementing the interface. This is not breakpoints, instead it is a utility I wrote ages ago that posts messages to a listener application that stores all calls. I can then check that the interfaces really are freed, and that the number of destructor calls equals the number of constructor calls. I haven't stumbled into any problems whatsoever with interfaces, maybe I don't use them to the full extent. -- Ingvar Nilsen |
Luigi D. Sandon
![]() Delphi Developer |
2003-10-12 04:49:33 PM
Re: Myths of our time...QuoteIf you claim you never ever spent days tracking down an "intermittent" I know pointers are "dangerous" and use them properly. And I check code for memory leaks. In a OO program is much easier to track pointer usage than was in plain procedural programs. I am spending much more time with VCL bugs, for the matter. -- Luigi D. Sandon XXXX@XXXXX.COM |
Rudy Velthuis (TeamB)
![]() Delphi Developer |
2003-10-12 10:32:54 PM
Re: Myths of our time...
Jon Springs writes:
QuoteAnd if the only way of solving the problem, implementing the feature, QuoteI think this discussion has been held in the vacuum of language centric like StringBuilder is not "in a vaccum of language centric thought patterns" at all. These thought patterns are quite language independent, and simply constitute basic programming practice. Ignoring them is creating real world problems. -- Rudy Velthuis (TeamB) "I'm not a member of any organized political party, I am a Democrat!" -- Will Rogers (1879-1935) |
Rudy Velthuis (TeamB)
![]() Delphi Developer |
2003-10-12 10:36:34 PM
Re: Myths of our time...
Michael D. writes:
Quoteis it that "good design" mentioned a couple of posts earlier? to me it -- Rudy Velthuis (TeamB) "I still live." - Daniel Webster, dying words |