Fun Stuff · Mathematics · Programming · Project Management

Tech Book List

Almost everyone has an official list of favourite technical books. This now includes me: Here is mine! I hope that you will find something that you also want to read.
.


Kanban
Successful Evolutionary Change for Your Technology Business

Are you overladen and often have to switch between projects and tasks? Do you want to visualize and limit work-in-progress? Or work in a Kaizen culture of continuous and incremental improvement?
.
This book is a good introduction to Kanban. It’s a fun and enjoyable read, but most examples are for larger organizations.

.


.

Seven Databases in Seven Weeks
A Guide to Modern Databases and the NoSQL Movement

This book represents a unique fast-moving deep dive into modern databases of all kinds, from relational to document and graph.
.
PostgreSQL, Riak, HBase, MongoDB, CouchDB, Neo4J, Redis and The CAP Theorem

.


.

The Deadline
A Novel About Project Management

A super entertaining story about a project management experiment. Yes, you will learn something, while having a ton of fun!

.


.

Conceptual Mathematics
A First Introduction to Categories

If you like Functional Programming Languages (like Haskell) and you want to understand their foundations in mathematics, then at some point you’ll want to study Category Theory.
.
This book starts as a very easy read and continuously gets more challenging as you uncover the magical world of categories and conceptual mathematics. Greatly recommended. Also see: my blogpost.

.


.

Programming Ruby 1.9
The Pragmatic Programmers’ Guide

Programming Ruby by Dave Thomas

The goal of Ruby is to make programmers happy. Do you want to be happy while coding? Then you should learn Ruby.
.
This book will give you a great starting point that explores the basic but also some deeper concepts of Ruby. You will be enlightened. Also see: my blogpost.

.


.

Thinking about Android Epistemology
(No, not those smart phones; but maybe.. some day?)

A series of enjoyable and not-too-much-technical essays. You will be confronted with questions of epistemology (the study of knowledge) and philosophy of minds so very different from ours (and yet so equal) – artificial machines.

.


.

GUI Bloopers 2.0
Common User Interface Design Don’ts and Dos

Did you ever build a piece of software with a graphical interface? Was it perfect? Are you sure? Please read this book now. It’s also very fun.

.


.

Learn You a Haskell for Great Good!
A Beginner’s Guide

This hilarious book (just look at what the sun has to say at the website!) teaches you functional programming fundamentals from the ground up to mastering functors, applicative functions, monoids, and even the dreaded monads. Those won’t scare you any more, but will be your best friends afterwards.
.
The e-book is free. Also see: my blogpost.

.


.

Haskell Road to Logic, Maths and Programming
(Warning: complex – hard work required!)

This book is an in-depth introduction into the mathematics that lie behind functional programming languages and computer science.
.
Don’t be fooled – this won’t teach you Haskell. It is best to learn the tool – Haskell – first, before starting this complex but beginner-friendly book.

.


.

Clean Code
A Handbook of Agile Software Craftsmanship


‘Programmers who satisfy themselves with merely working code are behaving unprofessionally. .. Bad code rots and ferments, becoming an inexorable weight that drags the team down.’

Mandatory reading for aspiring professional developers. Be warned that this is a very opinionated book and it exclusively uses Java – but with the right set of scepticism you will be able to pick many life-long lessons.
.
Please-please don’t be one of those that don’t care about the quality of their code. Please! I beg you.

.


.

Domain Driven Design
Tackling Complexity in the Heart of Software

This book will teach you how to design robust and maintainable application for complex problem domains.
.
Heureka! You will add many useful items to your object-oriented-design tool belt.

.


.

Gödel, Escher, Bach
An Eternal Golden Braid

‘Hofstadter’s Law: It always takes longer than you expect, even when you take into account Hofstadter’s Law.’

A magnificent journey about K. Gödel‘s Incompleteness Theorem, M. C. Escher‘s self-referential worlds, J. S. Bach‘s mathematical music, formal systems, the self, the meaning of meaning, cognition, ant colonies, and indeed very strange loops.

.


.

Learn You Some Erlang for Great Good!
A Beginner’s Guide

Similar to Learn You a Haskell for Great Good! but for Erlang.
.
Erlang and the Open Telecom Platform are different, useful and a fun learning experience. Hey, Prolog-style syntax. But as always: Don’t drink too much Kool-Aid! Also take a look at Elixir.

.
:edit: Added Learn You Some Erlang for Great Good!

Advertisements
Tool Programming

The PropertyGrid – a great friend.

