JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • Why output stability matters

    Go SELF
    51 level,0 lecture
    We break down why CLI output is a contract: the same input data must produce the same result. Using the todo utility as an example, we show how instability appears because of map, time.Now(), “service” messages in stdout, and how it is fixed with a pipeline “data first → then printing”: map → []Task → sort.Slice → render. Separately, we lock in the rule of separating stdout/ stderr and typical mistakes.
    Open
  • Tabular output in the CLI — text/tabwriter

    Go SELF
    51 level,1 lecture
    We break down how to make neat, aligned tables in a Go CLI using the text/tabwriter package: why “printing with spaces” breaks, how tab-based alignment with \t works, why you must call Flush(), how to write a renderer without tying it to os.Stdout (via io.Writer), how to protect yourself from \t/ \n in user data, and what to check in tabwriter.Debug mode.
    Open
  • JSON output in a CLI: formatting and determinism

    Go SELF
    51 level,2 lecture
    We break down how to implement a “proper” JSON mode for a Go CLI: print exactly one JSON value to stdout, send errors to stderr, define the contract via a struct instead of a map[string]any, and render through json.NewEncoder (with SetIndent and SetEscapeHTML(false)). Separately, we lock down determinism: element ordering, banning “floating” fields, and a stable time format via time.RFC3339 in UTC.
    Open
  • Sort before output: sort.Slice, slices.SortFunc, criteria

    Go SELF
    51 level,3 lecture
    We break down why you need a stable output order in a CLI, and why you should sort the data ( [] Task) rather than “preformatted strings”. We practice with sort.Slice and sort.SliceStable, learn how to define a total order (primary and secondary key), and also look at the modern approach via slices.SortFunc and cmp.Compare. At the end: how to plug sorting into the list command pipeline, and which mistakes most often break determinism.
    Open
  • CLI filters: --done/ --undone, --since, --contains

    Go SELF
    51 level,4 lecture
    We break down how to design predictable filters in a Go CLI: where filtering lives in the pipeline (before sorting and rendering), how to define a contract for the --done and --undone flags (including conflicts), how to implement simple filters like --contains using strings.Contains and --since with date parsing via time.Parse, and how to apply all of this through a predicate func( Task) bool and the fail fast principle.
    Open
Learn
  • Registration
  • Java course
  • Help with tasks
  • Pricing
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Activities
Company
  • About us
  • Contacts
  • Reviews
  • FAQ
  • Support
JavaRushJavaRush — is an interactive online course for learning Java programming from scratch. It contains 1200 practical tasks with one-click solution checking, the necessary minimum of theory on Java basics, and motivating features that help you complete the course: games, quizzes, interesting projects and articles on effective learning and the career of a Java developer.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush
MastercardVisa
"Programmers are not born" © 2026 JavaRush