<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Henry Anayo</title>
    <description>The latest articles on DEV Community by Henry Anayo (@hanayo).</description>
    <link>https://dev.to/hanayo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3966038%2F3815caf5-99ce-4a35-9754-7df3a62b9efe.jpg</url>
      <title>DEV Community: Henry Anayo</title>
      <link>https://dev.to/hanayo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hanayo"/>
    <language>en</language>
    <item>
      <title>Building an ASCII Art Generator in Go: What My First CLI Project Taught Me</title>
      <dc:creator>Henry Anayo</dc:creator>
      <pubDate>Tue, 30 Jun 2026 08:22:15 +0000</pubDate>
      <link>https://dev.to/hanayo/building-an-ascii-art-generator-in-go-what-my-first-cli-project-taught-me-f9n</link>
      <guid>https://dev.to/hanayo/building-an-ascii-art-generator-in-go-what-my-first-cli-project-taught-me-f9n</guid>
      <description>&lt;p&gt;When I started learning Go, I wanted more than just solving coding exercises. I wanted to build something that would force me to understand how different parts of the language work together.&lt;/p&gt;

&lt;p&gt;That's how I ended up building an ASCII art generator—a command-line application that converts ordinary text into large, stylized ASCII characters.&lt;/p&gt;

&lt;p&gt;At first, it looked like a simple project. It wasn't.&lt;/p&gt;

&lt;p&gt;Along the way, I learned about file handling, command-line arguments, error handling, data structures, and the importance of writing clean, maintainable code.&lt;/p&gt;

&lt;p&gt;In this article, I'd like to share what I built, how it works, and the lessons I learned along the way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is ASCII Art?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ASCII art is text that's arranged to create images or stylized letters using standard keyboard characters.&lt;/p&gt;

&lt;p&gt;Instead of printing:&lt;/p&gt;

&lt;p&gt;Hello&lt;/p&gt;

&lt;p&gt;the program can output something much larger and more decorative using a predefined font stored in a text file.&lt;/p&gt;

&lt;p&gt;The application reads these character patterns from banner files and combines them to display the final output.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Breaking the Problem Down&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
One lesson I learned early was that large problems become much easier when they're divided into smaller ones.&lt;/p&gt;

&lt;p&gt;Instead of trying to build everything at once, I focused on individual tasks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reading user input.&lt;/li&gt;
&lt;li&gt;Loading the correct banner file.&lt;/li&gt;
&lt;li&gt;Finding each character's ASCII representation.&lt;/li&gt;
&lt;li&gt;Printing each line in the correct order.&lt;/li&gt;
&lt;li&gt;Handling invalid input gracefully.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Solving one problem at a time made the overall project much less intimidating.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Go Concepts That Finally Clicked&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Working on this project helped several Go concepts make much more sense.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Reading Files&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Before this project, reading from files felt abstract.&lt;/p&gt;

&lt;p&gt;Now I understood why applications need to read configuration files or other external resources instead of hardcoding everything.&lt;/p&gt;

&lt;p&gt;Loading the banner file was one of the most important parts of the project.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Error Handling&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Go encourages developers to handle errors explicitly.&lt;/p&gt;

&lt;p&gt;Rather than assuming everything would work, I learned to check whether:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the banner file exists,&lt;/li&gt;
&lt;li&gt;the user's input is valid,&lt;/li&gt;
&lt;li&gt;the selected banner is supported,&lt;/li&gt;
&lt;li&gt;and the application can continue safely.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Good error handling doesn't just prevent crashes—it also makes applications much friendlier to users.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Loops&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;ASCII art is built line by line.&lt;/p&gt;

&lt;p&gt;That meant looping over characters, then looping again over each line of every character pattern.&lt;/p&gt;

&lt;p&gt;This gave me a much deeper appreciation for nested loops and why they matter in real-world programs.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Maps and Slices&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The project also reinforced how useful slices are for storing collections of data and how important indexing becomes when processing structured text.&lt;/p&gt;

&lt;p&gt;Instead of simply memorizing syntax, I finally understood why these data structures exist.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenges Along the Way&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not everything worked the first time.&lt;/p&gt;

&lt;p&gt;Some of the issues I encountered included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Characters printing out of alignment.&lt;/li&gt;
&lt;li&gt;Missing lines in the output.&lt;/li&gt;
&lt;li&gt;Incorrect handling of newline characters.&lt;/li&gt;
&lt;li&gt;Invalid banner selections.&lt;/li&gt;
&lt;li&gt;Debugging logic that looked correct but produced unexpected output.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These moments were frustrating, but they also taught me that debugging is part of software development—not a sign that you're doing something wrong.&lt;/p&gt;

&lt;p&gt;Every bug forced me to better understand my own code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Biggest Lesson&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The biggest lesson wasn't about ASCII art.&lt;/p&gt;

&lt;p&gt;It was about thinking like a software engineer.&lt;/p&gt;

&lt;p&gt;Instead of asking:&lt;/p&gt;

&lt;p&gt;«"How do I write this program?"»&lt;/p&gt;

&lt;p&gt;I started asking:&lt;/p&gt;

&lt;p&gt;«"How should I break this problem into smaller pieces?"»&lt;/p&gt;

&lt;p&gt;That change in mindset made programming feel much more manageable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's Next?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Building this project gave me confidence to tackle larger applications.&lt;/p&gt;

&lt;p&gt;I'm now exploring backend development with Go while also learning more about cloud technologies and DevOps tools such as Terraform.&lt;/p&gt;

&lt;p&gt;Each project teaches something new, and every challenge makes the next one a little less intimidating.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Looking back, this project wasn't just about generating ASCII art.&lt;/p&gt;

&lt;p&gt;It was about learning how to approach problems, read unfamiliar code, debug patiently, and keep improving one step at a time.&lt;/p&gt;

&lt;p&gt;If you're learning Go, don't be afraid to build projects that seem slightly beyond your current ability.&lt;/p&gt;

&lt;p&gt;They'll probably teach you more than another tutorial ever could.&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>go</category>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
