Wednesday, July 1, 2026

Kodebits: June Roundup | Kodeco


Three months in, Kodebits have discovered their rhythm: small, self-contained coding challenges you possibly can work by between conferences, posted to our social channels as they land and gathered on the Kodebits archive afterwards.

June introduced 17 of them throughout iOS/Swift, Android/Kotlin and Flutter/Dart, and this was the month they began to really feel much less like remoted ideas and extra like a linked tour of every language. Swift dug into worth semantics and sample matching, Kotlin labored by the options behind its DSLs, and Dart leaned on trendy management circulate and collections. It’s all collected beneath, break up by platform and ordered from newbie to superior, with a observe on what each is sweet for — and should you’re solely now catching up, the first and second months are rounded up the identical approach.

Every bit is labelled by problem: Newbie for a straightforward warm-up, Intermediate for one thing to chew on, and Superior after we’re stepping into the deep finish.

Every Kodebit web page provides you the issue to puzzle over first, then an answer and clarification — plus hyperlinks into the broader Kodeco catalogue when a subject grabs you and also you need to go deeper.

iOS & Swift

Eight Kodebits in June, with a transparent thread working by them: worth semantics and sample matching. Structs, tuples, and swap all present up, which collectively cowl loads of what makes Swift really feel totally different from a reference-heavy language like Java or C#. There’s additionally a pair on the kind system — protocols and sort casting — for whenever you’re prepared to maneuver previous the basics.

Newbie

  • Day 34: String Interpolation — Embed values instantly inside a string literal with (...). One of many first stuff you be taught in Swift and one of many final you cease appreciating, because it reads a lot extra cleanly than concatenation.
  • Day 37: Tuple Destructuring — Unpack a tuple’s parts into named constants in a single line. The neat option to deal with a operate that naturally returns a couple of worth with out reaching for a full struct.
  • Day 39: Struct Worth Copy — Structs are worth sorts, so assigning one to a brand new variable makes a replica. Mutate the copy and the unique is untouched. That is the Swift facet of the identical coin as April’s Kotlin information class copy(), and the muse for reasoning about state in SwiftUI.
  • Day 49: Variadic Sum — Settle for any variety of arguments with ... and work with them as an array contained in the operate. The mechanism behind acquainted APIs like print.

Intermediate

  • Day 40: Sample Match Tuple — Match on the form of a tuple inside a swap, testing and binding parts in a single transfer. Picks up the place Could’s enum related values left off and reveals how far Swift’s sample matching actually reaches.
  • Day 44: Protocol Conformance — A have a look at precisely what a kind has to supply to fulfill a protocol. Ties again to April’s protocol extensions: right here you meet the necessities, there you provide defaults for them.
  • Day 45: Lazy Property Init — A lazy property defers its work till the primary time it’s learn, then shops the outcome. Value studying proper after Could’s computed property bit: one recomputes on each entry, this one computes as soon as and remembers.
  • Day 47: Kind Casting Test — Use is to check a kind and as? to downcast safely. Important everytime you’re working with values whose concrete kind isn’t recognized till runtime.

Android & Kotlin

Six Kodebits in June, and brought collectively they learn like a tour of why Kotlin is so good at constructing expressive, DSL-style APIs. Infix capabilities, operator overloading, lambdas with receivers, and delegation are precisely the options behind libraries like Compose and the Gradle Kotlin DSL. In the event you’ve ever puzzled how these libraries learn the way in which they do, that is the month.

Newbie

  • Day 33: Information Class Destructuring — Pull a knowledge class aside into its part values in a single task. The pure companion to April’s information class copy() — between them you’ve obtained most of what makes information lessons price utilizing.

Intermediate

  • Day 35: Companion Object — Kotlin has no static key phrase; a companion object is the place class-level members and manufacturing facility strategies dwell as an alternative. The idiomatic dwelling for stuff you’d attain for statics for elsewhere.
  • Day 38: Infix Perform — Mark a operate infix and name it with out dots or parentheses, so 1 to "one" reads like built-in syntax. A small characteristic that does loads of the heavy lifting in Kotlin’s extra readable APIs.
  • Day 42: Operator Overloading — Give operators like + and [] which means to your personal sorts by implementing specially-named capabilities. Highly effective for area sorts like vectors or cash, and simple to overdo — the bit is an efficient place to really feel out the road.

Superior

  • Day 36: Lambda With Receiver — A lambda the place this refers to a provided receiver object slightly than the enclosing scope. That is the only characteristic that makes Kotlin DSLs like Compose and buildString potential, so it’s nicely well worth the effort.
  • Day 48: Delegation By Key phrase — Use by handy off interface implementation or property entry to a different object, no boilerplate forwarding strategies required. Composition over inheritance, baked into the language.

Flutter & Dart

Three Kodebits in June, skewing just a little tougher than typical. We have a look at Dart’s swap expressions (a genuinely trendy tackle management circulate), a set filter-and-aggregate chain, and extension strategies — the Dart counterpart to the Kotlin extension capabilities we lined again in Could.

Intermediate

  • Day 43: The place Then Fold — Chain the place to filter a set and fold to cut back it to a single worth. The Dart expression of a sample you’ve now seen throughout all three languages: describe the transformation, don’t hand-roll the loop.
  • Day 46: Extension Technique — Add strategies to current sorts from exterior the category. If Could’s Kotlin extension operate bit clicked, this is identical thought in Dart — useful for seeing which ideas genuinely journey between languages.

Superior

  • Day 41: Swap Expression — Dart’s swap can be utilized as an expression that returns a price, full with sample matching. A giant step up from the C-style swap, and one of many nicer additions in latest Dart variations.

Related Articles

Latest Articles