One of the greatest things in .Net is the System.Windows.Forms.PropertyGrid WinForms control.

This great class uses Reflection to access the visible properties of any object.
You can download the full c# source-code of this post HERE.

Let’s take a look how the PropertyGrid control looks in action:
A .net PropertyGrid which has been bound to a Light object.
In this screenshot I’ve bound the PropertyGrid, a WinForms control, to a Light object:

propertyGrid.SelectedObject = light;

Swush! The PropertyGrid is very simple to get started with and a great tool every .net programmer should know. Next we shall take a look at a very simple class we’d like to allow the user to edit:

using System;

namespace Blog.PropertyGrid
{
    /// <summary>
    /// This is just some really simple object
    /// that contains some properties.
    /// </summary>
    public class DummyObject
    {
        /// <summary>
        /// Gets or sets the name of this <see cref="DummyObject"/>.
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the position on the x-axis
        /// of this <see cref="DummyObject"/>.
        /// </summary>
        public float X { get; set; }

        /// <summary>
        /// Gets or sets the position on the y-axis
        /// of this <see cref="DummyObject"/>.
        /// </summary>
        public float Y { get; set; }

        /// <summary>
        /// Gets or sets some object that is usually loaden from a file.
        /// </summary>
        public object ObjectThatIsLoadenFromAFile { get; set; }

        /// <summary>
        /// Gets or sets a value that should not be set by the user
        /// of the application but only by the programmer.
        /// </summary>
        public bool ThisIsADangerousInternalProperty { get; set; }
    }
}

The following lines create a DummyObject and assign it to the PropertyGrid:

    propertyGrid.SelectedObject = new DummyObject()
    {
        Name = "Bar Object",
        X = 150.0f,
        Y = 200.0f,
        ThisIsADangerousInternalProperty = true
    };

This should make the PropertyGrid look like this:
PropertyGrid bound to a DummyObject

The next Step

Our next goal is to learn how to customize the entries in the PropertyGrid.
.net provides some nice Attributes in the System.ComponentModel namespace:

The CategoryAttribute, the DisplayNameAttribute,  the DefaultValueAttribute, the BrowsableAttribute and more.

Let us apply these Attributes to our great Object:

using System;
using System.ComponentModel;

namespace Blog.PropertyGrid
{
    /// <summary>
    /// This is just some really simple object
    /// that contains some properties.
    /// </summary>
    public class CustomizedDummyObject
    {
        /// <summary>
        /// Gets or sets the name of this <see cref="CustomizedDummyObject"/>.
        /// </summary>
        [Category( "Identification" )]
        [Description( "The name of the CustomizedDummyObject." )]
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the position on the x-axis
        /// of this <see cref="CustomizedDummyObject"/>.
        /// </summary>
        [DefaultValue( 0.0f )]
        [Category( "Translation" )]
        [Description( "The position of the CustomizedDummyObject on the x-axis." )]
        public float X { get; set; }

        /// <summary>
        /// Gets or sets the position on the y-axis
        /// of this <see cref="CustomizedDummyObject"/>.
        /// </summary>
        [DefaultValue( 0.0f )]
        [Category( "Translation" )]
        [Description( "The position of the CustomizedDummyObject on the y-axis." )]
        public float Y { get; set; }

        /// <summary>
        /// Gets or sets some object.
        /// </summary>
        [DisplayName( "Object That Is Loaden From A File" )]
        [Category( "Misc" )]
        [Description( "The strange object that wants to be loaden from a file." )]
        public object ObjectThatIsLoadenFromAFile { get; set; }

        /// <summary>
        /// Gets or sets a value that should not be set by the user
        /// of the application but only by the programmer.
        /// </summary>
        [Browsable(false)]
        public bool ThisIsADangerousInternalProperty { get; set; }
    }
}


The Attributes explained

BrowsableAttribute

Using the BrowsableAttribute we tell the ‘ThisIsADangerousInternalProperty ‘ property to not be visible in the PropertyGrid.

DisplayNameAttribute

The name says it all, the DisplayNameAttribute sets how the property should be named within the PropertyGrid.

CategoryAttribute

Using the CategoryAttribute we can group our properties into categories.

DescriptionAttribute

Using the DescriptionAttribute we can give the user a hint what a property does.

DefaultValueAttribute

Using the DefaultValueAttribute we can tell the PropertyGrid what the default value of the property is. Non-default values are displayed using a bold font setting.

Let us bind the PropertyGrid to an instance of the CustomizedDummyObject class:
PropertyGrid bound to a CustomizedDummyObject


