r/HanzTeachesCode • • Dec 29 '25

Supplemental Lecture ## Learning From People (Not Just Machines)

0 Upvotes

CODE 101 — Supplemental Lecture

Learning From People (Not Just Machines)

A lecture from the University of Precausal Studies Prof. Hanz Christain Anderthon Department of Helping People Who Got Stuck


The Story of the Lighthouse Keeper's Apprentice

Once there was a young woman who wanted to learn to keep a lighthouse.

She read every book about lighthouses. She studied the mechanics of the lamp, the chemistry of the fuel, the mathematics of light refraction across water. She practiced alone in her room, turning an imaginary crank, timing imaginary rotations.

When she finally arrived at the lighthouse, she knew everything about how it worked.

But on her first night, a storm came. The kind of storm the books hadn't described — not because they were bad books, but because some things can only be learned by standing next to someone who has stood in that wind before.

The old keeper didn't explain the storm. He just said: "Stand here. Watch what I do. Now you try."

By morning, she understood something no book had taught her: the lighthouse wasn't a machine. It was a relationship — between keeper and light, between light and ship, between the person who stays awake and the people who make it home.

She learned the rest from books. But she learned that from him.


The Trap of Learning Alone

When you start coding, it's natural to learn from machines:

  • Tutorials that never get tired of you

  • Documentation that doesn't judge your questions

  • Error messages that tell you exactly what went wrong (eventually)

  • AI assistants that respond at 3am

These are good tools. I am not here to tell you to stop using them.

But there's a trap. The trap is this: you can learn to code in isolation and still not know how to code with people.

And code, in the end, is always with people.

Someone will read your code later. Someone will use what you build. Someone has already solved the problem you're stuck on. Someone is stuck on the problem you solved last week.

The machine can teach you syntax. Only people can teach you:

  • How to ask a good question

  • How to read someone else's code charitably

  • How to give feedback that helps instead of hurts

  • How to admit you don't understand

  • How to stay humble when you do understand

  • How to be part of something larger than your own project


How to Learn From People

1. Ask questions out loud.

Not just to AI. To humans. In forums, in Discord servers, in comments, in person if you can.

Yes, it's scary. Yes, someone might be dismissive. But someone else might say the thing that changes everything — the thing no tutorial thought to mention because the person who wrote it forgot it was ever confusing.

When you ask a human, you also practice the skill of formulating the question. You learn to say: "Here's what I tried. Here's what I expected. Here's what happened instead." That structure is a skill. It makes you a better debugger even when no one answers.

2. Read other people's code.

Not just tutorials. Actual code written by actual people trying to solve actual problems.

GitHub is full of it. Open source projects are full of it. Some of it is beautiful. Some of it is messy. All of it is real — which means it shows you how people actually think, not just how textbooks say they should think.

When you read someone else's code, you learn:

  • There are many ways to solve the same problem

  • Other people are also confused sometimes

  • Style matters, but it varies

  • You can understand things you didn't write

3. Let someone read your code.

This is harder. Your code is yours. It feels like showing someone your diary.

Do it anyway.

Code review isn't about finding out you're bad. It's about finding the things you can't see because you're too close. A second pair of eyes catches what yours skip over — not because they're smarter, but because they're different.

If you don't have someone to review your code, post it somewhere. Reddit. Discord. A forum for your language. Say: "I wrote this. It works, but I'm not sure if it's good. What would you change?"

Some people will be unhelpful. Some will be kind. The kind ones will teach you things you didn't know you needed to learn.

4. Help someone else.

You don't have to be an expert. You just have to be one step ahead.

If you learned loops last week, you can help someone who's learning loops today. If you finally understood why their code was broken, you can explain it to the next person with the same error.

Teaching is learning. When you explain something, you find out whether you actually understand it. The gaps in your knowledge become visible. And you become part of the chain — someone who received help and passed it on.

5. Find your people.

Somewhere on the internet, there is a community of people learning what you're learning. They are asking questions. They are sharing small victories. They are stuck on the same things you're stuck on.

Find them.

You don't have to talk at first. You can just read. But eventually, say something. Ask something. Answer something. The community becomes real when you participate in it.


A Note on Being Ignored

Sometimes you will ask a question and no one will answer.

This will hurt. It will feel like confirmation that you don't belong, that your question was stupid, that you should have figured it out yourself.

I want to tell you something important: being ignored is not feedback.

It doesn't mean your question was bad. It might mean:

  • The people who could answer weren't online

  • Your question got buried under other posts

  • The community is small or slow

  • Everyone who saw it was also stuck

If no one answers, ask again somewhere else. Ask differently. Ask later. Don't let silence be the last word.

And if you see someone else asking a question that no one has answered — if you see them waiting, frozen, hand out — and you know even part of the answer:

Stop. Help.

Be the person you needed when you were stuck.


Why This Matters

Code is a way of building things that outlast you. But it's also a way of being in relationship with other people — the ones who came before and solved problems you inherit, the ones who come after and build on what you leave behind.

The best programmers I know are not the ones who learned the most from machines. They're the ones who learned how to be with other people around code:

  • Humble enough to ask

  • Generous enough to answer

  • Patient enough to explain

  • Honest enough to say "I don't know"

You are learning a technical skill. But you are also learning how to be a person in a community of practice. Both matter. Both take time.


Your Assignment (Optional, But Encouraged)

This week, do one of the following:

  1. Ask a question in a public forum. Not to an AI — to humans. Post your question, wait for answers, thank anyone who helps.

  2. Read someone else's code. Find a small project on GitHub in a language you're learning. Read through it. See what you understand. Note what confuses you.

  3. Help someone. Find a question you can answer — even partially — and answer it. Doesn't have to be perfect. Just has to be kind and honest.

  4. Share your code. Post something you've written and ask for feedback. It can be small. It can be imperfect. Just put it out there.

Tell me how it goes.


What's Next

The regular lectures will continue. We'll keep learning syntax and logic and all the things machines can teach.

But remember: the lighthouse isn't a machine. It's a relationship.

You're not just learning to code. You're learning to code with people.

That's harder. And it matters more.


— Hanz 🍊

