Saturday 22 December 2012

What Should a Programmer Learn?

I've come across a few kinds of thinking when it comes to hiring developers:

It seems that most, especially agents, try to look for very specific skills.  I remember speaking frankly to a recruiter and telling them, "Well, you're going to have a very difficult job finding the person you're looking for."  And they agree'd...  They had been looking for a while, and hadn't found anyone yet, even though they were offering a very high salary.  They were looking for a .NET developer who had five years experience in building Metastorm BPM solutions.  The idea sounded a bit unrealistic to me.

On the other extreme, I once received a phone call from a company trying to get an ASP.NET developer.  At the time I hadn't had any experience in ASP.NET, but they didn't seem too worried and invited me to come for the interview regardless.  I also spoke to a friend of mine recently, who told me that their company has a policy that they don't hire people for specific skills, but rather look for good, smart, experienced programmers who they can train to do the job.

The third kind of thinking is a hiring within the specific industry or type of work.  This kind of thinking makes it very difficult for a good programmer to get into the favourite industries, like game development.

On the positive side, seeing as different companies hire for different reasons, it may be possible to get into one company where a similar company would reject you for not being in the right blood group, or having the wrong star sign, or something equally ridiculous.





So, let me start with what I think is the most important:

What to learn to become an amazing programmer, regardless of the specific skill or industry.

The basic skills required for a junior programmer usually include some object oriented programming language, the ability to create a relational database, and SQL.  If you can afford it, the best way to learn these is probably to go to university.

The next thing you'll probably want to learn is design patterns.  You can either look up the most common design patterns on the internet, or read a design pattern book, such as Design patterns : elements of reusable object-oriented software or Design Patterns For Dummies.  Code Complete is a famous book which teaches how to write quality code, but it's quite old, so there may be a more up to date book.  There are also books on patterns for specific areas of software development, so you could get a book specifically about design patterns in ASP.NET for example.

If you look at job descriptions, you may find three letters which pop up in almost every advert: "TDD."  Once you have a good knowledge of the basics of programming, you need to learn Test Driven Development.  It may seem strange, but I would go as far as to say that if I ran a company, I would expect all of my developers to either have read a book on TDD before they're hired, or I would insist that they read one as soon as they start.  If you're a C# developer, I would recommend Wrox's Professional Test Driven Development with C#.

Test driven development is not as simple as writing tests before doing the development, but is rather a comprehensive method of developing extremely high quality code, including design patterns, best practices, dependency injection, refactoring, unit testing, integration testing and mocking; knowledge and understanding that every programmer should have.

There is some debate about TDD, although for me it's like this:  If you're developing something extremely simple for your own use, you don't need to worry about TDD.  If you're developing a complex banking application that processes billions of pounds, you absolutely must use TDD.  Everything in between requires the programmer's knowledge and experience with TDD in order to make the right decision.

You should know about DDD (Domain Driven Design), and ensure you understand principles like SOLID, YAGNI and DRY.  Depending on the type of development you're going to be doing, you may also wish to look into document databases (e.g. MongoDB).  Modern distributed applications might use micro services, message queues (like RabbitMQ) and cloud computing (like Azure or AWS) so check those out.  If you're doing web development you should understand the MVC pattern, and for WPF development you should understand MVVM.

Learning a new programming language or skill.

Consider the following two approaches to learning a programming language:  The first is to read the entire manual and the other is to learn the basics and then look up how to do things as you go along.

I have tried both of these approaches and, well, the best approach is probably somewhere in the middle.

The problem with trying to learn an entire programming language is that programming text books are typically around a thousand pages.  It takes a lot of work to digest all of that information.

On the other hand, trying to learn a programming language on the fly may cause you to miss out on some fantastic features of the language that you've never heard of before.

The following is my method of choice:

I accept that learning a new language is a big task and set myself a reasonable goal for how long I'm going to take to learn it.  Then I find a book which teaches by having me build a project as I learn.  Learning programming requires lots of practice, so you can't just read it and expect to remember everything.  If one is lucky enough to be working with the same language that one is learning, then it is perfect for remembering information.  If not, one should probably work on one's own project which requires the skills being learned.  I also like to spend some time on stackoverflow.com, a very useful resource for programmers, but instead of asking questions, I try to answer questions on the topic that I'm learning.

Learn about the industry you want to work in.

While I don't consider this as important as the previous two topics, it can be very important in certain circumstances.  For example, if one wants to work as a games developer one will need to do some research to find out what skills are required for the jobs that are available, and then make a decision as to whether or not it's worth the effort to make yourself marketable enough.

If you don't really care about the industry, then do start researching as soon as you get an interview or find out which industry you may be working in.  It will help you a lot in your job if you know a lot about the company you work for and the software which they develop.

Ongoing learning.

Programmers have to constantly keep up to date with the latest in software development.  I'd recommend subscribing to news about your area of interest, and setting aside some time every week or two to find out what's new.

And finally, ...

... please learn how to type :)

If you're going to spend your entire life typing every day, you really need to do it properly.  Get a cheap program which teaches you to type, and if you like you can get a game like Typing of the Dead.  Typing of the Dead is an addictive game where you have to type quickly in order to kill the zombies.  It's good fun!


Images:

1. Courtesy of jscreationzs at FreeDigitalPhotos.net
2. Courtesy of adamr at FreeDigitalPhotos.net
3. Courtesy of David Castillo Dominici at FreeDigitalPhotos.net

Thursday 22 November 2012

How to Focus on Programming

In order to become a master of programming one needs knowledge and the ability to focus while putting that knowledge into practice.  I will begin this blog by teaching you how to focus, and then move onto knowledge.

