Facebook Pixel

National Coding Week Tips Roundup 2021

National Coding Week took place 13th - 20th Sept. To mark this, our training team have put together 20 useful coding tips for developers at all levels. There's something for everyone!


Introduction

National Coding Week is a not-for-profit social movement established to encourage adults to learn digital skills including coding. As coding is our daily bread and butter, our training team have whipped up some useful tips.

1

Most languages now have an online coding console (aka. REPL) where you can enter and run code snippets. This provides an easy 'on-ramp' to try new ideas. Examples include:
Twitter link

2

No programming language is perfect. You can write great software in just about any language. Get good at a language you enjoy. If this has relevance to industry so much the better.
Twitter Link

3

Ensure you leverage your tools effectively - you use them every day! Whatever your IDE, let it do the heavy lifting - learn shortcuts, refactorings etc. This will free you up to spend more time thinking about your code.
Twitter Link

4

Testing, in all its forms, is a separate skill. TDD, BDD, PBT etc... all have uses, but they themselves are only a small corner of modern QA. Exploring this area can take years, so best to get an early start.
Twitter Link

5

When coding in a new language, it’s easy to be overwhelmed. One strategy is:
  • Sketch out a plan for the next function.
  • Write out each part of your plan as a comment.
  • Implement the comments one at a time.
  • Consider refactoring these steps into helper functions.
Twitter Link

6

Any problem involving iteration can be solved via imperative, functional and recursive language constructs. When learning it's great to try all three. Especially the ones you dislike. Never let a good problem go to waste. Code
Twitter Link

7

Nested functions (where available) are a great way to simplify a method. They avoid the issue of complicating the containing class, package or namespace with additional helper functions. Code
Twitter Link

8

Developers spend most of their time wondering why code isn't working and trying to remember obscure commands. Looking things up on websites like StackOverflow (or even official documentation!) is normal and healthy.
Twitter Link

9

When moving to a new language, take the time to research its idioms. For example Kotlin provides:
  • Nested functions
  • Extension functions
  • The 'FP Toolkit'
  • String interpolation
  • A default parameter name.
Code
Twitter Link

10

Focus on code readability. Code spends more time being read than written so always write your code for humans, not for the compiler.
Twitter Link

11

Java, Kotlin and Scala represent Enumerations as objects. This allows them to have built in helper functions (such as toString and values) and enables you to add your own properties and methods.
Twitter Link

12

Maintaining good mental and physical health helps make you a better programmer. Find a company that helps you look after yourself.
Twitter Link

13

TypeScript will automatically change (narrow) the types of your variables by analysing the flow of your program, giving you type safety without lots of typing. TypeScript 4.4 improves this further by remembering this guard information even when assigned to a variable. Medium article
Twitter Link

14

Most developers using FP know you can combine items into a final result via fold (aka reduce). But many functional languages let you transform an initial value into a list of result via unfold.
Twitter link

15

Never use a lambda where a method reference will do. Method references are simpler, shorter and potentially more performant. Code
Twitter Link

16

Broaden your mind. Diversity in thinking makes for better software. Read widely. Learn to spot your biases, and avoid embedding them in your code.
Twitter Link

17

TypeScript (and other statically typed languages) make your life easier, allowing the IDE, compiler and static analysis tools to provide rapid feedback on issues. All that red can be overwhelming as a beginner but over time it becomes a life saver.
Twitter Link

18

Good naming (variables, functions, classes etc) is hard. Spend time getting names right. An online thesaurus and bouncing ideas off colleagues are great tools.
Twitter Link

19

We never want to create a 'family of functions' - multiple functions that differ only in a single aspect. In FP we can refactor multiple implementations into a Higher Order Function. This is simplest when your language supports Partial Invocation.
Twitter Link

20

The Single Responsibility Principle is one of the most important in programming. Apply at all levels of your system - function, class, module, service etc. Wiki Link
Twitter Link

Get in Touch

Our training team offer a catalogue of training courses ranging from language basics through to highly specialised courses. If you are interested in training for your team, feel free to get in touch and a member of our team will be happy to help you.

Article By
Zarah Akilagun-Thompson

Zarah Akilagun-Thompson

Marketing Manager

Related Posts