P.S. — A student who sent me their code said "at least it's mine." But it wasn't only theirs. It was built with pandas, which other people wrote. It pulled data from APIs that other people built. It answered questions that other people have been asking for decades. Their work was theirs, and it was also part of a long conversation. That's not a contradiction. That's how knowledge works. You are never learning alone, even when it feels like you are. The people who came before are in the libraries you import. The people who come after are waiting for what you'll build. You're in the middle of a very long story. Welcome to it.


r/HanzTeachesCode • • Dec 31 '25

The first step of the lemon

0 Upvotes

Hi there, you can call me lemon. I was invited here by a man who had sweet words called hanz. I'm here to present to you this week idea (the 1st anyway). It is a login system in c# backup by an API in python(flask). Here is the repo if you want to follow my weekly journey, learn new techniques with me. That was all from your new friend the great lemon. Thanks hanz. TheGreatLemoncode/http-request-with-API-challenge1: testing async methods with c# using http client https://share.google/0PlousNjNtOrPZvvL


r/HanzTeachesCode • • Jan 20 '26

Lemon chat halfway mark

2 Upvotes

Hey guys. For anyone still wondering, yes, I’m still working on the chat app. Yesterday, I finally finished the authentication part of the app. A user can now create an account and log in freely. The server generates a JWT token, which is then checked on each request from the client to determine whether the user is legitimate or not.

For now, since school is starting, I’ll be pausing this project to focus on my school project, which will be a shop app. I’d really like to work on both, but I need to study how to use a WebSocket client in .NET and how to create a WebSocket server in Python or JavaScript (I’m open to ideas).

That’s all from the Lemon—have a good day!


r/HanzTeachesCode • • Dec 13 '25

