Monday 26 November 2012

Programming is not just programming

Well its been a very long time since I posted something here, but today I had an idea of what I could write about...

I had a very good friend ask me about .net development, and that he was concerned about getting his .net skills up to scratch. My immediate thought was this guy is a super bright guy and I am sure he knows enough of .net to be able to do pretty much anything that was required of him and quickly as well. Which then led me onto thinking of this post and what I could write about.

I would say that a lot of .net developers out there know how to write code in .net and probably/possibly many other languages too, but possibly miss the idea of writing code that can be maintained and also feel confident about being maintained quickly (this does not mean that the super bright guy above does not know this :-)).

I would say of those that don't care and don't even realise what they are writing, their code is becoming legacy code as quickly as they type it. I for one was one of these guys (the didn't realise one), absolutely 100% omg! Am I admitting that! We all have to start somewhere (that's my excuse ;-) ) and from there its a lot of practice and realisation of what we are writing.

Now I am making a concentrated effort on everything I write to be much clearer, simpler, easier to understand and change, by keeping in mind as many of the things I have read about in the following books, links, blog posts frameworks etc.

I will try to keep this up to date every time I discover something new or useful. Lots of links and lots to digest I know, but it has taken me some time. Just take your time, practice a few things, try them out on some scratch projects see what you can come up with. You'll surprise yourself on how your code becomes much more awesome!

  • S.O.L.I.D - A must for every OO developer, probably any other link on that page too.
  • Tell Dont Ask - Another nice one that can lead you onto the other nice things like CQRS and Law of Demeter
  • Dependency Injection Stack Overflow link and James Shore Link from the same SO link - Lots of Inversion of Control (IOC) containers out there to help with this too. Ninject (my favourite), StructureMap, Unity, there are also more. I find this is really important and should be used on every project regardless of size of the project, what you will start to realise when you use this that your unit testing becomes easier to write.
  • Unit Testing - There are many unit test frameworks out there to pick from, NUnit (I have used a lot), XUnit (but heard a lot of good things about this and I think I will start to use this for some home projects ), MSTest (Microsoft's, included with Visual Studio). Just a quick side note I would like to write an article about is Unit Testing. I believe and found it so difficult to start writing unit tests, this is also a lot of practice and when you realise how it fits and what it does, BOOM! It will be a Eureka moment! 
  • Resharper, get it! It's worth it! It has some very nice tools with it, the solution wide analysis(dont need to waste time building solution to find errors), the stack trace viewer are a couple. I recommend learning a shortcut a day, and within no time you wont need your mouse to code. Pffff, the amount of times I have sat there with someone using the mouse to click on menus, scrolling around, switching windows, looking for code in a solution, blah blah, all that time wasted.... aaarrrrgggghhhhh! Drives me nuts! Mind you I can get some 5 second power naps, when they are searching for the next thing to click! lol ;-)
  • Read blogs articles, follow some recognised people, like some of the people from the books I have mentioned. Also take a look at some code you have found on github, contribute maybe too, you will learn so much like this.
  • Go to some talks, organised day events, local newsgroups in your area, etc. skillsmatter, DDD
Ok some other stuff, buzz words, people, software etc... I will try to write these more in depth at some point but it will be worth you guys having a sniff at what they are about also.


Continuous Integration

Setting up a build and release process just off a single check in! If you can get this right, this is one of the most powerful things in releasing software fast and reducing all that wasted time, matching up bugs with changesets, with releases, deploying the correct version for your testers, unit testing, integration testing etc. A couple more pieces of software provided from JetBrains, TeamCity and  YouTrack is worth taking a look at also, extremely useful for tracking all task, bugs etc. There are many other solutions out there too, but these are the first that came to mind for the moment.

Source Control

There are several source control systems out there, here are a few...
  • GIT - Extremely powerful and gives much more ease and freedom for your code. I have only started to use this recently, it takes a little time to get your head around if you are used to using a more centralised system, here are some links... GIT Succinctly, GitHub get an account, try it out, practice, stick at it. Well worth it!
  • TFS - Microsoft's version of source control, along with managing tasks and probably other things too. I use it most of my working time. But the more I use GIT the less I want to use this.
  • SVN - Not used in a long time and used sporadically.
  • SourceSafe - This has to get a mention! DO NOT USE IT!! REALLY! DON'T! Go take a read of any articles about it, see what people have to say about it, maybe you have had your own experiences with it...


Database Stuff

Apart from the usual same old boring databases are databases blurb, blah blah, same old, same old, SQL Server, MySQL, PostgreSQL, blah blah etc ooops forgot about Oracle.
But there are these new document databases turning up, which seem very very interesting, take a look, try them out, RavenDB and MongoDB. I haven't used them yet, but will be giving them a go soon I hope. They seem extremely powerful and fast. I went to a see Oren Eini and he gave an excellent talk on RavenDB. Interesting thoughts of why now we should be looking at storing and retrieving data differently.


Books

  • Working Effectively With Legacy Code - Michael Feathers, Don't be depressed with crap code, take a read of this and see how you can fix it! Very good read and interesting.
  • Clean Code, and The Clean Coder - Robert C. Martin (Uncle Bob), Both these books very nice.
  • Refactoring: Improving the Design of Existing Code. Excellent! Nice techniques, mixing this with Michael Feathers book above and the Clean Coding books of Uncle Bob you will have some quite powerful ways of being able to modify the most complex of code.
  • The Pragmatic Programmer: From Journeyman to Master - Andrew Hunt and David Thomas,  Superb, must read for all developers! Interesting too, see if you can recognise any of your situations you have been in match whats in this book, I wouldn't be surprised most of them match :-)
  • The Art of Unit Testing - Roy Osherove, Very nice, a definite good start with Unit Testing, but I still think you need to practice and see what it really is worth.
  •  C# In Depth - Jon Skeet, Superb! I have to take my time in this one, and probably have to read it a few times, but excellent!
  • Domain Drive Design: Tackling Complexity in the Heart of Software - Eric Evans, I have started reading it but not got very far yet, but heard it is very good.

Other Things

  • Rx - A must! Take a look! Try it out! See what you can do and learn from this. Very powerful!
  • Agile - I would say a very powerful, fast and useful process of writing software. I would never go back to Waterfall again if I could help it, unless I needed money for sleeping. I haven't read up much on the agile processes but been in the flow of using this style of development with several projects. 
  • NServiceBus - I haven't used yet but all I hear is good things about this piece of software check it out. I will be trying this out in the near future also.
  • Automapper - For transfering data from one object to another which has the same properties, Very neat, very useful, easy to use, set up.
  • Some people, Martin Fowler, Kent Beck, Robert C. Martin (Uncle Bob), Oren Eini, Udi Dahan, Jon Skeet, all of these have a massive community around them and well worth reading up some of their articles.