You Can't Be Looking Up map
- 2 minutes read - 242 wordsWhen I was learning to program, I was fortunate to pair with very experienced
engineers. One day while coding, I said: “I think we need to use Ruby’s map
method, but I’m not sure how that works. Let me look it up.”
Later, my pair offered some feedback: “You can’t be looking up map
. You need
to know how all of Ruby’s Enumerable methods work.”
This bit of radical candor was part of a series of challenges I faced early as a junior engineer. They shook me out of impending Expert Beginnerism. They expanded my concept of engineering excellence.
He was right. A hallmark of great programmers is that don’t waste energy on fundamentals like these. They have extensively explored each of their tools, be it the languages and frameworks in use, terminal, text editor, operating system, browser, or application infrastructure. In the rare case where they don’t know what to do, they know a great question to ask and can find the answer quickly.
That year I really learned Ruby’s Enumerable library. I read the documentation
cover-to-cover (boring but essential), tried to reverse-engineer many of the
functions in Ruby (extremely valuable), and used and misused each extensively
as my programming evolved. I honed opinions on when to use each
, map
,
filter
, reduce
, plus specialists like include?
, any?
, and all?
. I
know what the best method for the job is, balancing conventions, readability, and
performance. I stopped having to look them up.