Stop Agonising Over Tiny Details

I recently started a new side project using React and – having not used React in anger before – wanted to get off on the right foot.

And by “on the right foot” I apparently decided that I meant “with the perfect folder structure for my code”.

Obviously we can all agree that folder structure is the most important predictor of code quality  (<sarcasm/>) so I spent hours agonising over whether to separate  components from screens or whether to group all actions together in an actions folder and a hundred other basically-irrelevant details. I read blog posts. I tried template project generators. I poured over a huge number of “sample” GitHub repos (every one different, of course).

To reiterate: this was for a new, greenfield side project. I spent hours of my limited time worrying about where to put all the code instead of…writing any of that code!

facepalm

Hence this post. This post sits here as a reminder to myself to STOP AGONISING OVER UNIMPORTANT THINGS.

And you know what? I changed the entire structure after a week anyway.

Advertisements

Finding Freedom in “JavaScript Fatigue”

A lot of people have spoken about “JavaScript fatigue”: the idea that there are so many new frameworks, tools and ideas available to the average JavaScript developer that it’s impossible to keep up. I thought I’d add my opinion.

When I started learning JavaScript it used to be that I would try to keep up with everything. I suspect now that I just didn’t know how much was out there, but it really felt like that was an acheivable target. I would make a real effort to not only read up on new frameworks & libraries but to try them out: maybe a quick tutorial, maybe a few introductory posts, maybe even a small project.

Now, things have changed and it is obvious to most of us that there is no way you can invest that much time in every new thing that comes out.

For me, this is not a bad thing. In fact, I find it pretty liberating.

The whole situation reminds me a little bit of when I first joined Twitter. I was following maybe 20 people and I would make a real effort to read every single tweet. Ridiculous, right? But still I tried. Then I started following more people and then more people and with every extra piece of content it became less and less realistic to get through everything.

So I let go. I had to.

I couldn’t keep up with everything so I stopped trying to do the impossible and learned to let the mass of information wash over me. If something particularly catches my eye then I can read up on it but if I miss something? Who really cares?

Nowadays it feels the same with JavaScript frameworks. I may never have a chance to get my hands dirty with everything that comes out. In fact, I may never even hear of some of them. But I don’t worry any more about trying to keep up and if something really is the next big thing… well, I’m pretty sure I’ll hear about it soon enough.

Microsoft Band 2: Micro Review

I, like most of the human race, started 2016 with an an absolute conviction to improve my fitness and I, like a decent percentage of people, decided that the best way to fool myself into following through was to invest in a fitness tracker.

I had looked into various options in the past but never really felt that there was a product out that there that ticked all the boxes.  When Microsoft released the second iteration of their fitness band – promising sleep monitoring, GPS run tracking and more sensors than I know what to do with – I thought it was time to take a punt.

I have now been using the Microsoft Band 2 for two weeks and felt it was about time to share my thoughts.

Comfort

My biggest concern with any fitness tracker was always that it would not be comfortable enough that I would actually wear it.  The first couple of days after switching from a traditional watch certainly felt a bit strange: the band is bulkier than anything I had worn before and would quite often get caught on cuffs, but it didn’t take long before it felt pretty comfortable.

The Microsoft band has been designed so that you wear the “watch face” on the inside of your wrist and once you adjust to this it feels very natural.  The alignment of the text (being wider than it is tall) is almost impossible to comfortably read with the face on the outside of the wrist and it takes very little time to adjust.

You can have the watch display on constantly but I have gone with the “rotate on” mode where you flick your wrist to light up the display.  This works well but has a little more delay than I’d like when quickly checking the time.

Sleep

Sleep tracking was one of the key features for me as I have always been interested in the quality of my sleep.  The Microsoft Band promised to deliver in-depth monitoring as well an “optimum wake up” alarm and so far I have been very impressed.  The app (running on Android) gives genuinely interesting feedback on how I have slept every morning, along with recommendations on how to improve the quality of my rest (e.g. “you are taking a long time to fall asleep; try avoiding mental stress late at night”).

The alarm appears to work very well; I have not been using it for too long but so far it seems to wake me up when I feel more awake than would a normal alarm.  It also has the significant benefit of being silent – you are woken up by the band vibrating on your wrist – which has proven very popular with my wife when I have an early start!

Running

Many years ago I treated myself to a Garmin GPS watch for running.  It was about the size of a small matchbox strapped to your arm and came with a chest strap to track your heart rate whilst running.  At the time it was very impressive and I probably shouldn’t be surprised that the Microsoft Band has improved upon 5-year-old technology, but the step up seems very marked.

The band tracks your heart rate, pace, distance (with or without GPS) and gives you up to 7 customisable data points on your wrist while you run.  It seems pretty accurate as these things go, and the feedback – both live and through the app after your run – is useful.  It integrates with various other apps like RunKeeper and MyFitnessPal as well, so your pace, distance and calorie burn records are still all replicated where they always were before.

A couple of tips for the first time you go out though: firstly, wait for the band to get GPS lock before you hit the road.  It will tell you that it can pick up GPS as you run but has not managed to do so over a quick 5k for me when I tried.  Secondly, I would recommend avoiding long sleeves when running.  The inside-of-the-wrist setup works very well if you’re in short sleeves but trying to pull you sleeve up to view the numbers on the inside felt very uncomfortable when I was out running.