Much better, isn’t it? Be we’re not quite there yet. What about the mysterious “Object That Is Loaden From a File”?
To solve this issue I’d like to introduce you a concept I like to call ‘Object Property Wrappers‘.


Object Property Wrappers

When your objects get more and more complex, such as when you inherit from a base class, simply customizing your properties gets out of hand. Or what if you want to provide customization to a class you can’t or don’t want to change?

My solution to this problem is the IObjectPropertyWrapper interface:

using System;
using System.ComponentModel;

namespace Blog.PropertyGrid
{
    /// <summary>
    /// An <see cref="IObjectPropertyWrapper"/> is responsible
    /// for exposing the properties of an Object which the user is intended to edit.
    /// </summary>
    interface IObjectPropertyWrapper : ICloneable, INotifyPropertyChanged
    {
        /// <summary>
        /// Gets or sets the object this <see cref="IObjectPropertyWrapper"/> wraps around.
        /// </summary>
        [Browsable( false )]
        object WrappedObject { get; set; }

        /// <summary>
        /// Receives the <see cref="Type"/> this <see cref="IObjectPropertyWrapper"/> wraps around.
        /// </summary>
        [Browsable( false )]
        Type WrappedType { get; }
    }

}


Implementation

Before we bound our PropertyGrid directly to our DummyObjects.
From now on we are going to bind the PropertyGrid to wrapper classes that implement the IObjectPropertyWrapper interface.

The above interface is the interface which is used in your application’s public interface.
The following abstract class is a basic implementation of the interface. This reduces the amount of work needed if we wish to create new Object Property Wrappers.

using System;
using System.ComponentModel;

namespace Blog.PropertyGrid
{
    /// <summary>
    /// Defines a basic implementation of the <see cref="IObjectPropertyWrapper"/> interface.
    /// </summary>
    /// <typeparam name="TObject">
    /// The type of the object that is beeing wrapped by this IObjectPropertyWrapper.
    /// </typeparam>
    abstract class BaseObjectPropertyWrapper<TObject> : IObjectPropertyWrapper
    {
        #region [ Events ]

        /// <summary>
        /// Fired when any property of this IObjectPropertyWrapper has changed.
        /// </summary>
        /// <remarks>
        /// Properties that wish to support binding, such as in Windows Presentation Foundation,
        /// must notify the user that they have change.
        /// </remarks>
        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

        #endregion

        #region [Properties]

        /// <summary>
        /// Gets or sets the object this <see cref="IObjectPropertyWrapper"/> wraps around.
        /// </summary>
        /// <exception cref="ArgumentException">
        /// If the Type of the given Object is not supported by this IObjectPropertyWrapper.
        /// </exception>
        [Browsable( false )]
        public TObject WrappedObject
        {
            get { return _wrappedObject; }
            set
            {
                if( value != null )
                {
                    if( !this.WrappedType.IsAssignableFrom( value.GetType() ) )
                    {
                        throw new ArgumentException(
                            "The Type of the given Object is not supported by this IObjectPropertyWrapper.",
                            "value"
                        );
                    }
                }

                _wrappedObject = value;
                OnPropertyChanged( "WrappedObject" );
            }
        }

        /// <summary>
        /// Gets or sets the object this <see cref="IObjectPropertyWrapper"/> wraps around.
        /// </summary>
        [Browsable( false )]
        object IObjectPropertyWrapper.WrappedObject
        {
            get { return this.WrappedObject;           }
            set { this.WrappedObject = (TObject)value; }
        }

        /// <summary>
        /// Receives the <see cref="Type"/> this <see cref="IObjectPropertyWrapper"/> wraps around.
        /// </summary>
        [Browsable( false )]
        public Type WrappedType
        {
            get { return typeof( TObject ); }
        }

        #endregion

        #region [ Methods ]

        /// <summary>
        /// Returns a clone of this <see cref="IObjectPropertyWrapper"/>.
        /// </summary>
        /// <remarks>
        /// The wrapped object is not cloned, only the IObjectPropertyWrapper.
        /// </remarks>
        /// <returns>
        /// The cloned IObjectPropertyWrapper.
        /// </returns>
        public abstract object Clone();

        /// <summary>
        /// Fires the <see cref="PropertyChanged"/> event.
        /// </summary>
        /// <param name="propertyName">
        /// The name of the property whose value has changed.
        /// </param>
        protected void OnPropertyChanged( string propertyName )
        {
            if( PropertyChanged != null )
                PropertyChanged( this, new PropertyChangedEventArgs( propertyName ) );
        }

