Fully Working Examples

T

Tom

By my estimate, greater than 90% of the online doco code does not work
without additional coding effort. Fully working solutions are
invaluable for the student. A guru's work measured in minutes can take
a newb ages to duplicate. Imagine the improved teaching efficiency of
being able to direct someone to a working solution! Gurus would not
have to teach the same lesson repeatedly and their work would be more
persistent.

A picture is worth 1,000 words and a working solution that teaches is
worth a million!

How can this need for more fully working solutions be met?

The help provided within this group is amazing. The brain power in
here is immense. The knowledge transfer efficiency is lacking because
there are an infinite number of ways for a newb to falter when
starting from blocks of code that are not fully functional.

The only explanation to this dilemma that I can fathom is the problem
of malicious code being included in solutions. Oh how the power of the
evil wins all to often!
 
F

Family Tree Mike

Tom said:
By my estimate, greater than 90% of the online doco code does not work
without additional coding effort. Fully working solutions are
invaluable for the student.

I would say that 99% of the online docs code does not work without addtional
coding effort to build a product. Keep in mind though, that is not the
purpose for the most part, of these types of docs. The docs are to show
examples of classes and methods, and how they are to be used. Its similar to
showing someone how to use a hammer and a nail, but not giving them details
to build a house versus a table.
 
S

Stephany Young

I certainly empathize with your frustration.

However, having first hand experience as a teacher, I can categorically
state that most students will, when presented with a fully-working example,
will tend to copy-and-paste the example without bothering to dissect the
example and understand what the code is actually 'doing'.

Certainly some, generally those who genuinely want to learn, do make the
effort to understand the code before attempting to use it.

It's a matter of finding the happy-medium, and the concept of you can't make
everyone happy all of the time comes into play.

Generally the purpose of an example is to point you in the right direction
rather than to hand you the answer on a plate. Unfortunately there are a lot
of examples that do neither.
 
B

BobF

codeproject.com is your friend


Stephany Young said:
I certainly empathize with your frustration.

However, having first hand experience as a teacher, I can categorically
state that most students will, when presented with a fully-working
example, will tend to copy-and-paste the example without bothering to
dissect the example and understand what the code is actually 'doing'.

Certainly some, generally those who genuinely want to learn, do make the
effort to understand the code before attempting to use it.

It's a matter of finding the happy-medium, and the concept of you can't
make everyone happy all of the time comes into play.

Generally the purpose of an example is to point you in the right direction
rather than to hand you the answer on a plate. Unfortunately there are a
lot of examples that do neither.
 
T

Tom

Bob >> Thanks for the codeproject.com suggestion !!

I looked it over briefly and its a definite winner. I'll dig it plenty
for sure. :)

Some additional "Fully Working Examples" thoughts >>

For brevity and not getting lost in the forrest ... partial coding
snips do have purpose. A LOT of purpose. But do they really work? When
I try to implement them I get hours of frustration and very often NO
success. How discouraging!!

I suggest that the MS doco should snip all they want but ALWAYS give a
link to the complete and fully functional program than contains the
code. The smaller the better ... but provide a stable starting point
for us struggling to learn.

