code-example

What are pro's and con's of real code versus specially-crafted code examples in programming documentation?

What reasons could ease the choice between clear and concise artificial code example versus real-world working code which might be accompanied by all gory details for an author of programming book or a participant in online discussion? ...

C# Syntax - Example of a Lambda Expression - ForEach() over Generic List

First, I know there are methods off of the generic List<> class already in the framework do iterate over the List<>. But as an example, what is the correct syntax to write a ForEach method to iterate over each object of a List<>, and do a Console.WriteLine(object.ToString()) on each object. Something that takes the List<> as the first a...

iPhone Dev - Create UIButton Manually

Hi, I'm learning how to develop on the iPhone, I bought a book called Beginning iPhone 3 development Exploring the SDK. After I bit I decided to ditch Interface Builder. I still design all my views in IB, but I write It all in code and only use the nib file to get the controls' frames. So now I need to make a UIButton, and the documenta...

Example of application covered with tests

Hi guys, is there sample/open_source application for download that is covered with tests(integration, unit, ...) and could be example how testing should be done? We want to learn our junior programmers how tests should be written(ok ok, and we(seniors) want to learn, too :)) Thanx ...