The best code is no code

Dear new developer,

It’s paradoxical, but sometimes the best thing you can do is not write code. Remember, the value you provide is to solve the problem you are faced with (the outcome), not to write code. Custom code has value, but comes with costs. It needs to be deployed, maintained and upgraded. It has bugs. It requires a developer to change. It also has opportunity cost. Writing custom code to accomplish task A means that you won’t have time to accomplish task B, which may be either more urgent, more important or both.

There are a couple of ways in which you might solve a business problem with out writing a lick of code.

  • Use a library or framework. For instance, I worked at a place where they had written their own database connection pool. Why? I never got a great answer, but it wasn’t clear to me that one of the open source solutions wouldn’t have worked. You need to have an awareness of such libraries to be able to propose this.
  • Use a third party SaaS tool. I’ve seen people run their own in house git repositories. There may be good reasons to do this (including security or privacy concerns). But Github is going to give you a far better experience and unless you have a big team, probably better security and privacy. You need to know what the problem, the solution and the cost are to make an effective suggestion.
  • De prioritize the work. I was at a meeting with a CEO and we were talking about continuing an effort to integrate a set of outside data sources. I asked why, and we discussed it a bit further. It became clear that the reason we were thinking about doing it was because of inertia. It became clear that there was no real business reason to do it, and we prioritized other work instead. A clear roadmap and the willingness to question requirements are helpful with this path.
  • Do it manually. I was working on a startup and we had the need to occasionally refund customers. I could have integrated with the payment provider and had this case be handled automatically, but it was much much easier to document the process and handle it manually. Refunds happened rarely enough that there was no value in automating them. Here it is helpful to know how often the problem arises, how long it takes to fix manually, and how often it will arise in the foreseeable future.

Now, sometimes you may not understand the larger context of your work. You may propose a solution that isn’t the right fit, and there’s certainly nothing wrong with writing custom code to solve a problem.

In cases where I’m not sure I have full understanding, I always preface my questions with “I am not sure I have the full picture, but I think we could solve the business problem using solution A or project B, rather than writing custom code.” If you are working directly with the client, they likely won’t care, as long as the problem is solved. If you are on a team, the engineer or project manager running your project should have a good understanding of alternatives and why custom code might be the right solution. Most folks will be happy to share that reasoning with you.

In short, it’s better to keep your eyes on solving the business problem and be aware that custom code isn’t always the right answer.

Dan

PS No, this isn’t an April Fools Day post 🙂

Learn to use Google, and use it well

Dear new developer,

Searching is important to writing and understanding software. Less so for giving you a base of knowledge. For that, I’d seek out books, video classes or side projects, depending on how you learn. Googling well is tough if you don’t know what terms to use. (I’ll use google as a synonym for a generic search. I’ll address issues of other search engines below.) Once you have a firm base of knowledge and understand software jargon, you can stand on the shoulders of giants.

Tips for searching:

  • Google the exact error message (almost). When you get an error message like nginx_1 | 2019/01/06 20:42:22 [crit] 11#11: *1 connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied), don’t just cut and paste it into the search box. Look at the error message, and see what is unique to your situation. For the error message above, text like the nginx instance name, nginx_1, and the date and time, 2019/01/06 20:42:22, are unique to my installation. Searching on them won’t be useful. But the message text starting with connect() looks like it will be far more common and will likely yield good results.
  • Read the results, whether forum post or documentation, carefully. I’ve been bitten by this more times than I care to remember. But it’s very easy, when you find a stack overflow, forum or other result that seems to apply, to just cut and paste the top answer as quickly as possible and get back to what you were doing before you started searching. This is the quick path, but the better choice is to read the entire page and make sure that they are addressing the same issue that you are trying to address. You also want to pick the best solution (which may not be the first one, especially if the page is old). Sometimes newer libraries or releases have different paths forward, and so you should try to map the software you are working in to the one that the page refers to. The other reason to scan the entire page is that it will give you a sense of the different solutions. The underlying goal of doing the search is to incorporate the knowledge into your understanding so that you won’t have to do this Google search in the future (you may have to search in your project or commit log, but that’s quicker than redoing a google search, especially months from now). Trying to understand all the solutions and what they are doing is a way to be a just in time learner. Mindlessly copying the solution isn’t.
  • Add links to what you find in your commits and your comments. Do this especially if the solution is complicated or esoteric. You should of course write a commit message that explains your intent, but adding in the link can give additional context.
  • Think about the terms you use in the query. This is where foundational knowledge comes in. For example, if you know that active record is an object relational mapping tool, or that ruby is a dynamic language where every class can change another (which is called “monkey patching”) then you can know how to google for things related to these concepts. If you want to change a specific active recrod behavior, you might google “how to monkypatch active record” which will get you far more focused results than “how do change the rails database system”. This ca be iterative. Pay attention to the terms used in posts you find, and use them in new queries.
  • Consider using an alternate search platform. I use duckduckgo.com as my default search engine. Frankly, it’s not as good as Google, but it gives answers I need in about 75% of the searches, and I can easily run the same search on Google if I need it. I am supporting an alternative search ecosystem that will be better for the internet in the long run.

