Tuesday 16 October 2012

My standard .gitignore file for .Net projects

Thumbs.db
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*.vssscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.cache
*.ilk
*.log
[Dd]ebug*/
*.lib
*.sbr
obj/
[Rr]elease/
[Dd]eploy/
_ReSharper*/
[Tt]est[Rr]esult*/
[Tt]est-[Rr]esult*/
[Tt]emp/
[Pp]rerelease/
[Ll]ogs/
UpgradeLog*.XML
_UpgradeReport_Files/
bin
!SharedLibs/NUnit-*/bin/
!SharedLibs/NUnit-*/bin/net-*/*.exe

Saturday 13 October 2012

So, what's your team's bus factor?

5whys.com is a site I've been enjoying recently and anyone interested in team leadership should check it out. I've just been reading one of Roy's posts about something called 'Bus factor'.

Bus factor: An irreverent measurement of concentration of information in a single person, or very few people. The bus factor is the total number of key developers who would need to be incapacitated, as by getting hit by a bus, to send the project into such disarray that it would not be able to proceed.

My team's daily stand ups, pair programming and the willingness for team members to share their knowledge means we certainly have a bus factor > 1. So, what's your teams bus factor?

Tolerance and the Equal constraint in NUnit tests

Those pesky tests that fail every once and a while because something took slightly longer than usual. Sure you could just run them again and they probably pass a second time round. There is another simple way to avoid this, the NUnit Within modifier for the Equal constraint.

[Test]
public void CreationDateTimeIsSetOnConstruction()
{
   var timeObject= new TimeClass();
   
   Assert.That(timeObject.CreationDateTime, Is.EqualTo(DateTime.Now)
         .Within(new TimeSpan(2000)));
}

Monday 17 September 2012

Questions to ask when reviewing a design

Found a post over on the 37signals site where Jason F. lists 'Quesions I ask when reviewing a design'. Might come in handy for some upcoming UI work we've got planned :)

Sunday 29 July 2012

The Clean Coder

I don't read many tech books, at least not as many as I should do. However, I've just finished 'The Clean Coder - A Code of Conduct for Professional Programmers' by legendary software expert Robert C. Martin (Uncle Bob) and really enjoyed it.

Uncle Bob uses his vast experience in the industry to define what he thinks makes a professional software craftsman. He covers how to deal with conflict, impossible schedules, unreasonable managers and mounting pressure. He also explores time management, working environments and how best to get into the flow of coding. Bob makes some bold statements that many won't agree with, including about how much time outside of work professionals should be putting into their craft, but agree or not Bob always has some compelling arguments.

What I liked most about this book is Bob's honesty about the experiences he draws upon in his career. Even the brilliant Uncle Bob has made some big mistakes but is happy to retell these stories and highlight what he's learnt from his experiences. Bob's writing style makes it easy to follow and I'd recommend this to any software developers or managers looking for their next tech fix.


Thursday 26 July 2012

Internet Explorer is killing the internet (and me)

As any professional web developer knows, cross-browser testing is one of those day to day mundane tasks that's required for most web UI work. You've spent time creating beautiful UI mock ups with that creative mind of yours, transferred that to HTML and it looks good. Chrome and Firefox is pixel perfect. Then it's that moment you've been putting off - what does it look like in IE? Boom. You're spending the rest of the day, turning that beautiful HTML and CSS into a shambolic hack before it finally resembles what you intended it to.


OVER 10 YEARS AGO!

OVER 10 YEARS AGO!

OVER 10 YEARS AGO!

OVER 10 YEARS AGO!

OVER 10 YEARS AGO!

OVER 10 YEARS AGO!

OVER 10 YEARS AGO!


...when we laughed our socks off to Monsters inc and Apple introduced us to the iPod; Microsoft gave birth to Internet Explorer 6. It's still to this day stifling the creativity and wasting the time of web developers across the globe. If you find yourself in the unlucky position where a decent percentage of your target audience is still living in the past on IE 6 (or 7 or 8) you're hands are often tied. It requires a bold business decision to say no to IE6 support. Some people, projects and companies are doing this - in some interesting ways too (IE7 tax). Even Microsoft are fed up and have created their own IE6 count down site to encourage people to upgrade. But this act of redemption is too little too late. Saying that, the site is fairly interesting. It displays the stats of IE6 usage around the world. Surprisingly, China being the worst offenders still. Here's an article I found that outlines the reasons why China still favours IE6.



Rant over.

Monday 23 July 2012

Visual Studio can work with HTML afterall

Fix Visual Studio’s crappy HTML formatting and automatic addition of id when pasting

Some nice chap called Tim just told me how to solve those two annoying things that Visual Studio does when I'm editing HTML. What two things? You know, the weird thing with the line breaks and opening tags and the one where it insists on adding an ID to every element you paste in the HTML.

Thanks Timmy!






Continuous Integration and Jenkins

I found this old draft post hanging around on blogger and it reminded me to a time long ago before CI servers were a part of my dev life, so I decided to post it...


Jenkins (formerly Hudson) is an open source continuous integration server and assists the development team by allowing us to easily integrate changes into our software projects from our source control with confidence. Jenkins can be automated to build, test and deploy any type of software automagically. Jenkins doesn't require bucket loads of learning before you start using it and it's very easy to set up. It's also super extensible and caters for a wide variety of programming languages/testing frameworks etc and there are a lot of plugins available - and I mean a lot.


Feedback is key. If Jenkins has any problems building, testing or deploying any projects it can alert the development team in a number of ways (e.g. through a GUI, email, twitter and many more). So as soon as the build or any tests fail we get alerted and the team react to fix those changes - it's never broken for long.


As you can imagine, once we made the effort to set up our software projects in Jenkins, it has improved our 'quality of dev life' dramatically. Automating the building, unit testing, integration testing and deployment straight to our staging environment for every check-in means we are more confident, less stressed and a lot more productive. Once happy with our staging environment we can one click an application release to live. So our application users are getting newer features faster than ever. Ignoring IDEs and source control, I'd argue a CI server is probably the next most fundamental tool in a developers tool belt.


Jenkins! How did we ever live without you?!




Saturday 4 February 2012

Import CSV Data into Sql Server Table

Getting a CSV file into a SQL Server table?

Found an even easier way to do it...

CREATE TABLE TelephoneNumbers
(TelephoneNumber NVarChar(15))
GO

BULK INSERT TelephoneNumbersFROM 'c:\TelephoneNumbers.csv'
WITH
(
 FIELDTERMINATOR = ',',
 ROWTERMINATOR = '\n'
)
GO

The code is self explanatory; I was surprised how easy it was!'