In the past 72 hours I've been struggling with two clips dealing with
binding and DataGridView. With help from Marc I managed to get
BindingList to work ... but IBindingList and DataTable are causing me
headaches. Heck, without Marc's help I'd still be stuck trying to get
List to work. Or maybe I'd have gone back and tried some more on
ArrayList? My point is this binding stuff is darn tricky and my texts
don't cover it very well. Seems the focus is on data base usage and
XML I/O. That's good stuff for sure. But there are needs for locally
generated data binding without the XML layer. IBindingList doco makes
it sound like the cat's meow for DataGridView ... but just give it a
try on a non well established database data format. If you have no
problems ... I salute you!! Even if you have database usage needs and
access to a database for learning purposes ... the examples in the
doco are incomplete. Thus you really know your stuff, or you are in
for some pain. :(

If you are coaching a football team ... don't you provide the play
book to the team members? Or do you tell them you have some good plays
and here's some of the aspects but I can't be bothered to show you all
the details? HA!! Give me a working starting point and let me learn by
experimenting. Please!!! No example program is going to meet my exact
needs ... so the fear of a student cutting and pasting without
studying the code seems a bit like an excuse for the way things are.
I'm not asking for a play book with every play ever conceived ... just
a reasonably solid set would be a tremendous improvement.

Here's a goal >> 90% of the snips linked to fully working solutions.
After all, somebody did test them? Right? Come on Coach MS ... don't
call two times outs on us again, everyone makes mistakes but we little
guys that can't afford enterprise level applications need better
support.

Whew, I vented ... but I don't feel the least bit better. I know my
struggles will continue and that many others are in the same boat.

Why post this noise of mine here you might ask? I feel it has just as
likely a chance to be heard here as anywhere. The voice of one is
weak. Take a poll on years of programming experience vs the doco
examples usefulness. The focus needs to shift a bit towards the entry
level. Maybe someday I won't be a newb? I'd still appreciate solid
working solutions for examples!

-- Tom
 
W

Wingot

From: Tom [mailto:[email protected]]
Posted At: Thursday, 6 December 2007 2:36 PM
Posted To: microsoft.public.dotnet.languages.csharp
Conversation: Fully Working Examples
Subject: Re: Fully Working Examples *snip*
Why post this noise of mine here you might ask? I feel it has just as
likely a chance to be heard here as anywhere. The voice of one is
weak. Take a poll on years of programming experience vs the doco
examples usefulness. The focus needs to shift a bit towards the entry
level. Maybe someday I won't be a newb? I'd still appreciate solid
working solutions for examples!

-- Tom

Hey Tom,

The problem is, if they do dumb it done as you suggest for the newb
(your wording), the people who actually need to reference it the most,
the pros, can no longer write the top quality programs that they do. Why
do the pros need to access the documentation? Because of all the obscure
little things that occur.

Also, I am relatively new to coding in C#, and yet I find the
documentation to be wonderful. It is a powerful resource that has
explained every concept I have needed to know, however, it is not a site
of tutorials.

The way I see it, if you need to learn programming, there are plenty of
course available at your local college/University, or even at the local
bookstore. If you are trying to learn C#, the Wrok series of Books by
Wiley and Sons is a wonderful resource to get you started, or
alternatively "Microsoft Visual C# Step by Step", released by Microsoft
Press, is a terrific beginners book, and I have recommended it to many.

I guess what I am trying to say is that, for the newb, there are already
plenty of resources, just they might cost a little something (for the
books, under $100). The documentation is, and should be, aimed at the
more experienced users and programmers.

Regards,
Wingot
 
J

Jon Skeet [C# MVP]

BobF said:
codeproject.com is your friend

Well, partly. I've seen a lot of *really* dodgy examples on
CodeProject. The only sort of peer review is through comments, and
often there'll be a lot of people saying how it's exactly what is
required before you get to comments explaining how the sample is
critically flawed.

This isn't limited to CodeProject of course. For example, look at:
http://dotnet.org.za/deon/pages/2998.aspx

I happened to see this (can't remember why) and people had been pretty
confident in it, not spotting that the salt was being used in a
completely broken way.

Examples in books *tend* to be better because they have extensive peer
review before being published; full, active open source applications
which have been around for a while tend to be reasonable as well,
although it's far from always the case.
 
P

Peter Duniho

[...]
I guess what I am trying to say is that, for the newb, there are already
plenty of resources, just they might cost a little something (for the
books, under $100). The documentation is, and should be, aimed at the
more experienced users and programmers.

For what it's worth, I don't entirely agree with that philosophy, even as
I disagree with Tom's general complaint about the MSDN documentation.

Granted, I'm not a novice to Windows programming. But I was a complete
novice with respect to .NET programming, and I learned nearly everything I
know about C# and .NET either from the MSDN documentation or this
newsgroup. While this newsgroup has been invaluable, frankly the kinds of
things I learn here are usually pretty esoteric. All of the basics have
been relatively easy to pick up from the documentation. So at least to
some extent, MSDN _is_ suitable for novices, at least those of a certain
stripe. :)

In addition to that, my recent experiences trying to grasp the "new"
programming API for Apple's OS X operating system, Cocoa, have made me
fairly cynical about Apple's ability to usefully document their API.
Their documentation is quite poor, with very few code examples and none at
all connected directly to the doc page for specific classes in the API
(and yes, that's right...it's _one_ doc page per class, with incredibly
brief descriptions of most methods in a class). They have "user guides",
which offering tantalizing hints as to how one might do something, without
ever really putting all the pieces together in most cases (there are
exceptions, but they are few).

And note: I'm not an inexperienced Mac programmer. I have a fair amount
of experience with the pre-OS X API. But unlike the situation with .NET,
where my previous knowledge of Windows programming did help me at least a
bit to navigate the .NET API, my knowledge of the pre-OS X API was no help
at all in learning Cocoa. In many ways, the situations are very similar;
both .NET and Cocoa provide a new framework suggestive of but
fundamentally different in some ways from the earlier OS API, and in both
cases I was using a new language (C# and Objective-C respectively). But
because of the great difference in the quality of the documentation, my
experience learning .NET has been _much_ nicer than that of learning Cocoa.

Do I need the documentation to hold my hand and walk me through every
little detail? No, I agree with you that that's overkill and would
detract from the usefulness of the documentation. But the documentation
certainly should be _complete_ and should include sufficient detail so
that a complete novice, albeit a motivated one, can learn everything they
need to know about using the API from the documentation alone.

I didn't get the impression from Tom's post that he's trying to learn
general programming techniques from the MSDN documentation. I'd agree
that the documentation for a specific API like .NET or the native Win32
interface isn't the place to look for learning basic programming
concepts. But there wasn't anything in Tom's post that caused me to think
that's what he was expecting.

So, what of Tom's complaint? Well, my impression of the MSDN
documentation is that it _does_ have the potential for sparseness. And
I've seen at least one code example that is just plain awful (but if I
recall correctly where it is, they have fixed it since I last looked at it
and reported the problem to Microsoft, because what's there now doesn't
look half-bad). But I'd say that on the whole the documentation is
actually quite good. Code samples generally are complete and where they
are excerpts, there is a larger sample somewhere that has the whole
program (the excerpts generally showing up in a specific class member
page, with a link to the larger sample found on each page with an excerpt).

So while I agree with Tom that the documentation really should provide
enough detail for a novice to learn .NET, I don't agree with his
assessment that it does in fact not provide that as a general rule. It's
not perfect, but neither does it deserve the scathing review Tom's offered
here. And frankly, compared to the docs I've been reviewing recently for
other stuff, including Apple's Cocoa and the Java reference on Sun's web
site, the MSDN documentation is a breath of fresh air. :)

And sorry for the essay. It's just that this whole discussion brought up
some fairly painful, recent memories of my experience with trying to learn
Cocoa, and especially your comment about "the docs should be written for
the experts", which is exactly the kind of dismissal I received from the
Mac community when I made comments about how Apple's documentation was
insufficient. I didn't agree with them there, and I can't say that I
agree with you here. The big difference is that, having seen and used
both, I don't think the MSDN docs _are_ written only for the experts while
the Apple docs do in fact to be written that way.

Pete
 
W

Wingot

From: Peter Duniho [mailto:[email protected]]
Posted At: Thursday, 6 December 2007 6:27 PM
Posted To: microsoft.public.dotnet.languages.csharp
Conversation: Fully Working Examples
Subject: Re: Fully Working Examples

*snip*
So while I agree with Tom that the documentation really should provide
enough detail for a novice to learn .NET, I don't agree with his
assessment that it does in fact not provide that as a general rule.
It's
not perfect, but neither does it deserve the scathing review Tom's
offered
here. And frankly, compared to the docs I've been reviewing recently
for
other stuff, including Apple's Cocoa and the Java reference on Sun's
web
site, the MSDN documentation is a breath of fresh air. :)

