Board index » delphi » Re: Helping a kid

Re: Helping a kid


2008-05-28 09:21:20 PM
delphi122
OBones writes:
Quote
Question is, would the "kid" have been able to connect together the
components you put on the form? I mean, what you describe can be
done in VB.Net as well, with next to no code at all.
Exactly. I am sure in the hands of a developer proficient with VB.Net,
the same "wow" result could be achieved.
I'm no fan of MS or the .Net product line, but I am not sure this
illustrates anything more than "experience counts".
However, his observation about the performance of .Net vs native Win32
is accurate.
--
Kevin Powick
 
 

Re: Helping a kid

Scout writes:
Quote
I'm a bit stunned at the outcome.

The kid had written masses of code to make his project work. There
was the odd typo that I helped him to fix, but he was getting really
pissed off at how difficult it was to write computer programs.
Actually, I think he was losing interest in even trying.

I discovered the same thing while trying to port one of my apps to C#.
When it got down to doing the database parts it was taking FAR longer to
do in C#, and some of the functionality I had in Delphi(with very little
coding) was very difficult to replicate in C#. I got about 50% through
the port and decided to do the version 2.0 in Delphi and I am glad I
did. The whole reason for the C# port was to get Unicode support, but
with Delphi 2008 coming I am not worried about that now.
From my experience C# and the other .net languages are great for
console type applications, but for Desktop apps, winforms really sucks.
Somethings in C# are easier to do because MS has included everything but
the kitchen sink in the framework, but when it comes right down to it
Delphi is still better overall for Desktop Applications and was able to
do many of the "New" things VS does back in 1995.
After working with .net for about 3 months doing that port I can say I
KNOW Delphi is better.
 

Re: Helping a kid

OBones writes:
Quote
Question is, would the "kid" have been able to connect together the
components you put on the form?
I mean, what you describe can be done in VB.Net as well, with next to no
code at all.
Yes, but you can not do it the same way, in VB.net/C# you have to use
design time wizards and it then generates a {*word*99}load of code, you don't
get any live design time data like you do in Delphi, and most of those
wizards only work if your ADO.net data provider has a special interface
for them.
For example if you use the .net data provider for PostgreSQL you get
none of that GUI wizard stuff and have to code everything by hand.
Visual Studio is nice, but it is not all that it is hyped to be.
 

Re: Helping a kid

Tony Caduto writes:
Quote
OBones writes:

Yes, but you can not do it the same way, in VB.net/C# you have to use
design time wizards and it then generates a {*word*99}load of code, you don't
get any live design time data like you do in Delphi, and most of those
wizards only work if your ADO.net data provider has a special interface
for them.

Nope, you don't have to use these wizards. Frankly, I find these wizards are *{*word*99}*.
If you want to create a typed DataSet, just create a DataSet file and drag your tables from the
server explorer.
You probably have at least an ODBC/OLEDB connector for pgSQL. Maybe, there's even a DDex provider for
pgSQL.
After you have the dataset defined. You can just design against it and provide the data when you see
it fit, from where you see it fit.
*But*, I really *hate* working with DataSets (especially in .Net). They are slow and weird, compared
to real instances.
I prefer having my classes and use them as data sources. (Data\Show Datasources\Add object data source)
Using classes as data sources in design time is IMO one of the highlights of VS2005 vs VS2003, yet a
lot of people haven't even heard about it...
 

Re: Helping a kid

Scout writes:
Quote
My business partner's son came into the office today looking for help
with his computing project homework.

The school is teaching kids how to write computer programs using
VB.Net

I know next to nothing about VB, but figured I might be able to help
by showing him how I'd do the same project in Delphi, and then we
could compare notes.

I'm a bit stunned at the outcome.

The kid had written masses of code to make his project work. There
was the odd typo that I helped him to fix, but he was getting really
pissed off at how difficult it was to write computer programs.
Actually, I think he was losing interest in even trying.

I fired up Delphi and used the form designer to produce much the same
stuff that he had spent weeks trying to create. Then I added some db
components, a TTable, a TDataSource, a TDBNavigator and some TDbEdits.

