Pages

Subscribe Twitter

Tuesday, 13 June 2017

Creating libraries and .NET Standard

As part of his fantastic 'What is .NET standard' presentation at DDD12, Adam Ralph provided an amazing amount of detail in such a short amount of time. One of the most valuable points, which is completely obvious when you think about it, is how you should work with .NET standard when creating libraries.

NET standard now comes in a multitude of flavours: currently 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6 and 2.0. When starting out with something new, we (as developers) often want to be as cutting edge as possible and probably haven't read the small print / finer details. So as a result, when creating our first .NET standard library a natural tendency is to create it targeting .NET Standard 2.0. Of course, that makes perfect sense - it's the newest so must be the best? It's definitely true, it is the latest and has the largest .NET framework coverage. BUT, and it is a big but. The library you are building can now only be used by other libraries targeting .NET Standard 2.0 (and newer). If the consumer of your library wants, or must, target .NET standard 1.6 (or older) then they will be unable to use your library due to this version incompatibility.

Therefore when starting a new library targetting .NET standard you should always start with targeting 1.0 and only increase the targeted version when you run into an unsupported framework call. If you are able to create a library that can target .NET standard 1.0 you should be really happy, it has the highest level of compatibility and will make your library's consumers lives much easier.

Like I say, when it's highlighted it makes perfect sense but I'm sure we've all seen that "Target .NET Standard Version" dropdown and wondered "When there's 2.0, why would I ever consider anything 1.x!"

Saturday, 18 March 2017

Know your frameworks, never stop learning!

Last year, as part of a series of posts, I asked "Are you investing in your own career?". This, in part, came about from a great quote that heard:

Do you have 10 years experience, or 1 year's experience repeated 10 times?

I think the majority of developers starting out are fired up and excited every day. Everything is new, everything is a challenge. Just getting something to work, no matter how, is a success.

It can also be amazingly frustrating and tiring to be constantly learning and actively building your knowledge / skill-set. It's probably not a surprise therefore that it is so easy / appealing to back off a little bit for a break once you have learnt enough to satisfy the day job. Similar to over training in sport, it's probably even a good idea - no one can do anything flat out indefinitely.

But what happens when you just continue backing off? The hard truth is, rather than continuing to build your experience, you do slowly start to fall into the trap of just repeating the same year over again. Yes, in the second year, you feel more productive in that your starting point is higher, but for the most part that's it - you don't really become any more productive or learn anything new over the course of that year.

So what's the solution? I personally think the answer boils down to these two points:

  • Know the frameworks that you are using inside out, and
  • Continue learning new stuff like you're a junior developer again.

If your company / team uses Entity Framework, Angular, 'insert any framework here' then read up about it, try new things to see what else it can do. Maybe even schedule a team hackathon to learn together. But don't stop there, look at the every day stuff you use all the time. Are you just scraping the surface of C#, ObjectiveC/Swift, Java or what ever language you use in your day job? Look at the "What's new" for each release, find blogs, podcasts, etc to help widen your net of information.

