DevTernity 2022 - Session 1 - Simple and Powerful Things That Work for Me by Jakub Nabrdalik
Speaker

Jakub Nabrdalik
Solution Architect, Developer and Mentor at Bottega IT Minds, ex-Head of Software Development @ 4Finance
There’s a surprising lot of best practices that are irrelevant in practice. There are also those that do not sound like much, but I use them every single day and cannot imagine how I would deal without them. This talk is about those silent game-changers. I’ll talk about fixing bugs with a scientific method, how 7 years of implementing and operating microservices changed my observability practices, and how higher-order functions allowed me to not only express what’s important, but also put emphasis on it. And then we’ll talk a bit about neuroscience and how to deal with your own head. Perhaps it will work for you as well.
- 🧠 Key takeaway :: Find out if the work you’re about to do actually needs doing.
- 🧠 Key takeaway :: Work by producing shitty drafts quickly until you’re sure you know your way to a good solution.
- 📽 Slides :: https://jakubn.gitlab.io/bestpracticesinpractice/#1
- 🌟 Rating :: #rating/★★☆☆☆
Setup: Invoice Importer
Customer invoices come in via different channels.
First Step: Prove Validity: Stop writing useless code
New requirement: Upload Excel file with invoices, without needing to perform validations.
If you find out a feature is not going to be used, don’t code it.
- Does it even make sense to automate? How often does this happen?
- What kind of data variation do we need to expect?
- Can we calculate if it might be cheaper to do it by hand? Developers are expensive
- Consider opportunity cost. Could the devs do something more worthwhile instead?
Cognitive load

Infrastructure incurs a cognitive load on the developer: They need to know how to operate the infrastructure, how to code for it, etc. If you add a feature to it, you add more moving parts that developers need to be able to maintain. But since the feature is not used often, that knowledge can get lost easily.

If you extract the functionality to modules, you can split the cognitive load over multiple modules.
Adding feature as separate microservices
- invoice importing
- XSLX upload
- Reporter
Will result in a lower attack surface and lower failure impact.
Always create MVPs
Splitting functionality over different microservices means that you can deploy parts of the whole functionality and make sure that you’re actually building what the shareholders are asking for.
Another benefit is that you will learn things while working that might make future work obsolete.
Best practices before we write the code
📝 Note: I like the idea of collecting best practices to use before actually coding..

Implementation
Backwards programming
Backwards programming helps you think in small steps. Start at the end result, ask yourself how you will get to that point. Then work backwords from that.
Careful: you might get stuck if one of your steps is still too big.
High level design and filling details
First think about how the algorithm would work in a perfect world, then think about how to implement that.
Careful: The real world is much uglier than your perfect world.
Learning by chaos
Before determining which solution you want to implement, just play around with the code. This will give you a better idea of what you’re working with and will shape your vision of an elegant solution.

Multiple drafts
Work like an artist: Create multiple drafts without thinking about polishing one of them to production level code yet. Play around, delete all of it, and try again.
Best practices in coding
- Fuck around for a while, explore possible solutions
- Implement it
- Delete it
- Implement it again
- Get closer, repeat
- Do not be afraid of wasting time! You’re not. You’re learning.
- You are not a printer nor plotter, you learn by making mistakes
- Rewriting an implementation when you know what you want is fast! And most of the time cost is in READING code and thinking, not writing
- When you are good at it, you stop being attached to your code
This is usually quicker than trying to do perfect work the first time.
Takeaways

☝️ Backlinks
No notes are currently linking to "DevTernity 2022 - Session 1 - Simple and Powerful Things That Work for Me by Jakub Nabrdalik".