About learnxbyexample

About learnxbyexample

What Is This Site?

learnxbyexample.com is a programming education site that teaches multiple programming languages through annotated, runnable code examples. Our mission is simple: if you can read a concrete example, you can learn to write it.

Every concept on this site follows the same pattern: a short explanation, a code example, and the expected output. No walls of theory, no abstract diagrams — just code that does something real, with enough annotation to understand why.


Where the Content Comes From

Inspired by Go by Example

This project was directly inspired by Go by Example, created by Mark McGranaghan and maintained by the Go community. Go by Example pioneered the format: one concept per page, a code example on the left, explanations on the right.

We admire that format deeply and have built learnxbyexample around the same philosophy — but extended it to many programming languages beyond Go.

Attribution: Go by Example was created by Mark McGranaghan and is now maintained by Eli Bendersky and contributors. It is licensed under Creative Commons Attribution 3.0 Unported (CC-BY-3.0). Our content for non-Go languages is independently generated and is not a reproduction of the Go by Example source. The Go language examples on this site are adapted from the Go by Example source with attribution to Mark McGranaghan, Eli Bendersky, and contributors, and are used in accordance with the CC-BY-3.0 license.


Language Coverage Philosophy

We are deliberately selective about which languages we publish. Our criteria:

  1. Demand-first: Languages are prioritized based on developer search demand (Google Search Console impressions, StackOverflow tag popularity, TIOBE rankings). We would rather have excellent content for 10 high-demand languages than mediocre content for 50 obscure ones.

  2. Quality gate: Every language goes through a draft → review → published lifecycle. A language is only published when a quality reviewer has confirmed the code examples are correct and idiomatic for that language.

  3. Concept-honesty: Not every Go concept maps cleanly to every language. Goroutines don’t exist in Python. Pointers don’t exist in JavaScript. We explicitly exclude concepts that would produce misleading examples in a given language — rather than publishing technically-compiling but conceptually-wrong code.


Content Generation Pipeline

learnxbyexample uses an AI-assisted content generation pipeline:

  1. Source reference: We scrape the example structure from Go by Example via Firecrawl (a web scraping API). We capture the concept names, descriptions, and Go code — but do NOT reproduce the Go code as-is for other languages.

  2. AI generation: We use Dify to generate equivalent code examples for target languages. This gives us a first draft that is then reviewed for correctness.

  3. Human + automated review: Generated examples go through automated issue detection (checking for concept-mismatches, wrong syntax, inappropriate concepts for the target language) and then manual review by language experts.

  4. Publication: Only reviewed, quality-approved content is published.

We are transparent about this: Our content is AI-assisted. We believe AI-assisted content can be high-quality when it goes through proper review — and low-quality when it doesn’t. We try hard to publish only the former.


Who Runs This?

learnxbyexample is an independent project. It is not affiliated with Google, the Go project, or Anthropic.

If you find an error in an example — incorrect code, wrong output, a concept that doesn’t apply to a language — please open an issue on GitHub. We take corrections seriously; bad examples are worse than no examples.


Feedback and Contributions

We welcome corrections and suggestions:

  • GitHub Issues: github.com/learnxbyexample — report errors, suggest languages, request concepts
  • Disqus Comments: Available at the bottom of most example pages for quick feedback

Technical Stack

This site is built with Hugo (extended version) and deployed via Netlify. The source content pipeline runs in Python using Firecrawl and Dify. The theme is based on Doks by Thulite.


Thank you for learning here. We hope these examples save you hours of documentation-reading.

查看推荐产品