A last point is important enough that I’m going to break it out. Google, and search engines in general, work well because there’s content out there produced by people. You can take part in producing that content, either by adding to stackoverflow (which can be as simple as just voting an answer up or down–after you’ve tried the solution out), writing a blog post or responding to that forum post. If you encounter an issue no one has ever seen before, write it up, like I did here. This participation in the wider internet is crucial for the continuing useful functioning of the internet. So, participate in some way and give back.

 

Using Google to solve problems lets you leverage the hive mind for your development work. Don’t just use it. Use it well.

Sincerely,

Dan

Use an RSS Reader

Dear new developer,

I highly suggest using an RSS reader. I use Newsblur, but there are several good ones out there. This will let you keep on track of any publishing platform that has an RSS feed. This includes this site, but many many others.

You can use it to keep tabs on your favorite online community discussions, tags in Stackoverflow or your favorite blogger. You can even use it to monitor your social media feeds, by using Zapier.

Think of it like a centralized information hub. Instead of you having to go to bunch of different places, you can just go to one. It’s similar to Facebook or Twitter, but the content tends to be long form and richer.

RSS is a venerable format, but one that still works. By using an RSS reader you’re also supporting open web protocols, so you get extra points for that.

Sincerely,

Dan

Get an external email address

Dear new developer,

When you are starting at any company, you’ll get a company address: dan@company.com. You’ll want to use that for all company communications.

You may have a personal email address: fuzzyguy@gmail.com (not my real personal email address 🙂 ).

But as soon as you can, you’ll want to get an external email address at a reputable provider like gmail or protonmail and have a professional looking email address, something like danmoore@gmail.com. If your fullname is taken, then add digits or variations: dannymoore@gmail.com, dan12@gmail.com, etc.

If you want to get fancy, register your own domain name and then set up an email address: dan@danmoore.com.

There are a number of nice things about having this external email address:

  • You can put it on your resume when you are applying for jobs and it will look professional. Though there are a lot of means of communication, email is still the major method of cross business communication.
  • You can have it for life, which means in ten years when you want to reach out to that one woman who was a linux kernel specialist, you can search for the message you sent to her. I have had my personal email address for almost twenty years. I don’t often search far back, but when I do it’s nice to have one place to go and look.
  • You can use it in your goodbye email to your company to keep in touch with people. (You will eventually leave the company, and while I suggest you connect to everyone on LinkedIn, some people don’t use it. Almost everyone has an email.)
  • You can use it as the email address of record for your “developer brand” accounts. These accounts will follow you for life and you don’t want them tied to any company email address. Things like Stackoverflow, github, or your online community accounts should all be tied to this professional, external email address.

Sincerely,

Dan

Learn two languages

Dear new developer,

Learn two languages.

When you know just one language, you can go a long way, especially if the language is dominant. In web development, that language is javascript. In system programming it’s C. Both of these languages will be around forever, and you’ll always be able to get a job writing them.

You can also know one non dominant language and get pretty far, though if that is your choice, you will probably be happier at a big company with supporting infrastructure. Something like ruby for web development or go or rust for systems programming.

But, knowing just one language is like living in the same town all your life. You can be happy doing that, but just the exposure to life in a different city will shake you and show you that what seemed like a universal truth was actually just an assumption.