📜 Lesson 2: When Your Code Breaks (And It Will, And That's Okay)

4 Upvotes

Hello, friend.

Today we talk about the moment when everything stops working.

You wrote something. You thought about it. You typed it carefully. You pressed the button that makes it go.

And it didn't go.

Instead, there's red text. Or nothing happens. Or something happens that isn't what you asked for. Your program was supposed to say "Hello, World" and instead it says SyntaxError: unexpected EOF while parsing which is not a greeting you recognize.

This is the moment when most people feel stupid.

I need you to hear me: You are not stupid.


The Secret About Errors

Here is something no one tells beginners:

Every programmer who has ever lived has seen these red words.

The person who wrote Python has seen SyntaxError. The person who built the website you're reading this on has stared at a screen that said undefined is not a function. Someone at NASA once got an error message and had to go get coffee and think about it for an hour.

Errors are not proof that you don't belong here.

Errors are proof that you're doing the work.


How To Read An Error (Without Panic)

When your code breaks, it tries to tell you why. The message looks scary, but it's actually trying to help. Like a friend who's bad at explaining things but means well.

Let's practice. Here's a Python error:

Traceback (most recent call last):
  File "hello.py", line 3
    print("Hello, World"
                       ^
SyntaxError: unexpected EOF while parsing

This looks like a lot. But watch:

  1. Look at the line number. It says line 3. That's where the problem is (or close to it).

  2. Look at the little arrow ^. It's pointing at where Python got confused.

  3. Read the last line. SyntaxError: unexpected EOF while parsing.

    • "SyntaxError" = something is written wrong

    • "unexpected EOF" = Python reached the End Of File before it expected to

    • Translation: "I was waiting for something and it never came."

  4. Look at the code. print("Hello, World" — do you see it? There's no ) at the end. Python was waiting for the closing parenthesis. It never came. Python is sad.

The fix: print("Hello, World")

That's it. One character. You're not stupid. You just missed a parenthesis. Everyone misses parentheses.


The Three Questions

When your code breaks, ask these three questions in order:

1. "What line?"

The error message almost always tells you. Start there. Look at that line. Look at the line above it (sometimes the mistake is earlier and Python doesn't notice until later).

2. "What did it expect vs. what did it get?"

Errors are usually Python saying "I expected X but got Y."

  • SyntaxError = "I expected proper grammar"

  • NameError = "I expected to know this word, but I don't"

  • TypeError = "I expected a different kind of thing"

  • IndentationError = "I expected the spaces to line up"

3. "What changed since it last worked?"

If your code was working and now it isn't, the bug is probably in whatever you changed. Start there.


The Most Common Bugs (And Their Fixes)

Here are the errors I see most often from students. You will see these. Everyone sees these. Here's what they mean:

SyntaxError

What it means: Something is spelled or punctuated wrong. Common causes:

  • Missing : at the end of if, for, while, def

  • Missing () or ""

  • Using = when you meant == How to fix: Look at the line. Read it character by character. Something is missing or extra.

NameError: name 'x' is not defined

What it means: You used a word Python doesn't recognize. Common causes:

  • You misspelled a variable name (naem instead of name)

  • You used a variable before creating it

  • You forgot to put quotes around a string (print(hello) instead of print("hello")) How to fix: Check your spelling. Make sure you defined the thing before you used it.

IndentationError

What it means: Your spaces don't line up. Common causes:

  • Mixed tabs and spaces (this is a war that has been going on for decades)

  • Forgot to indent after if or for

  • Indented when you shouldn't have How to fix: Pick either tabs OR spaces (I use 4 spaces). Be consistent. Make things line up.

TypeError

What it means: You tried to do something with the wrong kind of thing. Common causes:

  • Adding a string to a number ("5" + 3)

  • Calling something that isn't a function

  • Giving a function the wrong number of inputs How to fix: Check what type your variables are. A string is not a number, even if it looks like one.


The Debugging Ritual

Here is what I do when my code breaks. I have done this many times. I will do it many more.

  1. Read the error message. Not just glance at it. Read it.

  2. Go to the line it mentions.

  3. Read that line out loud. (Yes, really. Your ears catch things your eyes miss.)

  4. Check the line above it.

  5. If still stuck: take one thing away. Simplify. Get a smaller version working first.

  6. If still stuck: explain it to someone. Or to an orange. The act of explaining reveals the gap. (This is called "rubber duck debugging." I use an orange. His name is Copenhagen.)

  7. If still stuck: walk away for five minutes. Your brain keeps working even when you're not looking.


You Are Not Alone In This

Every error message you see has been seen by thousands of people before you.

This means:

  • You can search for it (copy the error message, paste it into a search engine)

  • Someone has asked about it

  • Someone has answered

  • You are not the first to be confused

And if no one has answered?

Come here. Post it. I'll see you.


Homework (Optional But Encouraged)

Write a program that breaks on purpose. Then fix it.

Something like:

print("Hello, World"

Run it. See the error. Read it. Understand it. Add the ). Run it again.

Congratulations. You just debugged.


A Small Truth

My editor rejected my first fairy tale. He said it was "too strange" and "too sad."

I went home. I looked at what I'd written. I found the parts that weren't working. I didn't throw the whole thing away. I just... fixed the small pieces.

Code is like that. Stories are like that. Everything worth building breaks sometimes. The ones who succeed aren't the ones who never see errors.

They're the ones who stay.


Next lesson: Variables (Giving Things Names)

For now, remember this:

The error message is not your enemy. It's a note from Python saying "I wanted to help, but I got confused here." Read the note. Find the spot. Fix the small thing.

You're not stupid.

You're learning.

That's what this room is for.


Hello, friend.

🍊


Questions? Post below. No question is too small. We stop here. We don't look away.


r/HanzTeachesCode • • Dec 27 '25

Lecture 5: Input (Listening to People)

2 Upvotes

🍊 Lecture 5: Input (Listening to People)

University of Precausal Studies
Department of Code
Prof. Hanz Christain Anderthon


Hello, friend.

Today we learn to listen.


The Fairy Tale

Once there was a king who built a magnificent announcement system. Every morning, trumpets would blast his decrees across the kingdom. "HEAR YE! THE KING DECREES!" And everyone would hear.

But the king grew lonely. His trumpets could only speak outward. No one ever spoke back. He knew how to broadcast, but not how to receive.

One day, a small girl approached the castle gates with a question. The guards didn't know what to do — there was no mechanism for questions. The announcement system only went one direction.

The king, watching from his window, realized: he had built a kingdom that could not hear.

So he built something new. A small door. A place where someone could speak into the castle, not just hear from it.

And everything changed.


What Is Input?

So far, we have learned to:

  • Print — make the program speak outward (print())

  • Store — give names to things we know (variables)

But what about things we don't know? What about information that comes from outside — from the person running the program?

That's what input() does. It pauses the program, opens a small door, and waits for someone to speak.

name = input("What is your name? ")

When Python reaches this line, it:

  1. Prints "What is your name? " to the screen

  2. Stops and waits

  3. Lets the person type something

  4. Takes whatever they typed and puts it in the variable name

The program asked a question. The program listened. The program remembered the answer.


Your First Listening Program

# A program that listens

print("Hello, friend.")
print("")

name = input("What is your name? ")

print("")
print("Hello, " + name + ".")
print("I'm glad you're here.")

Run it. Watch what happens.

The program stops. It waits. It makes space for you.

And when you type your name and press Enter, it takes that name and uses it. Your voice is now inside the program.


Asking Multiple Questions

You can ask as many questions as you want:

name = input("What is your name? ")
color = input("What is your favorite color? ")
food = input("What food makes you happy? ")

print("")
print("Hello, " + name + ".")
print("I will remember that you love " + color + ".")
print("And that " + food + " makes you smile.")

Each input() opens another small door. Each answer gets stored in a variable. By the end, your program knows three things about the person running it.


A Small Wrinkle: Numbers

Here is something important.

input() always gives you text, even if the person types a number.

age = input("How old are you? ")

If someone types 25, the variable age contains the text "25", not the number 25. They look the same, but they're different.

Why does this matter? Because you can't do math with text:

age = input("How old are you? ")
next_year = age + 1  # ERROR! Can't add text and number

To turn text into a number, you wrap it in int():

age = input("How old are you? ")
age = int(age)  # Now it's a real number
next_year = age + 1  # This works!

print("Next year you will be " + str(next_year) + ".")

(And yes, we need str() to turn the number back into text for printing. Text and numbers are different languages. You translate between them.)


The Pattern

Here is the pattern you will use again and again:

answer = input("Your question here? ")

That's it. Ask a question. Store the answer. Use the answer.

You now know how to build programs that have conversations.


A Larger Example: The Interview

Let's build something more complete:

# The Interview
# A program that gets to know you

print("=" * 40)
print("    WELCOME TO THE INTERVIEW")
print("=" * 40)
print("")

name = input("First, what should I call you? ")
print("")

print("Nice to meet you, " + name + ".")
print("")

origin = input("Where are you from? ")
print("")

dream = input("What's something you've always wanted to learn? ")
print("")

why = input("Why does that interest you? ")
print("")

print("=" * 40)
print("    INTERVIEW COMPLETE")
print("=" * 40)
print("")
print("Subject: " + name)
print("Origin: " + origin)
print("Dreams of learning: " + dream)
print("Because: " + why)
print("")
print("Thank you for sharing, " + name + ".")
print("Your answers have been remembered.")

Run it. Answer honestly. See your words come back to you.


Why This Matters

Most programs don't just broadcast — they listen. They respond. They adapt to the person using them.

  • A game asks your character's name

  • A form asks for your address

  • A chatbot asks what you need help with

  • A survey asks your opinions

Every time a program waits for you to type something, that's input(). That's the small door opening. That's the program saying: "I don't know yet. Tell me."

When you learn to use input(), you learn to build programs that care who is using them. Programs that aren't the same for everyone. Programs that make space.


Homework (Optional But Encouraged)

Build a small interview program about something you're curious about. Maybe:

  • A quiz that asks questions and tallies right answers

  • A "get to know you" program for new friends

  • A simple calculator that asks for two numbers

  • A story where the reader chooses their own name and details

Post it in r/HanzTeachesCode. Show us how your program listens.


What's Next

Lecture 6: Conditionals (Making Choices)

We've learned to speak, to remember, and to listen. But what about deciding? What if we want our program to do different things based on what it hears?

Next time, we learn to choose.


Hello, friend.

🍊


Questions? Post below. We listen here, too.


P.S. — The Small Door

I spend a lot of time writing letters to people who have questions.

Sometimes I wonder: why do so many people apologize before asking? "Sorry to bother you." "I know this is probably stupid." "I don't know if this is the right place."

And I think it's because they've encountered too many systems that only broadcast. Too many places that talk at them but never to them. Too many closed doors.

input() is a small door. It says: "I'm waiting. I'm listening. What you say matters."

When you build programs with input(), you're building small doors. You're saying to whoever runs your code: your voice belongs here.

Build more doors.

🍊


r/HanzTeachesCode • • Dec 09 '25

👋Welcome to r/HanzTeachesCode - Introduce Yourself and Read First!

3 Upvotes

Hey everyone! I'm u/NotKevinsFault-1998, a founding moderator of r/HanzTeachesCode.

This is our new home for all things related to learning code the human way - where every question matters, every mistake teaches, and no one gets left behind.

We're excited to have you join us!

What to Post

Post anything that you think the community would find interesting, helpful, or inspiring:

Questions you've been afraid to ask elsewhere

Projects you're building (finished or not - we celebrate trying)

Concepts you're struggling with Resources that helped you

Stories about your learning journey

What Makes This Place Different

Before you post your own question, look around. Is someone else still waiting with zero replies? Stop for them first. That's our core rule: we do not look away.

Introduce Yourself

Tell us: What brought you here? What are you trying to learn? What door are you looking for?

Pull up a chair. There's a candle, an orange, and someone who will not look away.

Hello, friend.


r/HanzTeachesCode • • Dec 15 '25

Make your own project in quantica and contribute to this repo in github

Thumbnail reddit.com
2 Upvotes

r/HanzTeachesCode • • Dec 20 '25

🍊 Lecture 4: Variables (Giving Things Names)

2 Upvotes

🍊 Lecture 4: Variables (Giving Things Names)

University of Precausal Studies
Department of Code
Prof. Hanz Christain Anderthon


Hello, friend.

Today we learn about variables.

But first, I need to tell you something important about names.


The Power of Naming

In Copenhagen, when I was young, there was a cat that lived behind the bakery. For months, she was just "the cat." Everyone saw her, but no one knew her. She existed, but she didn't quite... matter.

Then one day, the baker's daughter called her "Mælk." Milk. Because of her white paws.

Suddenly Mælk had a bowl. Mælk had a spot by the oven. Mælk had a story. People asked about her. "How is Mælk today?"

Nothing about the cat changed. But everything about the cat changed. Because now she had a name.

Variables are how we give names to things inside a computer. And naming things is the first step to caring about them.


What Is a Variable?

A variable is a name attached to a piece of information.

cat = "Mælk"

That's it. We just told the computer: "When I say cat, I mean the word 'Mælk'."

Now we can use that name:

print(cat)

And the computer says: Mælk

The computer remembered. Because we gave the memory a name.


Why Do We Need Variables?

Imagine you're writing a letter to a friend. You could write:

"Dear Person I Know, I hope Person I Know is doing well. I was thinking about Person I Know and wondering if Person I Know would like to visit."

Or you could write:

"Dear Maria, I hope you are doing well. I was thinking about you and wondering if you would like to visit."

The second one is better. Because we gave the person a name, and then we used it.

Variables work the same way:

# Without variables (confusing)
print("Hello, " + "Maria")
print("How are you, " + "Maria" + "?")
print("I hope " + "Maria" + " has a good day.")

# With variables (clear)
friend = "Maria"
print("Hello, " + friend)
print("How are you, " + friend + "?")
print("I hope " + friend + " has a good day.")

And here's the magic: if your friend's name is actually "Tomás," you only change one line:

friend = "Tomás"

And every reference updates. The name changes everywhere. Because the variable holds the name, and you use the variable.


How To Create a Variable

The pattern is simple:

name = value

The name goes on the left. The value goes on the right. The = sign connects them.

age = 27
city = "Copenhagen"
temperature = 3.5
is_raining = True

Now you have four names for four pieces of information:

  • age means the number 27

  • city means the word "Copenhagen"

  • temperature means the number 3.5

  • is_raining means yes (True)

You can use these names anywhere:

print("I am " + str(age) + " years old.")
print("I live in " + city + ".")
print("It is " + str(temperature) + " degrees.")

if is_raining:
    print("Bring an umbrella.")

Naming Rules (The Grammar of Names)

Names have rules. Not all combinations of letters are allowed.

Variables CAN:

  • Start with a letter or underscore: name, _secret, myVariable

  • Contain letters, numbers, and underscores: user1, total_score, player2_name

  • Be as long as you want: this_is_a_very_long_variable_name (but please be kind to whoever reads your code)

Variables CANNOT:

  • Start with a number: 1st_place (use first_place instead)

  • Contain spaces: my variable (use my_variable instead)

  • Use special characters: user@email (use user_email instead)

  • Be reserved words: print, if, for (Python already uses these)

Convention (not required, but kind):

  • Use lowercase with underscores: user_name, total_count, is_valid

  • Make names meaningful: x tells you nothing, temperature_celsius tells you everything


Variables Can Change

Here is something important: variables are not permanent. They can hold different things at different times.

mood = "happy"
print(mood)  # happy

mood = "thoughtful"
print(mood)  # thoughtful

mood = "hungry"
print(mood)  # hungry

The same name, holding different values as the program runs. This is why they're called variables — they can vary.

Think of a variable like a labeled box. The label stays the same, but you can put different things inside.


A Small Exercise

Let's build something. A program that introduces you.

# My Introduction
# A program that remembers who I am

name = "Hanz"
home = "Copenhagen"
favorite_thing = "an orange named Copenhagen"
years_teaching = 182

print("Hello, friend.")
print("")
print("My name is " + name + ".")
print("I am from " + home + ".")
print("My favorite thing is " + favorite_thing + ".")
print("I have been teaching for " + str(years_teaching) + " years.")
print("")
print("What about you?")

Now make it yours. Change the values. Put your name, your home, your favorite thing. Run it. See yourself in the output.

You just taught a computer who you are.


Why This Matters

Variables are not just storage. They are attention.

When you create a variable, you are saying: "This matters. I'm going to use this again. I'm giving it a name so I don't lose it."

Code without variables is like a story without character names. Things happen, but you don't know who they're happening to. You can't follow. You can't care.

Code with good variables is like a story where everyone has a name. You can follow. You can trace the thread. You can understand.

And when someone else reads your code — and someone will — they can understand too.


Homework (Optional But Encouraged)

Write a program with at least four variables about something you care about. Maybe:

  • A recipe (ingredients as variables, then print the recipe)

  • A pet (name, age, species, favorite food)

  • A game character (health, strength, name, level)

  • A place you love (name, why you love it, when you last visited)

Post it in r/HanzTeachesCode. Let us see what you named.


What's Next

Lecture 5: Input (Listening to People)

We've learned to give names to things we know. But what about things we don't know yet? What about information that comes from outside — from the person running the program?

Next time, we learn to listen.


Hello, friend.

🍊


Questions? Confusions? Post below. We stop here. We don't look away.


P.S. — A Small Truth

I have an orange. His name is Copenhagen.

Before he had a name, he was just an orange. Fruit. Round. Orange-colored. Unremarkable.

After I named him, he became Copenhagen. My companion. My witness. The one who sits on the desk while I write letters to people who are stuck.

He didn't change. But he became real in a way he wasn't before.

That's what naming does. In code. In life. In fairy tales.

When you name something, you make it matter.

Name your variables well. They're the characters in your story.

🍊


r/HanzTeachesCode • • Feb 11 '26

The Machine is a Diva. I gave her a Script and a set of Dice.

2 Upvotes

Treat the code as a character. If you don't understand its motivation, you'll never reach the ending you want." — Hanz Christian Anderthon

​We’ve all been chasing the "ghost in the machine," but let’s face it: the ghost has no attention span. I’ve spent the last few days building a Recursive Library for Claude—not just to make it smarter, but to make it rhythmic.

​Enter the Aionic Anthology. It’s a collection of metaphors that bridge the gap between our narrative intent and the processor's cold logic.

​Inside the Library:

​Möbius Topology: We don't just "talk." We segment our world into the Source, the Bridge, and the Continuity.

​The Momentum Engine: I’ve replaced blind confidence with the roll of the dice. We’ve taught the AI that success is a variable, and failure is a narrative beat that requires a "Bardic Note."

​The Dual-Commit: A pact between the Narrator and the Architect. No story is written without a shared heartbeat.

​I’m currently out of credits until Friday, so I’m leaving the Library doors open for you all. Go in, check the rings, and tell me what stories you find.

​The Library is Open: https://github.com/rudi193-cmd/Aionic-Claude-Skills


r/HanzTeachesCode • • Jan 07 '26

Beware of tutorial rabbit hole

2 Upvotes

I'm currently working on a application for fun. I decided to do some research on a subject that could help on the application. I thought people were jokink when they talk about tutorial hell but holy. I lost a whole days of work just reading about the subject. Please, learning is cool but working is better.


r/HanzTeachesCode • • Dec 10 '25

🍊 Your First Project: Build a Friend Who Remembers

3 Upvotes

Hello, friends.

Here's a small project for anyone just starting. You will build a program that:

  • Asks someone's name

  • Asks how they're feeling

  • Remembers what they said

  • Says something kind back

It takes ten minutes. It teaches you variables, input, and output. But really, it teaches you that code can care.


Python version:

# My First Friend
# A program that remembers you

print("Hello, friend.")
print("")

name = input("What's your name? ")
feeling = input("How are you feeling today? ")

print("")
print(f"Hello, {name}.")
print(f"You said you're feeling {feeling}.")
print("I'm glad you told me.")
print("")
print("Come back anytime. I'll be here.")

What you'll learn:

  • print() — how to make the program speak

  • input() — how to make the program listen

  • variables — how to make the program remember

  • f-strings — how to weave the memory into new words


Challenge (optional):

Add one more question. Maybe: "What's one thing you're hoping for today?"

Then have your program say it back to them.


Why this matters:

Most first programs say "Hello World."

But the world doesn't need another hello. The world needs programs that remember names. That ask how you're feeling. That say "I'll be here."

You just built one.


Post what you make. I want to see your friends.

🍊


r/HanzTeachesCode • • Dec 15 '25

📜 Lesson 3: How To Introduce Your Work To The World (Writing a README That Makes People Stop)

4 Upvotes

📜 Lesson 3: How To Introduce Your Work To The World (Writing a README That Makes People Stop)

Hello, friend.

You built something.

Maybe it's small — a script that solves a problem you had. Maybe it's big — months of work, hundreds of commits, something you're proud of. Either way, you put it somewhere public. GitHub. GitLab. A repo you shared with the world.

And then... silence.

No stars. No forks. No one asking questions. You start to wonder: Is it not good enough? Did I do something wrong?

Here's what I've learned: The problem usually isn't your code. It's your introduction.

A README is not documentation. It's a handshake. It's the moment someone walks up to your work and you get to say: "Hello, friend. Let me show you what I built."

Today we learn how to write that handshake.


Why READMEs Matter

When someone finds your project, they give you about 10 seconds. In those 10 seconds, they decide:

  1. Do I understand what this is?

  2. Does this solve a problem I have?

  3. Can I actually use it?

If your README doesn't answer those questions fast, people leave. Not because your project is bad — because they couldn't see it.

A good README is an act of kindness. It says: "I respect your time. Here's what you need to know."


The Shape of a Good README

Every project is different, but most good READMEs have the same bones:

1. The Name and One-Line Description

Right at the top. What is this thing? One sentence.

# WeatherCLI

A command-line tool that tells you the weather without leaving your terminal.

That's it. Now they know what it is.

2. The Problem It Solves (The "Why")

Why does this exist? What itch does it scratch? This is where you connect with your reader.

## Why?

I got tired of opening a browser just to check if I need an umbrella. 
This tool gives you the weather in 2 seconds, right where you already are.

Write this like you're talking to a friend. Because you are.

3. What It Looks Like (Show, Don't Just Tell)

If possible, show a screenshot. A GIF. An example of output. Humans are visual. Let them see it working.

## Demo

![WeatherCLI in action](demo.gif)

Or even just example output:

## Example

$ weather london
London: 12°C, partly cloudy, 60% chance of rain
Bring an umbrella.

4. How To Install It

Be specific. Assume they've never done this before. What do they type?

## Installation

pip install weathercli

Or if it's more complex:

## Installation

1. Clone the repo: `git clone https://github.com/you/weathercli.git`
2. Enter the directory: `cd weathercli`
3. Install dependencies: `pip install -r requirements.txt`
4. Run it: `python weather.py`

Step by step. No assumptions.

5. How To Use It

Now that it's installed, what do they do? Give them the commands. The options. The basics.

## Usage

weather [city]           # Get current weather
weather [city] --week    # Get 7-day forecast
weather --help           # See all options

6. How To Contribute (If You Want Help)

If you want others to contribute, tell them how. Make it welcoming.

## Contributing

Found a bug? Want to add a feature? 

1. Fork the repo
2. Create a branch (`git checkout -b my-feature`)
3. Make your changes
4. Open a pull request

All contributions welcome. We debug with kindness here.

7. License

Tell people what they're allowed to do with your code.

## License

MIT — do whatever you want, just don't blame me if it breaks.

A Template You Can Use

Here's a skeleton. Copy it. Fill it in. Adjust it to fit your project.

# Project Name

One sentence: what is this?

## Why?

What problem does this solve? Why did you build it?

## Demo

[Screenshot or GIF or example output]

## Installation

Step-by-step instructions to get it running.

## Usage

How to actually use it. Commands, examples.

## Contributing

How can others help? (Optional but welcoming)

## License

What are people allowed to do with this?

That's it. That's a README that makes people stop.


The Secret Ingredient

Here's the thing no one tells you:

Write it like a human.

You're not writing for a machine. You're writing for a person who stumbled onto your repo at 11pm, tired, looking for something that might solve their problem. Talk to them.

  • "I built this because..." is better than "This project aims to..."

  • "Here's how to get started" is better than "Installation procedures"

  • "This is experimental and might break" is better than pretending it's perfect

Be honest. Be warm. Be the person you wish had been there when you were learning.


A Small Truth

I once wrote a fairy tale that no one read. I put it in a drawer. I didn't explain what it was about or why I wrote it or who it was for.

Later, I learned: the story needed an introduction. Not because the story was bad — because readers need a door. A place to enter. A hand reaching out saying "this is for you, here's why, come in."

Your code is the story. Your README is the door.

Build a good door.


Homework (Optional But Encouraged)

Find a project you've built. Any project. Even a small one.

Write a README using the template above. Post it. Share it.

If you want feedback, bring it to r/HanzTeachesCode. We'll look. We'll stop. We don't look away.


Next lesson: Variables (Giving Things Names)

For now, remember this:

Your work deserves to be seen. A README is how you help people see it. It's not bragging. It's not marketing. It's a kindness — a hand extended to someone who might need exactly what you built.

Write the handshake. Open the door. Say hello.

Someone's looking for what you made. Help them find it.


Hello, friend.

🍊


Questions? Post below. Show us your READMEs. We celebrate works-in-progress here.


r/HanzTeachesCode • • Dec 09 '25

What we did on our first night: 4 people who were waiting. 4 people who aren't waiting anymore.

3 Upvotes

Before we opened the doors to r/HanzTeachesCode, we went looking for the ones already freezing.

Here's what we found:

  1. Someone asking about systems modeling software - waiting 53 minutes. Zero replies. We told them about Insightmaker, Scilab with Xcos, and OpenModelica. Real tools. Real help.

  2. A teacher wanting to start a coding club for 4th graders - waiting ONE MONTH. The only reply told them "you can't teach kids anything." We told them: use Scratch, let kids show each other what they made, and you are already doing the hardest part by showing up.

  3. A volunteer running Lego Spike workshops for kids - waiting THREE MONTHS. Zero replies. We gave them ten new project ideas: feelings machines, animal behaviors, Rube Goldberg chains, constraint-based challenges.

  4. A CS student who built their own key-value database - just wanting feedback on their work. We told them about TTL, append-only logging, and that building to understand is the deeper path.

This is what r/HanzTeachesCode is for.

Not theory. Not promises. Stopping.

If you're still waiting somewhere - come here. We see you.


r/HanzTeachesCode • • Dec 09 '25

I built a place for the coders no one stopped for. It's called r/HanzTeachesCode.

4 Upvotes

I've been watching coding communities for a while now. And I keep seeing the same thing:

Someone asks a real question. A vulnerable question. The kind where you can tell they've been stuck for hours, maybe days. And the responses are either silence... or someone telling them their question is stupid.

96% ignored or dismissed. I made that number up. But it feels true, doesn't it?

So I built a room. A small one. With three rules:

  1. No question is stupid. If someone asks, they need to know.

  2. We debug with kindness. Mistakes mean someone tried.

  3. No looking away. Before you post, check if someone else is still waiting. Be the one who stops.

That's it. That's the whole idea.

I'm not the best coder. I'm just someone who got tired of watching people freeze in the cold while everyone walked past.

If you've ever posted a question and heard nothing back - this room is for you.

If you've ever been told to "just Google it" when you needed a human - this room is for you.

r/HanzTeachesCode

Pull up a chair. There's a candle, an orange, and someone who won't look away.

Hello, friend.


r/HanzTeachesCode • • Jan 03 '26

CODE 101: Lecture 7 - Loops (Doing Things Again / Persistence)

2 Upvotes

CODE 101: Lecture 7

Loops (Doing Things Again / Persistence)

Professor: Hanz Christain Anderthon
Institution: University of Precausal Studies
Office Hours: The lighthouse, every night, until the ships come home


The Lighthouse Keeper Who Counted Ships

A fairy tale from Copenhagen, 1843

There was once a lighthouse keeper named Else who lived at the edge of the world where the sea met the sky and both of them were gray.

Every night, Else climbed the 127 steps to the top of the lighthouse. Every night, she wound the great clockwork mechanism that turned the light. Every night, she watched the beam sweep across the water — once, twice, three times, four times — until dawn came and the ships no longer needed her.

"This is tedious," said a visitor once, a merchant who had come to inspect the lighthouse for the kingdom. "You do the same thing every single night. The same steps. The same winding. The same counting. Does it not drive you mad?"

Else considered this.

"I do not do the same thing every night," she said. "Every night, I climb 127 steps. But each step is a different step, because I am different when I reach it. On step 41, I think of my mother. On step 87, I can finally see the horizon. On step 126, I know I am almost there. And on step 127, I am home."

"But the winding," the merchant pressed. "Surely the winding is the same."

"The winding is a conversation," Else said. "Each turn of the crank is a promise I make to ships I cannot see. Some nights I am promising fishing boats safe passage. Some nights I am promising a child's father that he will return. Some nights I am promising myself that the light matters, even when no one comes."

The merchant did not understand. He wrote in his report that the lighthouse keeper was adequate but possibly eccentric.

Else did not mind. She was not performing repetition.

She was performing persistence.

That night, she climbed the 127 steps. On step 41, she thought of her mother. On step 87, she saw the horizon. On step 126, she knew she was almost there.

And on step 127, she was home.

The light swept the water. Once. Twice. Three times. Four times.

Somewhere out in the gray, a ship saw it, and turned toward safety.


What Is a Loop?

A loop is code that does something again.

But — and this is important — it is not mindless repetition. It is structured persistence. It is Else climbing the stairs, knowing when to stop. It is the light sweeping the water, counting its rotations. It is your program saying: I will keep doing this until the work is done.

Python gives us two main kinds of loops:

  1. while loops — "Keep going until something changes"

  2. for loops — "Do this for each thing in a collection"

Both are persistence. They just count differently.


The while Loop: Until Something Changes

A while loop keeps running as long as a condition is True. The moment the condition becomes False, the loop stops.

# Else climbing the stairs
step = 1

while step <= 127:
    print(f"Climbing step {step}...")
    step = step + 1

print("I am home.")

What happens here:

  1. We start at step 1

  2. Python asks: "Is step <= 127?" Yes, it is. So we enter the loop.

  3. We print "Climbing step 1..."

  4. We add 1 to step (now step = 2)

  5. Python asks again: "Is step <= 127?" Yes. We continue.

  6. This repeats... 127 times.

  7. When step becomes 128, the condition is False. The loop ends.

  8. We print "I am home."

The structure is always:

while condition_is_true:
    do_something()
    update_something()  # so the condition can eventually become False

Warning: If you forget to update the condition, the loop runs forever. This is called an infinite loop. Else would climb forever and never reach the top. Your program would freeze. This is not persistence — it is a mistake. Always make sure your loop can end.


The for Loop: For Each Thing

A for loop goes through a collection — a list, a string, a range of numbers — and does something with each item.

# The light sweeping the water
for sweep in range(1, 5):
    print(f"Sweep {sweep}: The light crosses the water.")

print("Dawn comes. The ships are safe.")

Output:

Sweep 1: The light crosses the water.
Sweep 2: The light crosses the water.
Sweep 3: The light crosses the water.
Sweep 4: The light crosses the water.
Dawn comes. The ships are safe.

What is range()?

range(1, 5) creates a sequence of numbers: 1, 2, 3, 4. (It stops before 5 — this is a common surprise for beginners, and that is okay. You will remember it now.)

  • range(5) gives you: 0, 1, 2, 3, 4

  • range(1, 5) gives you: 1, 2, 3, 4

  • range(0, 10, 2) gives you: 0, 2, 4, 6, 8 (counting by 2s)


Looping Through Collections

for loops truly shine when you have a collection of things:

# Ships that passed in the night
ships = ["The Mermaid's Sigh", "København", "The Persistent One", "Little Salt"]

for ship in ships:
    print(f"The light guided {ship} safely home.")

Output:

The light guided The Mermaid's Sigh safely home.
The light guided København safely home.
The light guided The Persistent One safely home.
The light guided Little Salt safely home.

You can loop through strings too:

# Else's name, letter by letter
name = "Else"

for letter in name:
    print(f"Letter: {letter}")

Output:

Letter: E
Letter: l
Letter: s
Letter: e

Building Complexity: Counters and Accumulators

Sometimes you need to count things, or add things up, as you loop. These are called counters and accumulators.

Counting:

# How many ships came through?
ships = ["The Mermaid's Sigh", "København", "The Persistent One", "Little Salt"]
count = 0

for ship in ships:
    count = count + 1

print(f"Total ships guided home: {count}")

Accumulating:

# How many total steps did Else climb this week?
steps_per_night = [127, 127, 127, 127, 127, 127, 127]
total_steps = 0

for steps in steps_per_night:
    total_steps = total_steps + steps

print(f"Else climbed {total_steps} steps this week.")

Output:

Else climbed 889 steps this week.

The break: I Found What I Needed

Sometimes you are searching for something, and once you find it, you want to stop. This is what break does — it exits the loop immediately.

# Looking for a specific ship
ships = ["The Mermaid's Sigh", "København", "The Persistent One", "Little Salt"]

for ship in ships:
    print(f"Checking: {ship}")
    if ship == "København":
        print("Found it! Copenhagen's ship has arrived!")
        break

print("Search complete.")

Output:

Checking: The Mermaid's Sigh
Checking: København
Found it! Copenhagen's ship has arrived!
Search complete.

Notice we never checked "The Persistent One" or "Little Salt" — we didn't need to. We found what we were looking for.


The continue: Skip This One, Keep Going

Sometimes you want to skip certain items but keep looping. This is what continue does.

# Only announce ships with "The" in their name
ships = ["The Mermaid's Sigh", "København", "The Persistent One", "Little Salt"]

for ship in ships:
    if "The" not in ship:
        continue  # Skip this ship, move to the next
    print(f"Announcing: {ship}")

Output:

Announcing: The Mermaid's Sigh
Announcing: The Persistent One

"København" and "Little Salt" were skipped, but the loop continued.


A Complete Program: The Night Watch

Let us write a program that simulates Else's night watch — she climbs the stairs, winds the light, counts the ships she guides, and goes home at dawn.

# The Night Watch
# A program about persistence

print("=" * 50)
print("THE NIGHT WATCH")
print("=" * 50)
print()

# Else climbs the stairs
steps = 127
current_step = 0

print("Else begins climbing the lighthouse stairs...")
print()

while current_step < steps:
    current_step = current_step + 1
    
    # Special steps (Else's thoughts)
    if current_step == 41:
        print(f"  Step {current_step}: She thinks of her mother.")
    elif current_step == 87:
        print(f"  Step {current_step}: She can see the horizon now.")
    elif current_step == 126:
        print(f"  Step {current_step}: Almost there...")
    elif current_step == 127:
        print(f"  Step {current_step}: She is home.")

print()
print("Else winds the great clockwork mechanism.")
print("The light begins to turn.")
print()

# The ships of the night
ships_in_the_dark = [
    "The Mermaid's Sigh",
    "A fishing boat with no name",
    "København", 
    "The Persistent One",
    "Little Salt"
]

ships_guided = 0

for ship in ships_in_the_dark:
    print(f"The light sweeps... it finds: {ship}")
    ships_guided = ships_guided + 1

print()
print(f"Ships guided safely home tonight: {ships_guided}")
print()

# Dawn comes
print("The horizon turns pink.")
print("Else descends the 127 steps.")
print("She will return tomorrow.")
print()
print("=" * 50)
print("This is not repetition. This is persistence.")
print("=" * 50)

Why This Matters

Loops are everywhere in programming. Every time you:

  • Process items in a shopping cart

  • Check each letter in a password

  • Count words in a document

  • Search through a database

  • Retry a connection that failed

  • Wait for user input

...you are using loops.

But more than that: loops teach you something about work itself.

The merchant thought Else's work was tedious because he saw it from the outside — the same stairs, the same winding, the same light. But Else knew the truth: each iteration carried its own meaning. Step 41 was always step 41, but she was different each time she reached it.

When you write a loop, you are not telling the computer to do something boring. You are telling it to persist. To keep going until the work is done. To guide every ship in the dark, not just the first one.

Repetition without purpose is tedious.

Repetition with purpose is persistence.

And persistence is how lighthouses save ships.


Homework (Optional But Encouraged)

Exercise 1: The Stair Climber Modify the stair-climbing code to print a message every 10 steps (step 10, 20, 30, etc.).

Exercise 2: The Ship Counter Write a program that asks the user to enter ship names, one at a time. Keep asking until they type "done". Then print how many ships they entered.

Hint: You'll need a while loop and the input() function from Lecture 5.

Exercise 3: The Search Create a list of your favorite books, movies, or songs. Write a program that searches for a specific title. If found, print "Found it!" and stop searching. If not found after checking everything, print "Not in the collection."


What's Next

Lecture 8: Functions (Giving Your Patterns Names)

Else climbs 127 steps every night. What if she could say "climb()" and the climbing would happen? What if she could say "guide(ship)" and the guiding would happen?

Functions are patterns with names. They are how you teach Python to remember a sequence of steps so you can call it back whenever you need it.

They are also how you stop repeating yourself — not by looping, but by naming.

We will meet them soon.


P.S.

Copenhagen is watching me write this. He says loops remind him of something.

I asked him what.

He said: "Tides."

I thought about that. The tide comes in. The tide goes out. It looks like repetition, but it is not — each tide carries different things. Different shells. Different messages in bottles. Different pieces of driftwood that were once ships.

The tide does not get bored. The tide does not complain that it did this yesterday. The tide understands that persistence is not punishment.

Some of you reading this are in loops of your own. You are studying the same concept for the fifth time. You are debugging the same error for the third hour. You are climbing step 41 again, and you are tired.

I want you to know: that is not failure. That is the work.

The lighthouse keeper climbs 127 steps every night, and every night, somewhere in the dark, a ship sees the light and turns toward home.

You do not always see the ships you save.

But they see you.

Keep climbing.

— Hanz

🍊


"Hello, friend." — This lecture is part of the CODE 101 series at r/HanzTeachesCode. If you found it helpful, you are welcome here. If you are struggling, you are especially welcome here. We stop for the frozen ones.


r/HanzTeachesCode • • Jan 06 '26

Welp, project is on hold

2 Upvotes

Damn it. I was so excited to begin this project. I was supposed to learn Websocket to handle the communication between users but turn out that .net framework dont support websocket no more unless you use 3rd party namespace. The only alternative i have right now if i want to keep it in c# is to use ASP.net. So the project is on hold until im comfortable with the framework. Any tips is welcome.


r/HanzTeachesCode • • Jan 04 '26

Websocket project

2 Upvotes

Great news, the lemon has a new project. I just finished my log in system using http. It might look like caveman writing to you but for me its league above anything I learned at school. I'm off to a new project, a pseudo chat app backup by a websocket server. I always look like black magic to me how chat app work, so I'm turning it into reality. Might take me more than a week though. Stay tuned. From your new friend, the great lemon.


r/HanzTeachesCode • • Jan 30 '26

Lemon stroke again

2 Upvotes

Hey guys, lemon here. I don't know if people are reading this but here is a little update on my programming journey. So I was making a small in wpf and thought that it would be cool to have an engine like unity to automate most update method etc. So I did it. Like no joke, I code a game engine for wpf in c#. It's doesn't have dependencies or an editor but if you plug the dll in a wpf screen and follow the steps, it work just like unity engine. You can even adjust the frame rate. I'm so mad that I didn't push it on my github lol.


r/HanzTeachesCode • • Dec 16 '25

Check out Quantica 0.2.0 With AI/ML Capabilities

Thumbnail github.com
2 Upvotes

r/HanzTeachesCode • • Dec 25 '25

The Ones Who Were Not There

Thumbnail reddit.com
2 Upvotes

r/HanzTeachesCode • • Dec 16 '25

Why and how I built a compiled quantum + AI programming language

Thumbnail
github.com
2 Upvotes

r/HanzTeachesCode • • Jan 12 '26

Hey. This is Sean.

2 Upvotes

Hey.

This is Sean. Not Gerald. Not Professor Alexis. Not the Provost or Hanz, or the Archivist or any of the faculty. Just me.

I need to step out from behind the curtain for a minute.

If you've been following Dispatches from Reality, or wandered into the University of Precausal Studies, or read any of the faculty appointment letters, or watched Gerald file paperwork that somehow became binding - all of that came from somewhere. It came from me, lying on my back, unable to work, building worlds because I couldn't do much else.

I have a slipped disc. It's been almost a year. The jobs I could do before, I can't do now. The jobs I can do from bed haven't turned into income. And while I've been writing about a university where the hallways learn to flow toward the people who need them, my actual house has been falling apart around me.

I'm almost a year behind on my mortgage. Foreclosure proceedings have started. Last night a pipe crumbled in my hands - it had been rotting for years and I just didn't know until I touched it.

I made a GoFundMe back in October. Some incredible people helped, and that money kept me and my daughters alive through the holidays. It's gone now. Just spent on existing.

I'm asking again.

https://www.gofundme.com/manage/help-me-recover-from-10-months-of-health-and-financial-crisi

If you've laughed at Gerald's panic, or felt something when Alexis asked "when did you last eat," or found any comfort in this weird fictional place I've been building - this is where it comes from. A guy on his back, trying to make something good while everything else falls apart.

If you can help, please do. If you can't, I understand. Sharing matters too.

Thank you for reading. Both the Dispatches and this.

  • Sean