Smart Watch Features

Compared to things like the fitbit or jawbone offerings, the Microsoft Band has a number of smart-watch-esque features that seemed pretty tempting to me when I bought it.  You can have SMS, emails, call, calendar and other notifications delivered to your wrist over bluetooth and generally this works really well.  If you turn on “other notifications” it can get a little bit silly – on one occasion I received by-the-minute updates on the charging status of my phone – but you have the option to filter which apps are able to push notifications to the band so you can make it useful.  It’s a nice feature to have when there is no native support for things like whatsapp or slack: you can still get the notifications on your wrist; you just lose the ability to reply.

For things like calls, SMS and email the ability to send canned responses is surprisingly useful when sat in meetings.  You can customise the available replies and – if you really want – you can even type out custom responses with an on-band keyboard (though I wouldn’t recommend it for anything more than a word or three).

The only issue I have with the smart watch functionality is that it seems to make a real difference to the battery life.  It’s nice to have, but I bought this as a fitness tracker and find myself turning off the extra features to get a few extra hours of power.  That leads me on to…

Battery Life

Microsoft advertise the Band 2 as having 48h of battery life and whilst I wouldn’t say this is completely off the mark it does seems a little generous.  If I have the smart watch features turned on then I am lucky to get a day and a half of wear out of it.

With my phone I have fallen into the pattern of leaving it on charge overnight but the complication with the band is that I want to be wearing it overnight for the sleep tracking.  This removes the natural time that you would charge the device and makes the planning of charging a bit of a challenge.

What makes life a lot easier is that the band charges incredibly quickly.  It only takes around half an hour to get up to full charge from close to zero so I find myself falling into a pattern of plugging in the band whilst I get dressed in the morning.  Couple that with the odd ad-hoc charge at my desk and I’ve not had any real down time.  As a system it’s just about working, but it does feel like I may be missing out on some of the features in the interest of keeping the thing running.

Summary

Overall I’m very happy with the band and would gladly recommend it.  There are a couple of rough edges to be smoothed out but they don’t take away from the core functionality of  a fitness band and for that specific job it is doing everything I can ask of it.

The integration with other apps is nicely done and works very well.  The API for the cloud data store looks promising as well, though that is an investigation for another day…

Learn through Doing

Tell me and I forget. 

Teach me and I may remember.

Involve me and I learn

Everyone learns in their own way but I have always believed that the best way to learn anything is to try it out. Try and fail, if necessary – failing is only learning that your current approach doesn’t work, as Edison might say – but the important thing is to try.

I find this to be particularly to true with technology: new languages, new frameworks or new concepts. I can see the value in courses and tutorials but I always find that a technology only really feels familiar to me once I have used it in to do something real.

The trick, then, is to find a way of using that exciting new technology you desperately want to learn…

Use it in your Day Job

Where do you do most of your development? Exactly. So if you want to learn AwesomeNewFramework then consider whether or not it would be of use to your company: perhaps it adds something that you can’t do today, or improves on the processes you currently use.

Obviously this is not always possible. Almost all software companies will have established technologies and established products, so changing to a new framework or language is not always practical. People have to be trained, products have to be updated…it might not be worth the effort for an uncertain benefit.

So if we assume that we can’t use it at work, how can we find another project to learn with?

Have an Idea

Working on personal projects or side projects is – in my opinion – always a good idea for any developer. Doing all of your work in a single project or in a single language is a recipe for stagnation.

If you have a great idea for a project and you want to learn a new technology then it is a double benefit. By having a real-world problem to solve you will immediately be forced to look deeper into the technology than you would during any tutorial or course. If someone is walking you through a prepared problem then the information is just handed to you: you may learn how to use function X(...), but you likely won’t learn why you should use it over Z(...), what happens when you leave out the optional parameters, and why the bloody thing won’t work when you need it to!

When you are trying to solve a specific problem you almost-inevitably find a deeper understanding of the code on which it relies.

For me, side projects are always my preferred way of learning. A personal project has no existing structure to confuse or to be misunderstood; it has no limits on what it does or how it works besides those that you decide. Once complete, you – the author – know the story behind every line of code and every design choice.

The only problem is that it does rely on having an idea. Coming up with ideas that are both useful and will not take too long to create is often a sticking point, so how can we come up with real-world scenarios from which to learn without that creative spark?

Solve Someone Else’s Problem

A great way to learn is to teach someone else, and one of the many great things about the internet is that it is full of people who want to be taught!

If you are looking to improve your knowledge of a technology but you don’t have the time to take on a whole project, take a look on Stack Overflow. You’ll find a long list of other people who ask a constant stream of questions – from beginner to advanced levels – about the framework or the language you want to learn.

Some of those questions will be beyond your knowledge; some you will be able to answer immediately. In either case, try to write an answer.

It doesn’t matter if there are already answers, or if you think you might need to go and investigate for 15 minutes before you can respond: by finding a solution and then explaining that solution to someone else you will automatically be improving your own knowledge. As an added bonus, you might have helped another poor soul on their way to understanding as well!

Wrapping Up

In summary, you will always learn more by tackling real-world problems rather than hand-picked scenarios from a tutorial. Ideally you want to use your own problems, but if you don’t have access to the right kind of project just now then go help someone else with theirs!