I cut my teeth on perl and wrote a lot of it for my first professional job. Then I had to write some java. The first java I wrote was not idiomatic. Rather than use small custom objects, I just leveraged hashmaps and lists for my data structures. I remember one of the other engineers going over some of my code and saying “that looks a lot like perl written in java!”.

Specifically, learning a new language will:

  • let you see the strengths and weaknesses of your first language
  • let you bring concepts from language number two back to your code in language number one
  • make it far easier to learn a third language, should you choose or need to do so
  • make you aware of different approaches to common problems
  • may make it easier to implement certain kinds of problems. In my experience this is often due to open source libraries that may be available for one language that aren’t for another
  • make you less passionate. This may seem like a strange benefit, but learning another way to do things often helps you realize that a programming language is just a tool, and that different tools are of course better for different things.
  • let you build a mental map to apply to the new language based on the old language. “I know that there’s a way to iterate over a list in perl, so there must be a way to do so in java.” This will also help you learn common software terms (like “iterate”) which will help you in your searching.

These truths apply not just to languages, but other pieces of the software development process. Learn two of everything. Databases, frameworks, development methodologies. The increase in perspective and the ability will be worth the extra effort.

Sincerely,

Dan

Use LinkedIn, and use it well

Dear new developer,

Set up a LinkedIn profile and keep it up to date. This will serve as a public resume. (Yes, a github is great too, but you might not always have time to keep code up to date or an interest in a maintaining a large project.) Once a year, at a minimum, document what you’ve done in your profile. This is a low effort way to showcase your skills. LinkedIn has a vested interest in being at the top of the search results when people search for your name. And hiring managers will.

Also, used LinkedIn to record connections to people that you meet (at jobs, conferences, meetups or randomly). Folks have different thresholds for connecting (some people connect to anyone, some people want to meet you, some people want to have worked with you). It doesn’t hurt to ask; just don’t be offended if someone says no thanks. My threshold is “have I met you in person or engaged with you online”. This means that my connections are of varying strength–some connections I’d hire (or work for) with no question, others I met once and have never talked to again.

Recruiters on LinkedIn tend to be low value keyword matchers, unfortunately. But you never know, someone might be able to place you. If you do talk to a recruiter, be honest about your desires. Take what they say with a grain of salt, as when they are talking to you, they are trying to make a sale. Also make sure you ask them about their view of the job market, salary ranges for people with your experience, and good skills to gain. If they aren’t willing to share such information, they probably won’t be much good to work with.

As a friend put it, LinkedIn is a rolodex that someone else keeps up to date. This can be helpful when you are looking for a job. Troll your connections’ companies, and then ask if your connection and intro you. A warm intro is far more likely to lead to a conversation and interview than submitting a resume via a website. I offer that up to many people as it’s a low effort way to add value to someone on the job hunt.

Sincerely,

Dan

Use stackoverflow, and use it well

Dear new developer,

Stackoverflow (SO) is great for three different kinds of developers (and someone can be all three over time):

  • those who are looking for answers, usually via Google (searchers)
  • those who are looking to showcase knowledge, usually by answering questions (answerers), and
  • those who have a specific question to ask (askers)

Every developer can be a searcher (all you need is Google). But you can look for answers poorly or well. Do it well by reading all the answers, understanding the question that shows up in the search results, and voting up both questions and answers. The voting in particular is a low effort way to add value to the entire developer ecosystem (because you are providing value to other searches). I know it is easier to take the first answer and move on with whatever task you are trying to get done, but try to take a bit more time and help others.

But you should strive to be an answerer or an asker. See if you can answer questions or add comments to clarify them or point to other answers. If you have a question that isn’t answered on SO, take the time to build out a solid question. If you end up finding the answer to your question, self answer it to help other folks out.

It is true that SO is not the most welcoming community, but it’s the preeminent question and answer site and so worth having a presence on. Don’t forget, the smallest amount of help you provide to SO may resound for years. I only have ~3k reputation but have reached almost 950k people. And beyond helping others, it’s a great way to demonstrate competence without venturing too far out of your normal workflow.

Sincerely,

Dan Moore