CodeGym
AI Academy
Promotion
CodeGym University
Learning
Courses
Tasks
Surveys & Quizzes
Games
Help
Schedule
Community
Users
Forum
Chat
Articles
Success stories
Activity
Reviews
Subscriptions
Light theme

Lessons

  • Reviews
  • About us
Start
Start learning
Start learning now
  • My Progress
  • Courses
  • University
  • Quest Map
  • Lessons
  • Scope-function contracts: let/run/apply/also/with

    Kotlin SELF
    Level 28, Lesson 0
    We break down Kotlin scope functions as a set of clear contracts: how let, run, with, apply, also differ; when it or this is used inside the block; and what is returned outward—an evaluation result or the original object. We reinforce the selection with short practical examples and discuss typical mistakes.
    Available
  • Nullable chains without cascaded ifs: ?.let, Elvis ?:, run {}

    Kotlin SELF
    Level 28, Lesson 1
    Let’s break down how to write linear processing of nullable values in Kotlin without an “if ladder”: use the safe call ?. with the scope function let, resolve uncertainty with the Elvis operator ?:, and for a multi-line fallback use run { ... }. Using user input examples, we’ll see where to keep null, where to turn it into a default ( 0, 5), and why !! is almost always worse than an explicit scenario.
    Available
  • Text Analyzer pipeline on collections

    Kotlin SELF
    Level 28, Lesson 2
    We break down how to build a simple text analyzer as a sequence of clear type transformations: normalization ( trim(), lowercase(), Regex.replace), tokenization ( split + filter with isNotBlank), counting frequencies via groupingBy. eachCount(), selecting top-N via entries → sortedByDescending → take, and final report formatting with joinToString, padEnd/ padStart. At the end: common mistakes and how to avoid them.
    Available
  • Decomposing Text Analyzer: steps and assembling via let(::...)

    Kotlin SELF
    Level 28, Lesson 3
    We break down how to turn a “wall of” text transformations into a readable pipeline: we pin down the input/output of each step ( String → List<String> → Map<String, Int>), extract functions normalizeText/ tokenize/ countTokens/ topN/ formatTop, and assemble the pipeline via let( ::...). We also show how to add diagnostics between steps with also without breaking the “purity” of computational functions.
    Available
  • Scope function mistakes: result, it, and unnecessary “magic”

    Kotlin SELF
    Level 28, Lesson 4
    We’ll go through common Kotlin scope function traps: why apply/ also often “eat” the computation result, how nested lambdas turn it/ this into a mess, and when “pretty” chains become unnecessary magic. You’ll learn how to choose the right scope function and how to read expressions by their types and return values.
    Available
Learn
  • Registration
  • Java Course
  • Help with Tasks
  • Pricing
  • Java Syntax
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success Stories
  • Activity
  • Affiliate Program
Company
  • About us
  • Contacts
  • Reviews
  • Press Room
  • CodeGym for EDU
  • FAQ
  • Support
CodeGym CodeGym is an online course for learning Java programming from scratch. This course is a perfect way to master Java for beginners. It contains 1200+ tasks with instant verification and an essential scope of Java fundamentals theory. To help you succeed in education, we’ve implemented a set of motivational features: quizzes, coding projects, content about efficient learning, and a Java developer’s career.
Follow us
Interface language
English
Deutsch Español हिन्दी Français Português Polski বাংলা 简体中文 मराठी தமிழ் Italiano Bahasa Indonesia 繁體中文 Nederlands 日本語 한국어 Bulgarian Danish Hungarian Basa Jawa Malay Norwegian Romanian Swedish Telugu Thai Українська Filipino Turkish Azərbaycan Русский Vietnamese
Programmers Are Made, Not Born © 2026 CodeGym
MastercardVisa
Programmers Are Made, Not Born © 2026 CodeGym