Pick something new to learn, maybe native mobile development (if you're a web developer) or a completely new language (F# if you're an accomplished C# dev). Maybe even look at a common time sink in your day to day coding and look to see if there's a new or different framework / methodology that would improve your and your team's productivity.

No matter how many races a runner may have won in the past (and records they've set), if they've stopped putting in the training miles then they should expect to be beaten in a race by someone who is committing the effort and is, therefore, better prepared. Being a developer is no different - but it is our brain, not our legs, that we must be constantly training to stay 'match fit'.

Saturday, 11 March 2017

Accessing a "Class Library (.NET Standard)" from a "Console App (.NET Framework)"

If you're trying to access a class library (.NET Standard) from a traditional console application (in VS2017 those can be found under 'Windows Classic Desktop') you will run into problems; which can feel a little strange for something that was pretty simple in VS2015 and earlier. You can add a reference to the class library project (Resharper will even volunteer to add the dependency / namespace reference if you don't already have it). But the code won't then compile, it will complain that it can't find the namespace referenced in the using and it also won't be able to find any of the objects that you reference in the class library. Took me a bit of figuring out but you need to open up the properties for the class library project, look at the conditional compilation symbols in the build tab (it might be something like 'NETSTANDARD1_4'). You need to take this symbol and duplicate it in the build tab of the console application. You should now be able to rebuild your solution and if you have other code errors, etc the solution should now build.

Saturday, 4 February 2017

Review of Bose QC35 Headphones

Working in software development, a decent pair of headphones is a must. I've lost count of all the pairs that I've owned over the years! I've had some really good wired pairs but they've tended to die an early death when kicking my chair back to scoot across the office to speak with a colleague and forgetting I have them on my head or round my neck. I did try wireless headphones once before, a pair of Sony's but the limited range, background noise, poor battery life and tendency to suffer from interference sadly had them quickly relegated to the cupboard. After trying a pair of QC-25's in the office and being impressed by their sound cancelling functionality I decided to splash out on the (at the time) newly released pair of QC-35's.

So I've had them for a while now and have been meaning to write a review, which fits in nicely with a new year's resolution to update my blog a little more regularly than I've managed over the past couple of years. In a nutshell I love them and whilst I hope that they survive many more years yet, I would replace them with another pair at the drop of a hat if anything was to happen to them. Yes they are expensive, insanely expensive for a pair of headphones but if you use something every day it's probably worth splashing out on getting something amazing.

  • Sound Quality: There is almost no background noise at all and I've yet to suffer any interference from other sources. I'm really happy with the overall sound quality too. Whilst I've not done any technical tests they sound as good or better than any other headphones I've owned.
  • Comfort: For me they've got this spot on, they neither over grip your head nor move around because they're too loose. Most of the time you can almost forget you're wearing them. I wear glasses and some headphones just never fit right or squeeze the glasses into your head and in the worst case start to hurt after an hour or so. I've worn my QC-35's all day and not suffered this problem or got too hot (another common problem of over ear headphones).
  • Wireless Range: I've read several other people saying how amazed they are with this. For Bluetooth the range is amazing, I can walk around our open plan office with no problems. Like wise I can walk around most of my house too, even going between floors. Depending on how many walls / floors the signal has to go through I can get about a 8-10 meter range.
  • Noise Cancelling: This can be so good it's a bit worrying when someone makes you jump as they want to speak to you. We've had building work going on next door to the office and I've only become aware of it as I've taken my headphones off. In fact, the noise was so loud at that point I wondered how any of my team were managing to concentrate / work. For this reason alone, if you need to concentrate in your day job I would suggest you invest in your career by buying a set!
  • Battery life: Never been a problem. I do hook them up to charge on a regular basis but I've never had a point where I've not been able to use them because they've been out of charge / on charge. The battery life is just at the right level that you never need to think about it.
  • Value for money: They are expensive, there's no getting away from that fact. But as I said earlier, if I need to replace them, I would straight away. It's probably fair to say I can't hear a difference between these and a much cheaper (£50-£100) pair of wired headphones, but these are wireless and sound cancelling. They also aid focusing on tasks whilst at work, which for me makes them a worth while investment.

Sunday, 29 January 2017

Why do my Android Notification only appear in the status bar?

I'm definitely getting back into Android development, I'm remembering that feeling of 'Surely this should be easier than this!'. All I wanted to do was to schedule a local notification which behaved similar to a push notification pop-up. That is, as well as showing the small icon in the status bar I wanted it to pop up on screen to notify the end user. All seems fairly easily, I found this code for how to schedule a notification. That all worked perfectly, apart from the notification would only appear in the status bar. Searching around I found loads of different answers / solutions, mostly all saying the same thing:

  • It only worked if you used 'NotificationCompat.Builder' in place of 'Notification.Builder', or
  • You had to set the priority to 'NotificationCompat.PRIORITY_HIGH'

As usually happens, none of these solutions worked for me until I added in the missing piece of the jigsaw:- '.setDefaults(Notification.DEFAULT_ALL)'. For me this fixed the problem, the scheduled notification began to pop up on the desktop as expected! Looking into the Android documentation for this method nothing seemed to make sense as to why it would change the behaviour of the notification. As the documentation made reference to default sounds I replaced the call ".setDefaults(...)" with ".setSound(...)" and tried again. Again, the notification behaved as desired and appeared as a pop-up. Not making calls to either of these methods resulted in the notification reverted back the undesired behaviour of only appearing in the status bar. Adding either or both of these calls back in caused the desired behaviour. I'm still not completely sure why at the moment, but adding a sound to the scheduled notification sorted the problem out for me.

These 'pop-up' notifications are called “Heads-up” notifications and were introduced with Lollipop (v5.0).

Saturday, 14 January 2017

Links for starting out in Android development

A recent discussion at work made me realise that over the past few years learning Android development I've managed to build a short but very useful list of links for starting out. Not a really detailed post this time around, but hopefully these links help at least one person, let me know!

  • Development environment: We started out using Eclipse, but now feel that there is only one IDE to learn, Android Studio 2.x
  • How to documentation: This has always been a big struggle, much of the information that you can find is quickly out of date and potentially incorrect. Luckily a team of volunteers have set up the Codepath Android Cliff-notes as a Github wiki. This team have also recognised the difficulty faced by many starting out with Android development and have put together a list of articles tackling everything to do with Android development and are maintaining that list to ensure it is regularly reviewed / updated to keep it relevant and useful. I really wish I'd found this when I first started out.
  • Training videos: At my company we all have Pluralsight subscriptions (well recommended). I can recommend the course by Sriyank Siddhartha. Again, everything ages with Android really badly so these articles were useful around 2016/7.
  • More detailed videos: The Android development team at Google put together a great YouTube channel. These videos are usually really in depth but require a little more than entry level knowledge to get the most from. Either good to watch to get a feel for what's available or coming back to when you need to tackle a particular problem.

That's all, enjoy learning Android!

Tuesday, 15 March 2016

How to stand out in a phone interview

I can still remember my first phone interview for a job. I had no idea what to expect so really wasn't looking forward to it, but it can't have gone too badly because I got the job. Now that I've been lucky enough to progress in my career to positions where I'm conducting the other side of the phone interview I've been quite surprised how little it takes to stand out from the crowd:

1. Be Prepared
When booking the interview, consider how much time you'll need to get to where you can comfortably take the call. When the interviewer phones you'll want to be nice and relaxed and able to take the call within a couple of rings. If you're struggling to find your phone, not drop any paper work or find a place out of the wind / pull over in your car you will already be putting yourself on the back foot.

2. Smile when you speak
Don't sound like you've just been called at 6am on your day off! When you answer the call make sure you sound happy and show that you are looking forward to speaking with the interviewer. They may have lined up several phone interviews that day and if you're the only one that sounded happy / pleased to speak with the interviewer; guess who they are going to remember!

3. Show that you were expecting the call
At the very least you should try to say "Hello, {{your name}}", even better say "Hello, {{your name}}. Is that {{interviewer's name}}. It's good to remember that the interviewer has been given your number from the recruiter and is probably hoping they've got the right number (it does happen) or they've entered it correctly (also can happen). By doing this small thing you are both helping the interviewer and showing that you were expecting their call. You're also helping to sell yourself from the outset in showing that you would be a great representative for the company if you were to be successful.

4. Expect a bad mobile signal
Technology is great, but chances are the phone company will wait until just before your interview to take the nearest mobile transmitter out of service. If the signal is bad, don't try to make do during the call, acknowledge the problem to the interviewer; ideally offer an alternative number (land line / skype) to use instead or just to try reconnecting the call (it's amazing the number of times that cures the issue). If you are answering a question with a long answer, make sure you give chances for the interviewer to confirm that they are still on the call.


And there you have it, just 4 really simple points to standing out in a phone interview; but please remember that sometimes you can do this and more and still it just won't be your day!