        #endregion

        #region [ Fields ]

        /// <summary>
        /// Stores the object this <see cref="IObjectPropertyWrapper"/> wraps around.
        /// </summary>
        private TObject _wrappedObject;

        #endregion
    }
}


Time to write a Wrapper

The following picture shows a PropertyGrid that is bound to a ‘DummyObjectPropertyWrapper’, an IObjectPropertyWrapper that exposes the properties of a DummyObject.
Remember that DummyObject has zero Attributes that describe its properties.
PropertyGrid bound to an IObjectPropertyWrapper for DummyObjects.

Here is the implementation:

using System;
using System.ComponentModel;

namespace Blog.PropertyGrid
{
    /// <summary>
    /// Defines the IObjectPropertyWrapper for the <see cref="DummyObject"/> type.
    /// </summary>
    class DummyObjectPropertyWrapper : BaseObjectPropertyWrapper<DummyObject>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DummyObjectPropertyWrapper"/> class.
        /// </summary>
        public DummyObjectPropertyWrapper()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="DummyObjectPropertyWrapper"/> class.
        /// </summary>
        /// <param name="obj">The object the new DummyObjectPropertyWrapper wraps around.</param>
        public DummyObjectPropertyWrapper( DummyObject obj )
        {
            this.WrappedObject = obj;
        }

        /// <summary>
        /// Gets or sets the name of this <see cref="CustomizedDummyObject"/>.
        /// </summary>
        [Category( "Identification" )]
        [Description( "The name of the CustomizedDummyObject." )]
        public string Name
        {
            get { return this.WrappedObject.Name; }
            set { this.WrappedObject.Name = value; }
        }

        /// <summary>
        /// Gets or sets the position on the x-axis
        /// of this <see cref="CustomizedDummyObject"/>.
        /// </summary>
        [DefaultValue( 0.0f )]
        [Category( "Translation" )]
        [Description( "The position of the CustomizedDummyObject on the x-axis." )]
        public float X
        {
            get { return this.WrappedObject.X; }
            set { this.WrappedObject.X = value; }
        }

        /// <summary>
        /// Gets or sets the position on the y-axis
        /// of this <see cref="CustomizedDummyObject"/>.
        /// </summary>
        [DefaultValue( 0.0f )]
        [Category( "Translation" )]
        [Description( "The position of the CustomizedDummyObject on the y-axis." )]
        public float Y
        {
            get { return this.WrappedObject.Y; }
            set { this.WrappedObject.Y = value; }
        }

        /// <summary>
        /// Gets or sets some object that is usually loaden from a file.
        /// </summary>
        [DisplayName( "Object That Is Loaden From A File" )]
        [Category( "Misc" )]
        [Description( "The strange object that wants to be loaden from a file." )]
        [Editor( typeof( System.Windows.Forms.Design.FileNameEditor ), typeof( System.Drawing.Design.UITypeEditor ) )]
        public object ObjectThatIsLoadenFromAFile
        {
            get
            {
                return this.WrappedObject.ObjectThatIsLoadenFromAFile;
            }
            set
            {
                string fileName = (string)value;

                // load object here...

                // set object..
                this.WrappedObject.ObjectThatIsLoadenFromAFile = fileName;
            }
        }

        /// <summary>
        /// Returns a clone of this <see cref="DummyObjectWrapper"/>.
        /// </summary>
        /// <returns>
        /// The cloned IObjectPropertyWrapper.
        /// </returns>
        public override object Clone()
        {
            // We can initialize the clone here!
            return new DummyObjectPropertyWrapper();
        }
    }
}


The EditorAttribute

The ObjectThatIsLoadenFromAFile property of our Property Wrapper has an additional attribute.
It’s the quite complex EditorAttribute. Using the EditorAttribute you can tell the PropertyGrid how it should ‘edit’ that specific property.

In this case the editor I use is of type System.Windows.Forms.Design.FileNameEditor, a class you can find in the System.Design.dll. When the user edits the property, by clicking on the ‘…’ button, the FileNameEditor opens an OpenFileDialog and returns a string back to you.

There are many useful Editors and you can even define your own or customize an existing.


A few last words

There is more to know about the PropertyGrid class, such as how TypeConverters work or how you can place complex objects within other objects using ExpandableObjectConverter.

Now I’d like to thank you for reading this far. Thanks! (:
You can download the full c# source-code of this post HERE.

The code also shows how you can localize your properties using custom Attributes and create IObjectPropertyWrappers using a ObjectPropertyWrapperFactory; both very useful tools.