The great thing about using HTML as your design and communication tool is that when it comes to making a change to a page you have the most up to date working copy there ready to modify in the form of your site. Just save the page, add the change to the HTML and you've got your interfaces ready for discussion and later implementation. What could be easier, faster or more clear for everyone?
# yum install subversion
# yum install mod_dav_svn
If you're on a Debian based system try:
# apt-get install subversion
# apt-get install libapache2-svn
In your apache configuration file, near the module declarations make sure you have the following lines.
LoadModule dav_module /usr/lib/apache2/modules/mod_dav.so
LoadModule dav_svn_module /usr/lib/apache2/modules/mod_dav_svn.so
$ svnadmin create /path/to/repo
It's usually best to create this somewhere near, but not in the document tree for the webserver.
Open you're apache config file, or the config file that stores the details for the virtual host you're using and add the following lines:
DAV svn
SVNPath /path/to/your/repository
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /path/to/your/passwdfile
Now create the htpasswd file and add a user or two using the following commands
# htpasswd -cm # htpasswd -cm /etc/svn-passwd andrew
New password:
Re-type new password:
Adding password for user andrew
# htpasswd /etc/svn-passwd -m simon
New password:
Re-type new password:
Adding password for user simon
Restart apache and that's it all done. You should now have a running subversion repository with two users, andrew and simon, they should be able to view and commit anywhere. We'll assume these are staff members who can view and commit on any project.
# htpasswd /etc/svn-passwd -m john
New password:
Re-type new password:
Adding password for user john
The next thing you need to do is to setup svnauthz to control access to the repository. Back in your apache config file, add the following line into your svn config:
AuthzSVNAccessFile /home/goroam/dev.goroam.net/user/repos/svn-authz
So that it looks something like this:
DAV svn
SVNPath /path/to/your/repository
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /path/to/your/passwdfile
AuthzSVNAccessFile /path/to/your/repository/svn-authz
I tend to keep my svn-authz file within my repository path, you may wish to place it elsewhere - whatever works best for you.
The next step is to create the svn-authz file. That's as simple as this:
[groups]
staff = andrew, simon
contractors = john
[/]
@staff = rw
* = r
[/external-project]
@contractors = rw
The file is pretty simple and self explanatory but the first block starting with [groups] defines the groups. In this case we've got two one for staff with andrew and simon and one for contractors with john as the single member. The usernames to use here are the same as you set in your htpasswd file. Authentication is controlled by the standard basic authentication, subversion is only controlling access.
The next two blocks are paths within the repository. The first:
[/]
@staff = rw
* = r
Tells subversion to give all members of the staff group read and write access to everything under the / path - basically the whole repository. The next line * = r tells subversion to give everyone else, read access to everything.
Again this may not work for you, but we tend to allow read access to everything to everyone with a password. If we trust them enough to give them a password, we trust them. Also it allows contractors to build dependant libraries from the head, which is required at times and saves us the trouble of working out dependencies in our svn-authz file.
[/external-project]
@contractors = rw
In the next block, above, we're giving everyone in the contractors group read and write access to everything in the /external-project path of our repository. This of course is the project they're currently working, so your path will be different.
That's it. Contractors hired, up and running in your subversion in minutes.
# htpasswd /etc/svn-passwd -m dick
New password:
Re-type new password:
Adding password for user dick
# htpasswd /etc/svn-passwd -m jane
New password:
Re-type new password:
Adding password for user jane
# htpasswd /etc/svn-passwd -m dave
New password:
Re-type new password:
Adding password for user dave
Assuming, as above we have andrew and simon as staff users we should make our svn-authz file look something like this:
[groups]
staff = andrew, simon
companya = dick, jane
companyb = dave
[/]
@staff = rw
* = r
[/project-x]
@companya = rw
[/project-y/branches/zing-bang-feature]
@companyb = rw
We're only building slighty on the previous file with the groups entries, and that should be clear. The entry here for project-x should also look familiar - Both dick and jane, members of the companya group have read and write access to the path.
For the next entry we've created a branch and we have company b working on the branch. I'm really just throwing that out there, mostly because I can, but also to show that you can go to any depth in the repository tree granting access as you see fit.
In this case it's been determined that the work CompanyB in engaged to complete only needs to take place in this branch, so while they can read the whole repository they cannot write anywhere except here. This would allow you to continue internal development, or indeed external with some more entries on project-y making point releases while zing-bang feature is developed and CompanyB could merge the trunk in at will, since they have read access to it.
While on holiday the code I'm responsible for has been modified by an external contractor. Before my holiday I pointed out that we should make sure version control is used by anyone making any change. It wasn't. Now I'm frustrated and pissed off. The problem isn't that someone else was editing the code, or that I somehow lost control of a fiefdom or anything like that. It's that I've just spent hours I could be using to do something else tracking down file modification dates and then diff'ing them against my versions out of version control. Time I shouldn't have to had spent doing anything The bigger issue is now I'm under pressure by my boss to deliver some changes at the same time as I have to deal with this, and no extra time has been allowed for it.You pay contractors to do work for you, a large part of that should be to insist they do it in a way that is consistent with your working practices. You wouldn't let them commit changes to a PHP website in ASP, Perl or Python and equally you should insist that changes are delivered consistently and in a manageable format. Warning flags get raised if someone tells me they don't use version control. Not knowing how and asking questions is one thing; I have no problem helping someone, a contractors included, learn our version control system and practices because I see our relationship as a long term one, so any investment in that relationship is worthwhile. If a contractor tells me they cannot or will not use our version control system though, we have a problem and usually we end the relationship then and there. It may sound like a hardline call based on a single criteria but it is a deal breaker for me. For a contractor there could of course be some concern that they've submitted the work and may not be paid. Version control is not the cause of this - it's dishonesty, plain and simple and if the person you're working for is that dishonest submitting code via email before the cheque clears is equally risky.
The key to any successful development team, far more than any other tool, is version control. No matter how many team members you have, if you're dozens of people spread across the globe or one lone developer in a basement you need version control.
A number of free and paid for systems exist, largely they accomplish the same ends: the ability for multiple developers to collaborate on the same code, the ability to track changes and the ability to manage changes across concurrent versions of code.
This is potentially the biggest benefit of any source control system, the ability to manage changes in code. Most version control systems manage changes through a series of checkouts and commits by developers.
You check the code you want to work on our of the repository creating a local copy, make changes to the code and commit your changes to the repository again. Any developers that are working on the code can update their local copies an the changes you've made will be merged in.
This can be a massive boon, even if you're working alone. Version controls systems will also let you roll changes back, so if you've made a mistake, deleted a file or need to see how something worked before you can go back to any previous version.
Concurrent versioning is a great benefit when you've released software or are developing more than one major feature at the same time. It's the process of having two working versions of the code which can be edited independently.
In the case of a released version of software this allows you to release a patch before new features still in development are ready to be released. You can patch the bug, release an update to users and then use the version control system to merge the change into the development code so that your next release with the new features gets the fix too.
If you're working on a major feature you might also want to branch your code temporarily. This would allow you to perform some pretty significant refactoring on areas of the code which would not affect developers working on the rest of the code, when you finished the work you could then merge your code into the main development branch prior to release.
For more information about version control see the excellent Visual guide to version control at betterexplained.com.
There are a number of choices and a number of web based version control systems. Opensource subversion and git are used by a large number of people and compete on features with most commercial offerings. If you don't want to set up your own server to host a repository Google code, beanstalk and lighthouse are just a few web based services that can host version control environments for you. Google code is free, but you'll need to be developing an opensource project the other two are subscription services.
I personally use subversion and love it but with any version control system, commercial or free the most important thing is to pick and fit a system into your development environment. Don't pick one that is going to force you to change the way you work. Try a couple if you can and pick the one that works best for you.
From time to time this blog will reflect a decision we take as a company, this is one of those times. We're currently working on a product called Citrus, a better way for agents to sell property online because frankly existing stuff sucks, scheduled for launch in the autumn.
One of the key decisions we've taken is not to implement everything on our feature list. We'd rather build half an app than a half assed one. As flippant as that sounds, it's true- we could spend years analysing all the competition, ensure that we've not only bested them at the key features we know we need to implement, but at everything else as well and some day in the distant future launch a product. Or we can look at our feature list, choose the killer features we know our application needs to have to achieve everything 80% of our potential customers need from our app and forget the rest.
We've chosen the latter. It's going to help us get to market faster, it's going to help us get customers quicker and it will allow our customers actual use of the product drive our vision for it- not some paper list. Also if we're totally wrong in assumption that a good product can gain traction in a poor market, we know and can move on sooner.
UPDATED: I renamed the title for consistency - we refer to the stage of development as either both the Minimum Launch Feature-set or the Minimum Stable Feature-set internally - the latter being the best really since it's useful both for an initial launch and for discussing post launch updates.
All software is a work in progress none is ever perfect. It will always have bugs, sometimes it might even seem that the software is nothing but bugs an it's in these dark times when we normally say fuck it, let's start over. Not always, some of the good excuses I hear for a rewrite are:
New blood Someone new comes along and the first thing they suggest is a complete rewrite - It's alarming the number of times I hear this suggested. Sometimes it's contractors, which is somewhat exusable - it's more billable time for them. Other times it's by people newly in charge or new to the team.
Team members have left - rightly or wrongly they've been blamed for the code, and coding them out seems like a good idea
Too many bugs - An effort to hammer out the bugs feels like it would take longer than to rewrite from the ground up
New tools! - A shiny new framework is out and you want to use it, it will solve all your problems and put all your spare cycles to work sorting out poverty and war.
Common to all the above is the fact that everything seems like it would be easier if only you could get out from under the crushing weight of legacy. And it's a very attractive fallacy; Bugs could be solved by reworking the architecture; Features would be easier if only the code wasn't written that way; That new framework would fix the bugs we're seeing because of the one we're using.
They sound like good reasons, but that's the problem with attractive things that are bad for us - they're attractive. It's so much easier to believe that the grass would be greener if we re-turfed the lawn than to work out how to fix those brown patches.
A complete from the ground up rewrite will take longer than you think. It will probably take almost as long as it took you to get where you are now. It's tempting to believe that you don't need planning meetings to work out what has to be done. It's right there a spec in the current implantation, just get started! So you're initial estimate is just a stab in the dark anyway.
Add to this the further false belief that since you implemented the features once already, you'll be able to do it faster this time around. You won't, well you might - but you won't implement them as optimistically quick as you think you will.
Throughout the process you'll also be further from a releasable product than you think you are - much further. In a rewrite you have to rewrite every feature all those "all we have left in component x to do is..." bullet points add up.
All of this leads to one last problem with timescales for rewrites - in order to get anyone else to buy into them they have to be wildly optimistic about the schedule. So just when you need everyone most motivated and excited, as you're gearing up for a release, you've set them up to be demoralised by missing an increasing number of deadlines.
Programmers are people, people are creatures of habit. You'll inevitably end up implementing part of your radical new system in a very similar way to your existing system. Then you'll be forced to make the same compromises as you've made before and you'll undoubtedly introduce some bug that's already been patched in your existing software.
Some of your old code will also be good code, at best you might cut and paste it into the new code base but for the most part though trying to hammer it into place and wire it up is going to be as long and as buggy a process as rewriting it. So instead you follow the rewrite it all logic and rewrite it all.
When you're rewriting your software you're stainding still in almost every way possible. If you're rewriting everything, you're spending an awful amount of time not moving your application or business forward. Personally and professionally you're not learning much new (unless a new framework is your excuse).
Even if you're squeezing some features into your rewrite, probably because it's been so long since a release you'd be lynched by a mob if you refused, it's so long before the users are actually going to see them that you might as well not be. The perception of your software isn't going to be sometimes shaky, but getting better all the time - it's going to that it's buggy and the bugs are never fixed.
The sad and somewhat painful truth is if a team can't fix something - getting them to make a new one is probably not going to fare much better. Your new version is probably going to be no better than the old, will certainly be worse than an itteratively developed and incrementally improved version of what you had could have accomplished in the same time.
Also problems you're having with a framework or tool probably aren't going to be magically solved by using a new one. Most of the these arguments are born out of a naive belief that because the framework isn't doing what the developer is expecting, the framework has bugs, changing frameworks should then solve the bugs. The problem is of course developer expectation versus reality and more often than not due to some underlying misunderstanding of the platform the framework or tool is abstracting - a reality that a new framework cannot change.
While it's not sensible to start a full rewrite of your software, it's also ludicrous to decide that nothing written should be changed. Software development is a process not an event. If it's not working fix it; if it's complicated and bug prone, refactor it; if it's shit, code it out. Just don't throw the good out with the bad.
In the case of bug riddled software start with an area that is causing the most trouble. Patch the big bugs first. It can be a painful process, I won't lie. It's demoralising to everyone to have buggy software and it's not exciting or glamorous to fix it.
Bug fixes are one of the most thankless tasks developers are asked to perform, so make sure you break it up with some of more challenging and interesting tasks, throw a few features into each iteration.
These are the generally the things that are hurting the developers rather than the user. Some of them are far reaching, architectural or framework choices. They can all be fixed though, and you don't need to rewrite the whole application to get there.
Again, start with the ones that hurt the most, if it's part of the architecture refactor it. If it's a framework you'd like to integrate to solve problems, try it out on part of the code and work to roll it out incrementally.
I promise it will be quicker, a lot quicker to go down the incremental route than it will be to rewrite the whole thing in one go.