I set the properties like the color of the form, the font styles for
the labels so that they matched what the VB(Visual Basic) program was supposed to do,
and the display formats for the fields, then hit the run button.

Of course, the program just ran and worked with live data.

I hadn't written a single line of code.

The kid couldn't believe it. He had heard that Delphi might be a bit
better thsn VB(Visual Basic) for creating programs, but had no idea that it was SO
MUCH better.

Another comment that he made was that the Delphi program was much more
responsive than his VB(Visual Basic) effort.

Now we all know that Delphi ia cool, and that a simple db-aware
program requires almost no work at all, but it is still very nice to see
a complete newbie to computers appreciating that Delphi is way ahead of
what they are being taught in school.



This matches some of my experience. A lot of their methodology just
leaves me befuddled. I have produced working programs in VB(Visual Basic) -- but it
seems like too much effort for too little gain -- at least compared to
Delphi.
Working with MS products make me think of coding in dBase (I) -- which I
quickly abandoned.
--
Will R
PMC Consulting
 

Re: Helping a kid

"Scout" <XXXX@XXXXX.COM>writes
Quote
The kid couldn't believe it. He had heard that Delphi might be a bit
better thsn VB(Visual Basic) for creating programs, but had no idea that it was SO
MUCH better.
That's "kid vs programmer", not "VB vs Delphi". A good test would be to put
some experienced VB(Visual Basic) and Delphi programmers side by side and give them
several programming tasks to complete. My guess would be that VB(Visual Basic) is better
at some tasks, Delphi at others, both suck at some tasks and both perform
well in some others.
 

Re: Helping a kid

Uffe Kousgaard writes:
Quote
"Tony Caduto" <XXXX@XXXXX.COM>writes
news:483d7431$XXXX@XXXXX.COM...
>Visual Studio is nice, but it is not all that it is hyped to be.

Nonsense, we all know the grass is greener on the other side :-)


It's greener until you get to the other side,then it becomes sort of a
dull green :-)
 

Re: Helping a kid

Robert Giesecke writes:
Quote

Using classes as data sources in design time is IMO one of the
highlights of VS2005 vs VS2003, yet a lot of people haven't even heard
about it...
I never did it that way because the ODBC driver is lacking compared to
the PGSQL, so the server explorer never worked for me, so I could never
use those features. They are still highly dependent on that server
explorer, so basically if you use a DB MS does not approve of you are
out of luck.
The design time stuff in Delphi just works.
 

Re: Helping a kid

Robert Giesecke escribi?
Quote

No!
I did mean just plain classes.
You can hook them up and bind them directly to the UI, at design time.
In code, you just your ORM of choice or something homebrewn.

Robert, I use an in house ORM and Model-To View framework and I am trying
to acomplish the same design time behavior with Delphi Win32 (I'm sure
it can be done). Can you point me to some examples / tutorials of that
stuff in Visual Studio, just to see how it works?
Leonardo M. Ram?
leonardorame.blogspot.com
 

Re: Helping a kid

Thanks Robert!, now I will have to figure out how to reproduce that using
Delphi Win32.
Leonardo M. Ram?
leonardorame.blogspot.com
Robert Giesecke escribi?
Quote
Leonardo M. Ram?writes:
>Robert Giesecke escribi?
>>
>>No!
>>I did mean just plain classes.
>>You can hook them up and bind them directly to the UI, at design time.
>>In code, you just your ORM of choice or something homebrewn.
>>
>
>Robert, I use an in house ORM and Model-To View framework and I am trying
>to acomplish the same design time behavior with Delphi Win32 (I'm sure
>it can be done). Can you point me to some examples / tutorials of that
>stuff in Visual Studio, just to see how it works?
>

No need to read yourself through tons of pages, it is quite easy, actually.

Just add a new class to your Winforms app.
type
Person = public class
public
property Firstname : String;
property Lastname : String;
end;

Now, compile it, so that the IDE can grab the type infos.

