It is an art form to keep Pull Requests (PRs) small. It’s very tempting to rewrite, refactor, boy scout and reformat the code as you develop but in general, the best developers resist the temptation to change everything at once. They stay on target and get the job done with minimal code changes. Some even compete to have the highest ‘lines deleted’ to ‘lines added’ ratio. If boy scouting and refactoring is necessary, do it separately. Don’t invent excuses for why it’s easier just to shove it all into a single PR — that’s being lazy. …
When designing your methods and functions, start with a suspend function and if you get stuck, change it to a Flow.
Consider this typical function signature for calling a RESTful API.
Such a function is especially common in projects that are migrating from RxJava where we have the concept of a
“This Job has not completed yet” is the error message that gives me nightmares while writing unit tests for my Kotlin Flows. This article describes the typical way I have tested Reactive Streams (
RxJava) in the past and how I tried to adapt these methods to Flow with limited success. It goes on to experiment with the Google recommended method and finally, showcases the best solution I have found so far: Turbine. If you’re just looking for the solution, scroll to the end of the article.
The method I’ve always used for testing
RxJava streams is…
The Why, the How and the What-happened-next.
Late last year, I decided to swap my main development machine away from OSX and MacBook Pro to a custom-built PC with Ubuntu. The following is a narrative about why and how I decided to make the switch, my journey and some answers to some of the questions I had when I started out. I hope you find it useful and let me know if you decide to go down the same route!
Just a quick note: this is a subjective narrative, not a technical comparison. No benchmarking, no hard and fast numbers…
When should I start to worry?
It’s not often you have to worry about backpressure in the average Android App. Events just generally don’t scale on our puny little mobile devices to levels where backpressure becomes important. Not to say that it’s not possible, it’s just not common in my experience. …
callbackFlowbuilder on Android
A short guide on when and why to use the
callbackFlow builder function in Android.
Click on the handsome man below for the full code.
The key to understanding when
callbackFlow is appropriate is to be able to recognise a “callback” in the first place.
Here are some “callbacks” that you use all the time:
If you see “listener” in the code, chances are you are looking at a “callback”.
callbackFlow is a nifty little way to convert these listeners into Kotlin Flows.
But why would you want to do this?
Well, sometimes you don’t! A…
Part 1 explores the idea that every developer should be able to interview candidates and Part 2 explores some more general guidelines for hosting an interview. The third and final part goes into some specific guidelines for creating a technical test for the candidates.
Although these days, I prefer homework assignments, leave it up to the assigned team member to choose their prefered method of testing the technical chops of the candidate. In order to make a good decision that they will stand by, people need to do things their own way.
Still, that doesn’t mean you just give them…
Be sure to check out part 1 of this series to understand the fundamentals of this approach where I argue that interviewing is a skill every professional developer should have under their belt.
Interviewing a candidate can be as scary as being the interviewee. It requires a little training, training that all new members should go through and have a mentor who they can call upon if they get stuck.
Proper Preparation and Practice Prevents Piss Poor Performance. Read their cover letter, read their resume, re-read the application. Read any HR guidelines or documents. Prepare questions. Click their links, Google…
This is the first part of a small three-part series of articles outlining a process for hiring developers. Part one begins with the governing philosophy behind the process, part two goes into some tips and guidelines for the interviewers, and part three looks into the ideas behind the technical tests that are given when hiring.
This is basically a brain dump of many experiences I’ve had over the years, things I liked, things I didn’t like, why some things worked, and what to watch for that doesn’t work. There’s no perfect approach to hiring, but in a world that mostly…
We humans, we’re suckers for a shortcut. It’s so easy to convince someone that there is an easier way when that’s exactly what they want to hear…
German classes are hard, they are a large investment in terms of time and a fair one in terms of money too. You take your chances with the kind of teacher you get, as well as the kind of students you learn with. The size of the class and the length of the course is in direct proportion to the cost. …
Freelance Android Dev. Google Developer Expert. Full Time Remote. Part Time Buzzword Hacker.