Re: About speed



In article <9g6u92hhinnb1hcoi5gtudtoam5ukkqsq9@xxxxxxx>,
barry.j.kelly@xxxxxxxxx says...

Jolyon Smith <jolyons@xxxxxxxxxxxxxxxxxxxxxx> wrote:

Surely it's not .Net that makes it so easy, it's the framework. If
there were VCL equivalents to the framework classes you are using, it
would be just as easy.

There's two things in the sample: the .NET framework libraries, and the
C# 2.0 language. The fact that the libraries are there in the box, as it
were, means that you've got documentation, support online, a Google-able
resource etc. I don't want to start some fight between Delphi's VCL and
.NET, though.

Fair enough - but by definition delegates are only useful if you use an
approach that uses delegates. I'm just pointing out that you don't have
to use delegates and that that doesn't preclude an elegant and simple
solution (and in fact, is potentially even more so):


btnDownload.On_Click.Add(DownloadInBackground);


procedure TSomeForm.DownloadInBackground(Sender: TObject);
var
tsImageDownload: TImageDownloadThread;
begin
ThreadPool.CreateThread(TImageDownloadThread, tsImageDownload);

tsImageDownload.URL := self.URL.Text;
tsImageDownload.Target := self.Image;
tsImageDownload.On_Complete := ShowImage;
tsImageDownload.On_Exception := HandleThreadException;

ThreadPool.Execute(tsImageDownload);
end;


A huge advantage here (imho) is that the tsImageDownload thread spec
class is re-usable, extensible and potentially polymorphic. In this
case the Target is a TImage, but it could be a TStream.

Ok, a lot of complexity is hidden by this example, but the same is true
of a .net framework based approach. Maybe I can't google or F1 for this
approach, but I do have complete source code.

;)


The way C# anonymous delegates work, with variable capture, is harder to
reproduce.

But you don't necessarily need to reproduce it - just find an
alternative that doesn't need it.


Check out what the code snippet's anonymous delegates are
actually doing. It's not trivial without language support.

Unless I've missed something it's just an alternative to passing
parameters no?


I have had to
keep some aspects of GC behaviour in mind when designing some data
structures and algorithms, but on the whole, I've never "come stuck"
because of GC.

Hmmm. Here-in lies the danger as I see it. For yourself this is no
great problem - you have lived in both GC and non-GC worlds, and know
the pitfalls and advantages of both and how to avoid/deal with them.

Now roll forward a few years, and imagine a team comprised of people who
have only ever known GC. Now present them with a memory and CPU bound
process that is suffering greatly with GC issues.

Then retreat to a safe distance.

;)


I don't think unmanaged code is dead. In talking about the virtues of
managed code, I'm not saying that I think unmanaged code is necessarily
inferior or unworthy of strong ongoing Delphi support, for example.

Unmanaged code is more flexible, by definition. Whilst it cannot
leverage some of the benefits of the managed environment, neither is it
constrained by it.

<shrug>

I have recently seen .net likened to the VB runtime - vbrunXXX.dll made
developing VB apps very quick and very easy. It required that the
runtime be available on the machines that wanted to run those
applications, which was initially a problem, but not once the required
runtime support became a standard part of Windows.

A lot of people thought that one day all business applications would be
built in VB, with only lower level coding requiring the power of C++.

Sound familiar?

We've been here before.

This road is well travelled, and has yet to ever actually take us to
where the roadmap-makers think it will.


So, on the whole, I think that the days of business developers writing
business rules in unmanaged languages are numbered. Where the line gets
drawn after that is yet to be seen.

Deja vue all over again.

I seem to remember that applications would one day be built not by
programmers, but by business people. "Programmers" would be required
only for producing the low level components and glue, to provide the
necessary building blocks for non-programmers to assemble their
applications from, applying their business knowledge to create solutions
most appropriate for them, without requiring programming knowledge or
skills.

And now, a few years later, once the executives that fell for it the
first time around have either forgotten or moved on, the software
industry is flogging the same old dead horse.

It's a cyclical thing. We'll no doubt be having the same discussion in
another 10 years or so, when .net has long since been forgotten and the
next big thing to make programming a non-technical exercise is being
peddled to a whole new generation of executives who would like to
believe that their IT department is an unnecessary expense.

+0.02


--
Jolyon Smith
.



Relevant Pages

  • Re: D3 Connectivity Demos Download
    ... I think technical options need to be known before business solutions can ... Funny you should mention Ruby on Rails, one of the world experts comes ... How does someone even guess at a framework when the concept doesn't ... Are there any platform requirements or restrictions for a web server ...
    (comp.databases.pick)
  • Re: [newbie] Which framework for business apps?
    ... I'm only starting to look at how to write business apps as web ... we have a framework that is solidly business-oriented. ... Our Andromeda framework may be what you are after. ... Database building and upgrading, ...
    (comp.lang.php)
  • Re: Consolidating java objects
    ... I would try an approach where you try to elicit the real framework information from the programmers, perhaps by a couple of meetings or coffee break chatting, or something. ... way to compare all of these objects to see what is similar. ... different packages it is unbelievable. ...
    (comp.lang.java.programmer)
  • Re: What Borland should stop wasting their time on
    ... The framework has a lot of promise, but I think Microsoft was far too ambitious releasing far too many assemblies much too quickly. ... As a result design suffered, but to provide backward compatibility, Microsoft could not simply redesign the whole library and deprecate the old one. ... C/C++ programmers are on a different league as .NET. ... This concept is pioneered by Delphi and Java. ...
    (borland.public.delphi.non-technical)
  • Re: Simple 2D framework
    ... that is something that does worry me. ... Which proves you are far far from a beginner and therefore very able to make ... The other thing I am noticing is that a lot of .Net programmers rely on this ... If only the framework was better documented..... ...
    (microsoft.public.win32.programmer.directx.managed)