This post lists useful tools and habits for developers in order to become more productive. It is based on my experience and some information I extracted from the book “The Productive Programmer“. I try to keep the list short and because I am a .NET guy it will be coined a little bit more to the .NET platform. Still most of the information will be useful for other developers too.
The command line is where we come from …
Visual Studio 2010 supports extensions, use them! Most useful extensions and add-ins:
How often do you find yourself copying over some stuff from one program to the other. While copy pasting code in general might be considered as a code smell, you might want to copy other things than code from one document to the other. The regular clipboard is highly ineffective especially if you need to copy more than one passage but not all. Normally you end up switching between the documents, pressing CTRL+C and CTRL+V. A better way of doing it is to install a multi-clipboard utility such as Ditto. You can first copy all the passages from the source document and go to the target document and insert the content where you need it.
Use existing frameworks and libraries where it makes sense. Do not reinvent the wheel. Do no use a framework just for the sake of using a new technology.
Multi-Tasking is a myth. I would actually call it “Rapid Task-Switching”. Minimizing those switches most certainly results in a productivity gain: “Stop starting, start finishing”.
This list is rather incomplete, I will update it from time to time …
FitNesse is an open source software testing tool which can be used to do acceptance testing in a lot of different scenarios. It was originally developed to test java applications but can also be used with some modifications with the .NET framework. Since the documentation for using it in .NET is widely spread across the web I decided to write down some of the information that I have found useful in a few posts. Another useful resource of information is Gojko Adzic’s book about Fitnesse. This post sums up briefly what you need to do in order to
Recently I set up a home file server out of old hardware and installed ubuntu server edition. The idea was to make use of my old hard disks (which range from 80 GB to 500 GB capacity) and the next time I replace a hard disk it should be easy to integrate the old disk into my home file server. ZFS is perfect for this purpose because it allows to add disks later on to a pool and we do not need to use LVM and extend file systems and so on. Unfortunately the linux port of ZFS can only be run in user space currently (ZFS FUSE). Anyhow this is good enough for my home server!
Installing ZFS is straight forward:
sudo apt-get install zfs-fuse
In order to setup your ZPool you can check out this article. For my special purpose – I simply wanted to stripe the data across all my hard disks – I used this command:
sudo zpool create storage /dev/sdb /dev/sdc
Remember to replace sdb and sdc with your hard disks you want to use. To destroy the zpool again you can use:
sudo zpool destroy storage
There is a project to build in encryption for ZFS on OpenSolaris (I think they have integrated that already). I am not sure that the ZFS fuse port is supporting that, so I went for another solution (make sure that you destroy again the zpool before continuing):
First create a partition on each hard disk drive you want to use.
sudo fdisk /dev/sdb ... sudo fdisk /dev/sdc ...
Next install LUKS:
sudo apt-get install cryptsetup
Now it is possible to encrypt the partitions. I am assuming that the disks are new (and therefore empty), otherwise you want to wipe out the content first. This can be done for example with this command:
sudo dd if=/dev/zero of=/dev/sdb1 bs=512
To encrypt the partitions, you can use for example this:
sudo cryptsetup --verify-passphrase luksFormat /dev/sdb1 -c aes -s 256 -h sha256 sudo cryptsetup --verify-passphrase luksFormat /dev/sdc1 -c aes -s 256 -h sha256
In order to unlock and map the partition use (/dev/mapper/encrypted1 and /dev/mapper/encrypted2):
sudo cryptsetup luksOpen /dev/sdb1 encrypted1 sudo cryptsetup luksOpen /dev/sdc1 encrypted2
Now it is possible to use the encrypted partitions as the base for our zpool:
sudo zpool create storage /dev/mapper/encrypted1 /dev/mapper/encrypted2
The result is an encrypted ZPool. You simply need to repeat the process of creating an encrypted partition for each hard drive you want to add. If you do not enter the password and map the encrypted partitions ZFS will report “Faulted” as the state. After entering the password it will report “Healthy”. Remember restarting zfs-fuse after unlocking the drives.
Instead of using a password it makes sense to use a key file on a USB stick, so that you can put that in while booting your home server and everything is loaded automatically (like the keys for a car).
Microsoft’s .NET Framework Version 4 includes a version of the Entity Framework, which allows two ways of creating your model: Database First and Model First. Database First was already available for the previous version of Entity Framework. It means that Visual Studio’s Wizard is used to point to a database and Entity Framework generates the model classes and mappings out of the database tables. Very often the domain model looks different than the data model, which means either developing another mapping layer between the generated classes of Entity Framework or a lot of customization on the generated classes themselves. For this reason it is also possible to use the Model-First approach, which allows you to use the graphical designer and design your model first and then let entity framework generate the database schema and mappings. Lately another approach has been introduced as a CTP: Code-First. Instead of using the designer, Code-First allows you to code your domain with POCOs and persist this plain model using Entity Framework. This article compares Entity Framework 4 Code-First CTP with NHibernate in terms of usability (not performance-wise) using examples of domain driven design concepts.
This post is short summary as well as a collection of ideas and impressions of the Lean and Kanban gathering in Antwerp organized by Agile Minds. According to David Anderson (one of the speakers) it has been the biggest conference on this topic so far: agilility is spreading in software development ( let it be Scrum, Kanban or any other agile methodology) and it is also growing on enterprise level.
Software architecture and design has a major impact on success or failure of software projects. How can a good architecture be classified? Which are the architectural key features that decide if a project succeeds or fails? How can architecture support an agile development process such as Scrum?
This post explores attributes of software designs that are required by agile development processes. Furthermore it discusses the differences between classical big up-front designs and the agile way of doing it.
In the last post I described methods and practices to achieve higher code quality by improving the development environment in which a team works as well as by using different testing approaches which can be used by individual developers or independent tester groups. One additional method is to improve the quality of the code by doing code reviews on a regular base.
How can code reviews help to achieve better code quality?
Formal Code Reviews
Code reviews should be done on a regular base. This can be before mile stones in a project, before delivering code (cleaning up the code of a component), during prototyping in order to approve a design, etc. In this case the code reviews must be planned and should be part of the planning of an iteration (in scrum as a backlog item). Those type of reviews have a formal character and the results should be captured in a report or document which can than be distributed to the participants.
Peer reviews is are informal code reviews initiated by the developer which developed some code or a component. Another developer sits together with the initiator of the code review and they look together over the new code. The initiator can explain his code and work in ideas or directly correct found bugs. By doing so it is very important that the developer which is reviewing, does provide ideas and constructive criticism, but never destructive comments.
Pairing up for programming is method which comes from Extreme Programming. It means that two developers pair up to develop a component at one workstation. This a consequent advancement of peer reviews. The person who is typing is called the driver whereas the other developer is called the observer or navigator. While the driver is programming the observer can already think ahead and find solutions for upcoming problems. This helps the driver to focus on the current task. The roles are switched frequently (e.g. every 30 minutes). This is important because otherwise the observer can loose the focus or is bored. Also the time of pair programming should be limited since it is very strenuous and developers have single tasks to do as well (e.g. answering e-mails).