Tag: developer

Moving from IntelliJ to VS Code

Moving from IntelliJ to VS Code

Change is hard, and it’s always harder if you’ve been using ‘X’ for years.

I’ve been using IntelliJ for a number of years now, and it is great! It really is, and there is no reason other than cost not to use it. If cost is not a concern then use IntelliJ.

Keyboard shortcuts

You’ve spent years in one IDE, your fingers just know where to go, what to do. That instinctive physical memory would be very hard to get over. Any change will immediately make you less productive. You’re just not going to do it!

Thankfully the benefit of the community around VS code comes to hand.

Install this and your fingers need not learn anything new!

Unit tests

Next up is testing. I really like right clicking on a test to run/debug it. The below is a partial solution (right click to debug fails)
This requires two extensions to get it to work.

1 – Test Explorer UI

This gives you the side panel where you can see your tests – but you will see ZERO tests in here to start of with. You need to install one more extension.

2 – Jest Test Explorer

Install the below and you will now see your tests in a panel inside VS Code

You can see the list of test now inside the Test explorer.

As yet, I’m unable to get ‘debug’ to work. I can debug the entire suite of tests via a config command, but not a single test via the context menu.
This is really annoying… I’ll come back to this if/when I figure it out.

Coverage

Next up is coverage mappings. You’ve run your tests, added the coverage flag and you want to see where in the code you are missing coverage.

WARNING/TIP

I found that after I had installed the above, ran my coverage that nothing was being highlighted. After messing around with configuration for ages, restarting IDE etc and getting nowhere I disabled (not uninstalled) the previous extensions ( Jest Test Explorer and Test Explorer UI). After another restart of VS code, hey presto it worked!!!
Re-enabled the Test extensions and now all the extensions where working.

Not as pretty as IntelliJ, but it’s better than nothing. The colours can be customised, so this could be made less jarring on the eyes.

Code formatting – Prettier

Looking for auto format to a standard format that is widely accepted? Prettier is the way forward for many reasons. Install the above followed by a couple of config changes and your code will be beautiful.

Go to your settings, filter by ‘save’ then update to settings shown here.
“Format on Save” – True
“Auto Save” – onFocusChange

Intellisense

Lastly, this is a bundle of other extensions that enable things like autocomplete of filenames, autocomplete of imports. This type of hints and flow should be automatic and is there from the outset in IntelliJ. So getting the same here is a must.

Close enough…

So now that I’ve installed all of these extensions I’m really happy with VS Code. Sure it’s not as good as IntelliJ – but VS Code is FREE.
So if you want to mess around at home for some personal projects, this is brilliant.

What would I teach myself?

What would I teach myself?

I’m sad right now. Why?
Well many months ago, when looking forward to this week coming, I expected to be getting myself all worked up. Tonnes of nerves, excitement, anticipation etc. Yes I was meant to be at the seriously good React Finland Conference, doing my first talk!

But, as with everything right now, Covid-19 is putting the best laid plans to the side. Off course all going well I’ll get back to Helsinki another time. Beautiful city and having been twice already I’ve got some great memories already. Anyway I digress…

View from bridge in Helsinki
View from one of the bridges in Helsinki

“Notes to my younger self “

Yes that was the title of my talk – “Notes to my younger self “. So what exactly would I try to teach myself if I had the chance?

Abstract –

Want to hear about getting the most out of the company you are in, whether it’s a dead end job or perhaps the company are on the brink of sinking into oblivion? Maybe you’ve hit the apparent jackpot and are working in the most fantastic start up – is it though?
It’s also about you! Listen to this talk and hear real life lessons on why Monday mornings are not painful, but are instead something that can be looked forward to.
And of course the code, all those things I’ve done or not done over the years – would I do it all again the same? No!

To much there for a single post, so I’ll see if I can break them up into various posts.

Where to start???

Context is king. So where have I gained my knowledge from? Here is a super brief outline.

  • First 9 years of being a developer – 12 companies.
    • First few were permanent roles, later ones were as a contractor
  • Worked in games industry, creative and business sectors
  • Been in tiny start ups, and huge multi million pound teams
  • Had privilege to work all over the UK and further (not a fan of the sun, but warm countries in winter, yeah I’ll take that again 👍)
  • Last 8 years, been in one company, with the ability to swap teams (essentially new job, but with same employer)

The Start

I’m going to go back to a point where I wasn’t even thinking about work!
This doesn’t matter whether you are self learning, evening courses, formal university or other means to learn to code. Find something you enjoy, make it your pet project, create it, develop it and use it for your CV.

This will be your best friend when you go looking for a job. If I was to interview two people and one had a demo and a degree (lets say a 2.1) and someone else only had a degree, but it was a 1st. Who’d I hire? The one with the demo (providing it was good 😉).

Why? Enthusiasm and a passion will trump pure head knowledge any day. If I can see your code, I can see how you think and how well you’ll fit into a team. Coding more often than not requires team work. Working on your own, being the sole developer has it’s place, but on anything substantial you’ll have to share responsibility.

For me, I created a 3D racing game for the playstation (yes this was almost 20 years ago now). It got me a number of interviews with games companies. I can still recall my first ever interview, with Rockstar North – for a role with creating GTA! Man did I screw that interview up!!! That’s for another post! Still it was a learning experience 😎

TIP – avoid super clever code

You’ve spent two days solving a problem, you’ve been in the zone and created a masterpiece, it’s even got multiple levels of recursion in it, so elegant you want to frame it.

Now you’ve solved it – change it! Clever code, or more to the point masterpiece code, no one will be able to debug it or follow it, other than you (only after getting back into the ‘zone’).

This is why if you are one of those really clever coders that can name and use ever pattern under the sun, think about those that will follow. It’s a team effort, code must be readable/maintainable. If it’s such a masterpiece then highly unlikely to be either of these things.

We’ve all been there and we can be proud of our creations, at the time the code makes complete sense. But pull your colleague over and get them to scan it. How many attempts did it take them to understand, if at all without you telling them what each part does?

I’ve done it before, had a senior dev come over and polity tell me to change it. Was I annoyed – yes a wee bit. Was he right? Yes, completely.
Creating the ‘masterpiece’ wasn’t a waste of time though. It will give you a deep understanding of the issues and as in my case the refactor was a fairly painless exercise. End result, clean maintainable code.

Getting back to your personal project for demo purposes. Test Test Test.
It’s the phase of our times just now, but it applies to code as well as covid! Maintainable code will be tested, can you write tests? Show you can. Take time to test, doing so will get you a job and a good job at that.

If an employer isn’t interested in testing, you are going to be in for a rough role. Beggars can’t be choosers with your first job, but you’re going to want to leave there pronto.

Next post

I’ll cover my experience in my first role, which was very much less than ideal for a range of reasons. Enjoyable and not at the same time. Find out more here