On finally learning to program at the age of 40
This story was rather poignant for me, as I am, let&#x27;s just say quite a bit over 40.<p>I learned to program when I was in high school and noticed a Teletype 33 ASR in a corner of the math classroom. I knew about Teletypes from being a ham radio operator, but I thought they were just for sending and receiving text over the air or over a phone line to another Teletype. You could either connect to the other Teletype and type in real time, or you could punch a paper tape first and then send it over the air or across the wire at the full speed of 10 characters per second.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Teletype_Model_33" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Teletype_Model_33</a><p>This Teletype was special, though. The school had an account with a local timesharing computer company, and for a mere $30 per hour ($200&#x2F;hour in today&#x27;s dollars) you could dial in and <i>run a BASIC program</i>.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Time-sharing" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Time-sharing</a><p>Naturally my first program was:<p><pre><code>  10 PRINT &quot;HELLO&quot;
</code></pre>
and it printed HELLO!<p>You can probably guess the next line I added to the program:<p><pre><code>  20 GOTO 10
</code></pre>
Whoops! This wasn&#x27;t just text scrolling on a screen, it printed out line after line on the roll of Teletype paper. Had to hang up the dialup modem fast.<p>That summer I got a job as &quot;night operator&quot; at the timesharing company (Transdata in Phoenix, AZ). The great thing about this job was they shut down the timesharing service at night. So I had their SDS Sigma 5 all to myself. My first personal computer!<p>I found a copy of the Algol-60 Report and taught myself Algol. And then Sigma 5 machine language. It was great fun to see how much of a program I could write on a single punch card (80 bytes).<p>We had a nice single-card program that you could put in front of a deck of cards to print out the whole card deck. But it was kind of slow, because it would read a card, print the card, read the next card, print that one, etc.<p>There were a few bytes left on that print program card, so I squeezed in code for a double buffer. It would read the first card, start it printing, and then <i>while it printed</i> read in the next card, overlapping the reads and writes so it printed twice as fast.<p>That fall I went to Caltech, lasted a year and flunked out. I loved science and math, but when we got to partial differential equations my mind just couldn&#x27;t handle it. But there was a systems programming class, and the final project was to write an infix expression parser and evaluator with operator precedence in assembly language.<p>I was the only person in the class to turn in a complete working program with test cases. I could probably tell you exactly where I was sitting when the instructor announced the results. I had found my calling, and have been at it ever since.<p>My secret weapon: while everyone was punching cards with their program, submitting the batch job, and waiting hours or overnight for the core dump when it crashed, I found an <i>interactive console</i> on campus where I could code and run and test my program in real time. Just like the Teletype I learned on.<p>Moving forward to the present, I interviewed with a FAANG company last week. It reminded me a bit of the discouraging experience the article&#x27;s author initially had with LOGO and competitive programming.<p>Everyone I interviewed with, and the company recruiters, were all super nice and supportive. But the gist of the interview process was to tackle four medium to hard algorithm problems and come up with not only a working solution but a perfectly optimized solution, in 15 minutes each!<p>The recruiters advised me to spend at least an hour or two every day for two weeks on LeetCode banging through as many algorithm problems as I could, timing myself to see if I could solve each one with optimized code in that 15 minute time limit.<p>There was also a system design interview focused on scaling out a backend system to support a billion users. I explained to the recruiter and the interviewer that this wasn&#x27;t my forte, but I had a lot of experience with low level hardware interfaces and was really interested in a job in their hardware group. They don&#x27;t hire for a specific role like that, though, they hire &quot;generalist engineers&quot;, which means being able to come up with a fully optimized solution for any algorithm in 15 minutes - and without the ability to <i>run and test your code</i>.<p>In fact, they used an online code editor that normally lets you do just that, but this capability was disabled. I suppose they were trying to limit the online editor to match the capabilities of what you could do scribbling code on a whiteboard.<p>This all reminded me of what discouraged the OP&#x27;s author so much about his initial foray into programming: the competitive coding competition with LOGO. That is fun for some people, but not for him and not for me. I would rather learn how to <i>cooperate</i> with other programmers, not compete with them.<p>One of the algorithm problems stuck in my mind. Of course it was a LeetCode problem that you can read about here:<p><a href="https:&#x2F;&#x2F;leetcode.com&#x2F;problems&#x2F;valid-palindrome-ii&#x2F;" rel="nofollow">https:&#x2F;&#x2F;leetcode.com&#x2F;problems&#x2F;valid-palindrome-ii&#x2F;</a><p>&quot;Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome.&quot;<p>In Python, there is a simple solution for this:<p><pre><code>  def is_palindrome_with_at_most_one_character_deleted( string ):
      if string == string[::-1]:
          return True
      for i in range( len(string) ):
          s = string[:i] + string[i+1:]
          if s == s[::-1]:
              return True
      return False
</code></pre>
If the string slice notation is unfamiliar, here are some references:<p><a href="https:&#x2F;&#x2F;www.google.com&#x2F;search?q=python+slice+notation" rel="nofollow">https:&#x2F;&#x2F;www.google.com&#x2F;search?q=python+slice+notation</a><p>But of course this simple solution would not be good enough. What about the time complexity?<p>This LeetCode problem has 520,862 submissions at the moment, with 191,325 accepted. The solution above would not be accepted.<p>There is a faster solution, but it is less obvious and prone to off by one errors and other logic errors. It&#x27;s not <i>that</i> complicated, but not something I would expect anyone to code correctly and verify in 15 minutes.<p>If that kind of competitive programming was what programming looked like to me, I could see myself being easily as discouraged as the OP was.<p>Fortunately there are other fish to catch in this grand ocean of programming!