National Coding Week is a not-for-profit social movement established to encourage adults to learn digital skills including coding. In celebration of the event, our training team have dutifully whipped up some useful tips. The list is by no means exhaustive - we could easily have provided 100s - but we do hope it's useful.
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 link2
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 Link3
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 Link4
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 Link5
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.
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 Link7
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 Link8
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 Link9
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.
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 Link11
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 Link12
Maintaining good mental and physical health helps make you a better programmer. Find a company that helps you look after yourself.
Twitter Link13
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. dypeScript 4.4 improves this further by remembering this guard information even when assigned to a variable. Medium article
Twitter Link14
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 link15
Never use a lambda where a method reference will do. Method references are simpler, shorter and potentially more performant. Code
Twitter link16
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 Link17
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 Link18
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 Link19
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 Link20
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 LinkGet in Touch
Our training team offer a wide 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.