Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: To beat my impostor syndrome (and learn Bash), I read the RBENV GH repo (richie.codes)
2 points by toomanyrichies on April 20, 2024 | hide | past | favorite
What's the first thing that happens when you type `bundle install` into the terminal and hit "Enter"?

Professionally, I work on a large Rails codebase with many contributors, and `bundle install` is one of the most common commands we find ourselves typing. I was frustrated that I didn't know how this command worked under-the-hood. Since I'm a big believer that "The best way to learn something is to explain it to someone else", I decided to blog about what I was learning, as I learned it.

Because I use RBENV to manage my Ruby version, the first file I encountered on this deep-dive was RBENV's shim for the `bundle` command, which is written in Bash. From there, I moved on to the files for the various commands that RBENV's API exposes, and things kind of snowballed from there.

Through consistent daily practice, eventually I worked my way through the entire RBENV codebase. I learned things like:

-What a shebang is

-What the `$PATH` variable is, and how it's used

-How to read and modify UNIX's file permissions

-What POSIX is

-How to use parameter expansion to succinctly modify variable values

-How to use command substitution to store the output of a command in a variable

-What shell options are, and how to set them with the `set` command

-How to use `export` to turn a shell variable into an environment variable, and what the difference is

-The difference between `exec` and forking, and when to use each one

-What a process is

Learning Bash was a great result from this process, but the biggest benefit was the slow transformation from thinking "Maybe a 10x engineer could understand this code, but not me" to "Oh, that's all this code does?" My hope is that other people who similarly suffer from impostor syndrome will be inspired to repeat this process with a codebase that is relevant to them. I'm now looking forward to repeating this process on other seemingly intractable codebases, and growing my circle of competency even further.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: