C. Keith Ray

C. Keith Ray writes about and develops software in multiple platforms and languages, including iOS® and Macintosh®.
Keith's Résumé (pdf)

Wednesday, June 12, 2019

Advice to a young programmer

Someone on Quora asked:

"I make so many mistakes while coding. All code reviews get lot of review comments and sometimes it’s create regression on the system too. Am I not good for developer role?"
My answer:

Sometimes review comments are more about the commenter than the code or you: they're telling you how THEY would write the code rather than evaluating the code on its own merits.

On the other hand, causing regressions is not at all desireable. Why didn't the reviewers catch the source of the regression? Did you have tests you should have run before checking in the code? What could you have done to find the side-effects of your changes?

Keep a journal: what did the code look like before the review and after changes required or requested by the reviewers. Do you understand why the "after" code is better? Are there things you didn't know that you needed to do?

Also journal your bugs and bug-fixes. When you make a fix, did you look for other places in the codebase with the same or similar problems? Can you fix that code too?

You can learn most rapidly if you pair-program. (Google it. There's a book on that subject.) Can you pair-program bug-fixes or new code with a partner? As a junior programmer, you should "drive" while the experienced programmer "navigates". 

Or try Mob Programming: the whole team can learn and code at the same time. You can also pair program with testers (to replicate and fix a bug) and/or analysts/designers (implementing new features), though they will have less to teach you about coding.

Software development is exacting. One semi-colon in the wrong place can create a  bug that may not show its effects for years. That bug could be harmless or it could cost multiple companies millions of dollars. In this paragraph, I used "its", which is the possessive version of "it". Many people, whether native English speakers or not, would have incorrectly used "it's", which is the contraction of "it is". You have to have the same level of knowledge for your programming languages and development tools as I have for English.  (Also, it's a rule that whenever someone writes about correct English grammar or spelling, they will make a mistake or two.)

Beware of cutting and pasting code from Stack Overflow: a lot of it is wrong or out of date. You need to understand why the code offered in SO is right or wrong for your situation.

If being extremely detail-oriented and knowledgeable about your code is too hard for you, then programming may not be your best career choice. I don't want to say that programming has to take over your life, but mastering it will take commitment and time. 

Comedian Bob Newhart joked that as an accountant, he was happy getting the books almost right. He said his bosses didn't find that funny. So he quit accounting and became a famous stand-up comic/actor.


No comments:

Post a Comment