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
  • Type parameters: simple generics functions

    Go SELF
    27 level,0 lecture
    We break down generics in Go “without magic”: what a type parameter T and the constraint any are, how to read signatures like func First [ T any ]( xs [] T), how type inference works, how to return the zero value for T, and we also write practical utilities Ptr and Must and simple generic types Box and Stack. At the end: a type-substitution reading scheme and common beginner mistakes.
    Open
  • Constraints: any and comparable

    Go SELF
    27 level,1 lecture
    We break down why Go generics need constraints: how any means “any type” but does not grant operations like == or +, and how comparable enables comparison and using a type as a key in map. In practice, we write universal utilities Contains, Unique, CountBy, and GroupBy, and also discuss a subtlety of comparability through interfaces in Go 1.25.
    Open
  • Packages slices, maps, cmp

    Go SELF
    27 level,2 lecture
    Let’s break down why you might want to use the standard Go packages slices, maps, and cmp: how they express intent instead of “manual” for loops, simplify common operations (cloning, sorting, deleting a range, comparing, copying), how they relate to generics (signatures like S ~[]E and M ~map[K]V), and how to build stable output on top of a map via maps.Keys + slices.SortFunc + cmp.Compare. At the end: typical mistakes and how to avoid them.
    Open
  • Anti-pattern — “doing generics for generics’ sake”

    Go SELF
    27 level,3 lecture
    We break down anti-patterns of using generics in Go: when abstractions add noise instead of value, why the any + type assertion combo turns compile-time errors into runtime risks, and how to “treat” such spots with clear domain functions or the standard packages slices/ maps/ cmp. At the end — a cheat sheet “symptom → replacement”, a decision flowchart, and common mistakes.
    Open
  • Generics and the standard library

    Go SELF
    27 level,4 lecture
    We break down how generics in Go help you write readable, “intent-driven” code: sorting via slices.SortFunc and cmp.Compare, working with slices and maps via slices/ maps, stabilizing output from map via keys and slices.Sort, plus two small generic helpers ( Filter[T] and GroupBy) using a mini “task list” app as an example.
    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