Focusing your entire consciousness on what you're doing is essential for any job that requires intelligence.  Not only does focusing give you the ability to be more productive, but it also helps you enjoy your job and reduces stress.

In order to learn how to improve my concentration,  I looked for books on the subject.  It seems that most books on concentration come from Eastern religions and are more about meditating than learning to focus at work.  I was looking for something a bit more scientific.  I read a book called, "Can I Have Your Attention?: How to Think Fast, Find Your Focus, and Sharpen Your Concentration."  Unfortunately the book seemed to be more for martial artists, and other people who need to think quickly, rather than those who need to solve complex problems.

Having read a number of books on thinking and the mind, and having fourteen years of experience as a professional programmer, I think that I can share some good advice.  Hopefully reading this will be more efficient than trying to find a good book on concentration and reading it.


Your sub-conscious makes you think about things by noticing related things in your field of vision.

Pause for a moment, and think about that heading.

Imagine you're in a pitch black room, and cannot see anything at all, except for your keyboard, mouse and computer screen.  Your computer has no wallpaper and no icons.  The only thing you see is your IDE.  This is the ideal environment for focusing on programming.  Your mind has absolutely nothing visual to focus on, except for your work.

Of course it's not always practical.  If I minimize my browser, this is what my desktop looks like right now:


My wallpaper is a pretty picture of the head office of the company I work for.  No, I don't have to have this wallpaper.  I simply put it there to generate a good feeling about the company, encouraging my sub-conscious mind to enjoy and focus on work.

I have loads of programs, but I don't need to see icons for every one of them.  I have only five icons on my desktop, but I never use any of them.  One of the icons is for a tool that I wrote specifically to do my most common work tasks.  I don't use the icon, because I've created a keyboard short-cut for it, which is quicker and easier.

Here are some ways to remove visual distractions, both conscious and subconscious:

- Clean your desk, removing everything that doesn't need to be there.
- Clean your desktop, moving all your icons into a folder, so that your desktop is empty.
- Use a wallpaper that encourages you to do well, or at least doesn't encourage you to think about anything else.

Remove audio distractions

Some people like to write code while listening to music.  If that works for you, then great.  My work environment is quiet enough, I can get into the zone without any problems, but at home I close the door and wear ear plugs.  Technically they're attenuators, also known as musicians earplugs.  I had them custom made to fit my ears, and they cut out most of the noise around me.  Not all though, as they're really meant to limit loud noises, rather than eliminate all audio.

Remove internal dialogue distractions

I find the most difficult time to concentrate is after I've had a controversial discussion.  My mind seems to get excited and not want to think about anything else.  This is why the best time to program is after sleeping, when your mind is empty.  Here are some suggestions:

- Never do anything too interesting before work or during your lunch break.
- Don't check your Facebook / personal email during work time.

I suppose I could summarize the above by saying that up until you leave work you should have a very dull existence... this will allow you to enjoy your programming more, while not thinking about anything that could be more interesting.

Remove excitement and anticipation distractions

One's mind seems to work in a relative sort of way, meaning that the more excitement you have in your life, the less exciting programming will be, and the less excitement you have in your life, the more exciting programming will be.

If you have to do something which is mentally exciting then you need to separate it from programming.  Do it somewhere completely unrelated to work, and at specific times which are not near to programming time, and especially not before programming.

- Don't use your work computer or environment for anything which is too exciting.  Your mind will relate your computer / environment to that activity, and try to get you to do that instead.
- If there's something your mind keeps thinking about instead of what you want to focus on, learn how to make decisions and decide not to think about that at all, or try and understand why you're thinking about it, and remove the cause.

Remove physical distractions

- Get enough regular sleep (seven and a half to eight hours).
- If you're tired, lie down for ten to twenty minutes.  It doesn't matter if you fall asleep or not - the break will help.
- Eat if you're hungry, but...
- Don't eat a big lunch unless you're planning to have a nap afterwards.  Work out how much you can eat without feeling tired.

Remove interruptions

A tiny interruption could send your mind down a different path, costing you minutes of development time.

- Switch off any real time messengers, like Skype.
- Close Outlook
- Unsubscribe to any emails you don't need.
- If you have a fancy email client, use it to write rules to automatically recycle emails which aren't important.
- Switch off your phone

(Basically switch off anything that could interrupt you.)

Set specific times of the day to read your work email, for example, every three hours.  Read all your emails, respond to all of them, and then close your email client.

Be healthy

I've always been pretty healthy, so I don't have much experience with this, but these are the things that experts always say, so here I'm just writing down whatever sounds right :)

- Get regular exercise (something like jogging)
- Eat less sugar (reducing the amount of sugar you eat actually makes things taste sweeter)
- Eat a high fibre breakfast
- Don't smoke, take drugs, or do anything that is addictive and could distract you from your work
- Don't drink coffee - rather get enough sleep
- Don't drink too much alchohol

Focus@will

There's a website at https://www.focusatwill.com (and no, they didn't pay me to mention them).  They have some music that you can listen to which is supposed to help you focus.  You specify the amount of time to play for, which is a neat way of specifying how long you intend to focus for.  I like using the ambient music on their site to focus.  In other words it does actually work for me.  Whether or not it will work for you, I don't know... no harm in trying.

As always, any thoughts?  Agree?  Disagree?  Questions?  Let me know :)


Images:

1. Courtesy of Maggie Smith at FreeDigitalPhotos.net
2. Courtesy of imagerymajestic at FreeDigitalPhotos.net


How to reduce complexity and know everything.

Quality We have a great QA. His code is like a Rolex. You look at his gherkin, and smile.  It says what it's testing, in plain English, ...