Open your form designer and open menu/data/add data source.
In the dialog choose "Object" and in the next page, drill down until you
find your class.

You should see it now in the data sources view.
Drag it onto your Form and you get a DataGridView that is already setup
to a BindingSource and Navigator.
You can drag single properties like Firstname onto the form as well,
they get bound to the same BindingSource.

At runtime, you can provide your own data by setting the bindingsource's
DataSource, or just use the default one.
 

Re: Helping a kid

Tony Caduto writes:
Quote
Robert Giesecke writes:

>No!
>I did mean just plain classes.
>You can hook them up and bind them directly to the UI, at design time.
>In code, you just your ORM of choice or something homebrewn.
>
>And I did mean using just a plain ODBC connection in server explorer
>so that you get a datatable definition. You do not have to fetch the
>data with it.
>

I didn't know you could do that. Do you know of any links for docs or
samples?
I don't know any of them. This is what my first google query returned:
www.codegod.de/WebAppCodeGod/objectdatasource-and-idataerrorinfo-with-winforms-AID427.aspx
And a presentation
download.microsoft.com/download/8/e/7/8e725d96-7ec3-498b-9fa7-86779aed101f/Winforms%202.0%20Databinding.ppt
Sorry, gotta run right now...
 

Re: Helping a kid

"somebody"
Quote
My guess would be that VB(Visual Basic) is better
at some tasks, Delphi at others, both suck at some tasks and both perform
well in some others.
I wonder, what are those tasks which VB(Visual Basic) is better than Delphi?
 

Re: Helping a kid

Now you're getting into a fairly core question:
What's Programming?
Quote
I hadn't written a single line of code.
So, were you programming or not?
What was the kid trying to learn?
What was his actual assignment?
FWIW, a lot of our "cool" stuff is
design-time-connect-the-dots.
However, our *valuable* stuff (what people pay for) is in
code.
Dan
"Scout" <XXXX@XXXXX.COM>writes
Quote
My business partner's son came into the office today
looking for help
with his computing project homework.

The school is teaching kids how to write computer
programs using
VB.Net

I know next to nothing about VB, but figured I might be
able to help
by showing him how I'd do the same project in Delphi,
and then we
could compare notes.

I'm a bit stunned at the outcome.

The kid had written masses of code to make his project
work. There
was the odd typo that I helped him to fix, but he was
getting really
pissed off at how difficult it was to write computer
programs.
Actually, I think he was losing interest in even trying.

I fired up Delphi and used the form designer to produce
much the same
stuff that he had spent weeks trying to create. Then I
added some db
components, a TTable, a TDataSource, a TDBNavigator and
some TDbEdits.

I set the properties like the color of the form, the font
styles for
the labels so that they matched what the VB(Visual Basic) program was
supposed to do,
and the display formats for the fields, then hit the run
button.

Of course, the program just ran and worked with live
data.

I hadn't written a single line of code.

The kid couldn't believe it. He had heard that Delphi
might be a bit
better thsn VB(Visual Basic) for creating programs, but had no idea that
it was SO
MUCH better.

Another comment that he made was that the Delphi program
was much more
responsive than his VB(Visual Basic) effort.

Now we all know that Delphi ia cool, and that a simple
db-aware
program requires almost no work at all, but it is still
very nice to see
a complete newbie to computers appreciating that Delphi is
way ahead of
what they are being taught in school.



 

Re: Helping a kid

Robert Giesecke writes:
Quote
I prefer having my classes and use them as data sources. (Data\Show
Datasources\Add object data source)

Using classes as data sources in design time is IMO one of the
highlights of VS2005 vs VS2003, yet a lot of people haven't even heard
about it...
I also prefer using Classes as DataSource in VS. But such a thing just
does not exist in Delphi. I think it is a sore spot in case of Delphi.
And Live Data is just useless as far as I am concerned.
And finally in VS one can easily see live data in Data Explorer. Why
should one need to populate controls with data at design time. It is absurd.
Regards,
Yogi Yang