<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/learnings-from-a-student-s-terrible-code-aa1kmt1d0" -->

---
title: Learnings From a Student's Terrible Code | daily.dev
description: A programming instructor shares a memorable story about a student who fundamentally misunderstood how functions and variables work in Ruby. The student wrote...
canonical: https://daily.dev/posts/learnings-from-a-student-s-terrible-code-aa1kmt1d0
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Learnings From a Student's Terrible Code | daily.dev
og:description: A programming instructor shares a memorable story about a student who fundamentally misunderstood how functions and variables work in Ruby. The student wrote...
og:url: https://daily.dev/posts/learnings-from-a-student-s-terrible-code-aa1kmt1d0
og:image: https://api.daily.dev/og/posts/aA1kMt1D0.png
og:image:alt: Learnings From a Student's Terrible Code
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Learnings From a Student's Terrible Code

**[Marc G Gauthier](https://daily.dev/sources/marcgg)** · 3 min read · 0 upvotes · 0 comments

## Summary

A programming instructor shares a memorable story about a student who fundamentally misunderstood how functions and variables work in Ruby. The student wrote two separate functions with hardcoded values instead of a single general-purpose function, believing one function couldn't return two different results. The author draws three lessons from the experience: never assume what is obvious to others, create safe spaces for questions, and practice empathy when teaching people who struggle with concepts that feel intuitive to experienced developers.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://marcgg.com/blog/2024/04/03/learnings-from-bad-code/>

## Similar posts on daily.dev

- [The Case for Writing Terrible Code on Purpose](https://daily.dev/posts/the-case-for-writing-terrible-code-on-purpose-iewbedjdk) · Medium · 0 upvotes · 0 comments

---

Tags: [#ruby](https://daily.dev/tags/ruby), [#tdd](https://daily.dev/tags/tdd)

[View this post on daily.dev](https://daily.dev/posts/learnings-from-a-student-s-terrible-code-aa1kmt1d0)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Learnings From a Student's Terrible Code","url":"https://daily.dev/posts/learnings-from-a-student-s-terrible-code-aa1kmt1d0","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/learnings-from-a-student-s-terrible-code-aa1kmt1d0"},"datePublished":"2026-03-26T08:36:09.722Z","dateModified":"2026-03-26T08:39:51.534Z","description":"A programming instructor shares a memorable story about a student who fundamentally misunderstood how functions and variables work in Ruby. The student wrote...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c2a963a909b5e675f578332e3e8f744b?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c2a963a909b5e675f578332e3e8f744b?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Marc G Gauthier","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Marc G Gauthier","logo":"https://media.daily.dev/image/upload/s--P4lsZKFE--/f_auto,q_auto/v1774514113/logos/marcgg?_a=BAMAMiWQ0","url":"https://daily.dev/sources/marcgg"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/learnings-from-a-student-s-terrible-code-aa1kmt1d0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ruby,tdd","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Marc G Gauthier","item":"https://daily.dev/sources/marcgg"},{"@type":"ListItem","position":3,"name":"Learnings From a Student's Terrible Code"}]}
```