And sorry for the essay. It's just that this whole discussion brought
up
some fairly painful, recent memories of my experience with trying to
learn
Cocoa, and especially your comment about "the docs should be written
for
the experts", which is exactly the kind of dismissal I received from
the
Mac community when I made comments about how Apple's documentation was
insufficient. I didn't agree with them there, and I can't say that I
agree with you here. The big difference is that, having seen and used
both, I don't think the MSDN docs _are_ written only for the experts
while
the Apple docs do in fact to be written that way.

Pete

Hi Pete,

I'm sorry for my wording, but I didn't actually say the experts, I said
the experienced users (at least in my summary, I can't quite remember the
specifics of the rest of it).

My opinion is basically fairly similar to what you seem to be saying: The
MSDN docs are fine as they are, they aren't perfect, but nothing is in our
world. But they aren't designed for people that don't know what they are
doing when it comes to programming in general. Also, even if you have
programmed but never on the Windows/.net platform, I would recommend an
introductory book to get you up to speed.

That is a better way of saying what I was originally trying to state.

Regards,
Wingot
 
C

colin

Ive downloaded a lot of samples lately and found most of them worked,
mostly to do with XNA,
the anoying thing I find is with the general documentation is that it ranges
from a help page
about a function eg:
public static bool SetPropertyX(int x);

