Kodebits: July 2026—Crossing Fifty! | Kodeco

0
1
Kodebits: July 2026—Crossing Fifty! | Kodeco


The fiftieth Kodebit went out on the first of July, which felt like a reasonable moment to look up and check where we’d got to. Four months of small daily challenges add up faster than you’d think.

July delivered 18 more, and it was the month the three languages started to rhyme. Swift picked up extensions, and with Kotlin covering them back in May and Dart in June, the same idea has now been demonstrated in all three. Swift also got its own take on custom operators, a few weeks after Kotlin’s operator overloading. If you follow more than one platform, this is the month where that starts paying off.

Everything from the month is below, split by platform and running from beginner to advanced, with a line on each explaining why it’s worth your two minutes. Earlier months are collected the same way: April, May and June.

On difficulty, we use three labels — Beginner for something you can answer on instinct, Intermediate where you’ll want to read the code twice, and Advanced for the ones that reward a proper think.

Every Kodebit page follows the same shape: the puzzle first, then the answer and an explanation of what’s actually going on, and finally a few links into the Kodeco library if the topic turns out to be one you want to chase further.

iOS & Swift

Nine Kodebits in July, and the emphasis shifted. Where June was about understanding what Swift already does, July is about extending it: generic functions, custom subscripts, custom operators, and extensions all involve building your own abstractions rather than consuming the language’s. There’s also a nice bookend to last month — June’s struct value copy gets its reference-type counterpart on Day 50.

Beginner

  • Day 50: Class Reference Share — Classes are reference types, so two variables can point at the same instance and see each other’s changes. Read it directly after June’s struct value copy bit and the value/reference distinction stops being abstract.
  • Day 52: Tuple Decomposition — Another pass at pulling a tuple apart into named pieces, in a slightly different setting from June’s Day 37. Worth a look if the first one went by too quickly.
  • Day 54: String Replacement — Swap one substring for another with replacingOccurrences(of:with:). Unglamorous, constantly useful, and a good reminder that the method returns a new string rather than editing in place.
  • Day 63: Extension Method — Add functionality to a type you didn’t write, including types from the standard library. This one completes the set: extensions have now appeared in Kotlin, Dart and Swift, and comparing the three is a quick lesson in what these languages share.
  • Day 66: Designated Initializer — Swift’s initialization rules are stricter than most languages’, and knowing which initializer is the designated one explains a lot of the compiler errors you’ll hit early on.

Intermediate

  • Day 51: Enum Associated Values — A return to enum payloads after May’s Day 28, pitched at the same level but with a different puzzle. Pattern matching on associated values is worth having in your fingers rather than your notes.
  • Day 64: Generic Function — Write a function once and let it work with any type that meets your constraints. The step between “I use Array and Optional” and “I understand how they’re built.”
  • Day 65: Custom Subscript — Implement subscript on your own type so callers can use square brackets. Small feature, big effect on how natural a custom collection feels to use.

Advanced

  • Day 58: Custom Operator — Swift lets you declare entirely new operators, not just overload existing ones. Powerful and easy to abuse in equal measure — set it alongside June’s Kotlin operator overloading bit and the trade-offs get clearer.

Android & Kotlin

Six Kodebits in July, and Kotlin took the difficulty crown this month with three of them at advanced. Two of those are really one topic split in half, since reified type parameters only work inside inline functions — read Day 60 and Day 59 together and each explains the other. Elsewhere, scope functions, sealed classes and object expressions cover three of the patterns you’ll meet constantly in real Android codebases.

Beginner

  • Day 67: Scope Function Applyapply runs a block with your object as the receiver and then hands the object back, so you can configure something and assign it in one expression. Properties are reachable without any qualifier inside the block, which is what makes it read so cleanly — and it’s the gentlest way into Kotlin’s family of scope functions.

Intermediate

  • Day 57: When With Sealed Class — When a when covers every subclass of a sealed class, the compiler knows it’s exhaustive and stops demanding an else. The backbone of modelling UI state properly, and it means adding a new case turns into a compile error rather than a silent bug.
  • Day 61: Object Expression — Create a one-off object that implements an interface, right where you need it. Kotlin’s answer to the anonymous inner class, and rather less noisy than the Java equivalent.
  • Day 62: Partition Collection — Split a collection into matches and non-matches in a single call, getting both halves back as a pair. The one to reach for when you were about to write filter twice with opposite conditions.

Advanced

  • Day 59: Reified Generics — Kotlin normally erases generic type information at runtime; reified keeps it, so you can actually check and use T inside the function body. The trick behind a surprising number of library APIs that feel like they shouldn’t be possible.
  • Day 60: Inline Function — Marking a function inline copies its body to the call site, avoiding the object allocation a lambda would otherwise cost. It’s also the prerequisite for Day 59, so this is the one to read first.

Flutter & Dart

Three Kodebits in July, all circling the same practical question: how do you get values into and out of a function or a constructor cleanly? Named parameters and arrow returns are the two features doing the most work in any Flutter widget tree, and the factory constructor is the one that unlocks the patterns behind most fromJson code you’ll ever write.