and it gives you a whole help page about how this is a public function that
sets property x to the value suplied and returns true if suceeded etc...

I mean why document such a function without actualy saying what the property
is or what it does
its effect or why/where you would want to use this.

no one needs that page, you can get all that info from the one line its
listed on in the class
members page, what would be usefull is if actually told you why you would
use this function.

then theres the other case where you given a whole example about how to
create a complicated database
when all you want is a concise yet usefull description of the syntax
for say using a delegate in a unusuall way.

then there are the many examples of how to use string.format for example,
but they all stop short of doing the very thing you are trying to do,
I remember it took me ages of going round in circles trying to find how to
print
hex digit with 2 digits even if it was zero.

sure you could take a course or get a book and learn the whole of c# but
to learn all the windows forms controls inside out and the rest of .net
too is to much, you still need access to good information.

what it needs is information wich is easy to find and concise yet
is useful to people who dont already know it, and yet still
gives all the information not just the basics.

Samples will never be more than a learning tool,
they can seem like a simple start though,
however sometimes they can lead you in the wrong direction,
ive had this several times where ive used an example as a basis then
found a much better way to do it.

I knew C++ and many other languages inside out
and thought C# would be an easy transition,
however if you take into acount all the
..Net stuff too , its a steep learning curve.

Some of the simple questions ive asked here have been answered so quickly
its amasing,
like looking for how to set a radio button to look like a normal button,
I must of read through several dozens of pages,
and was considering making my own.

Im also surprised that there are stil many things that most programmers have
to do in every
program ever since mfc isnt just simply taken care of inside the language by
now.

Colin =^.^=
 
A

Arne Vajhøj

Tom said:
By my estimate, greater than 90% of the online doco code does not work
without additional coding effort. Fully working solutions are
invaluable for the student.

No. The purpose of example code is not to build and run the
code. The purpose of example code is to read the code. So
whether there are a Main to call the code is irrelevant.

Good examples are short and focus on the essential.

Arne
 
R

Registered User

No. The purpose of example code is not to build and run the
code. The purpose of example code is to read the code. So
whether there are a Main to call the code is irrelevant.

Good examples are short and focus on the essential.
I agree.The walkthroughs are excellent ways to learn and better
understand the topics.

regards
A.G.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top