DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Best GitHub-Like Alternatives for Machine Learning Projects
  • Deploy MuleSoft App to CloudHub2 Using GitHub Actions CI/CD Pipeline
  • What Do You Mean by Debugging in C?
  • Continuous Integration for iOS and macOS

Trending

  • Breaking Down Silos: The Importance of Collaboration in Solution Architecture
  • Best Practices for Developing Cloud Applications
  • Decoding Business Source Licensing: A New Software Licensing Model
  • How TIBCO Is Evolving Its Platform To Embrace Developers and Simplify Cloud Integration
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. How Reviewing Strangers’ Code on GitHub Can Make You a Better Programmer

How Reviewing Strangers’ Code on GitHub Can Make You a Better Programmer

GitHub is a wonderful resource for programmers looking to improve their skillset. Although we often struggle to find the time to commit to opensource, even by simply reviewing code we can improve ourselves.

Ryan Pinkham user avatar by
Ryan Pinkham
·
Jul. 08, 16 · Opinion
Like (7)
Save
Tweet
Share
6.97K Views

Join the DZone community and get the full member experience.

Join For Free

I make part of my living these days as an IT management consultant, and in this capacity, I’ve developed an interesting niche: evaluation of codebases.

Specifically, an organization’s management will bring me in to spend a week or two looking through a codebase, sizing it up, and making recommendations for what to do with it going forward (e.g. stay the course, rework the architecture, targeted training, scrap it, etc.)

As you might imagine, this part of my practice has me looking at and quickly grokking a lot of unfamiliar code. Every few weeks, I’m squinting at strange classes, running static analysis tools, and making lists of assumptions and questions to ask the development team. I’ve found that this practice has benefits to me beyond helping me earn my living; I’d argue that it makes me a better programmer.

Consider the opposite situation — one that describes an enormous cross-section of industry developers.  They come into work each day and deal with the same codebase. This continues day in and day out for weeks, months, or even years.

This year, my wife and I are hoping to make a visit to the Galapagos Islands, which are noteworthy for the uniqueness of the wildlife there.  The animals living there have been isolated from the wider world of fauna for millions of years, and the result is that they’ve developed unique and unusual characteristics that cannot be found anywhere else. This is what tends to happen to codebases in shops where the majority of developers work in relative isolation. A bubble forms and practices drift toward the unusual.

For an individual, this isolation tends to put a damper on skill acquisition and can even be career limiting. It’s the polar opposite of the situation in which I find myself — constantly immersed in unfamiliar code. So how can you remedy the isolation (without drastic career moves, that is) if your professional life shows you the same code day in and day out? Well, the dead simplest thing I can think of is to seek out and review other people’s code. And to do that, there’s no better place to go than Github.

Here’s what you can do. Every few weeks or so, poke around idly on Github, searching for random codebases in your language of choice. Big or small, popular or niche, active or forgotten — it really doesn’t matter much.  They just need to be different and new.

Once you’ve found one (and just about any one will do), clone it and get the code locally on your machine. Open it up in your IDE/editor/environment of choice, and start looking around. If you start to perform this exercise with some regularity, here are some benefits that you can expect, in my experience.

Practice Getting up to Speed Quickly

Getting your bearings in a new codebase can be daunting, particularly if you’ve grown used to the same one over the course of months or years. Being able to do it quickly, however, makes you valuable, both on the open market and within your organization. This skill allows you to be plugged into projects where extra help is needed, obviously, but it also gives your organization flexibility. If they know you can be quickly proficient, they might be able to buy out competitor applications or ask you to tackle face-lifting a legacy project that had previously been considered untouchable.

When it comes to getting up to speed in short order, there’s really little besides practice that will give you the needed skill set. As such, going into a bunch of codebases in your spare time and poking around is really the best way to become skilled at going into foreign codebases and figuring them out.

Learn Architectural and Design Patterns

Practicing looking at lots of codebases gives you more than just familiarity and facility with the task itself. As you look at more codebases, you’ll also start to see and recognize patterns of development more easily, both good and bad. Maybe, for better or for worse, your application is a web-based one that uses an anemic domain model (domain objects basically have only properties). Looking at a lot of code will show you how desktop/app developers doing things, and what patterns are relevant there.  Alternatively, they may show you how other teams with similar kinds of applications solve similar problems differently from you.

Starting to recognize these things is the first step to understanding common usages and being able to make recommendations.  If you’ve looked at a lot of codebases, you’ll know when people tend to favor active record versus using an ORM. You’ll understand the tradeoffs between using DI frameworks with indirection and being more explicit but less flexible. You’ll feel and empathize with the cost of doing things in different ways so that you can speak with more experience when it comes to what you should do.

Expand Your Bag of Tricks

It’s not just the weighty architectural decisions that you’ll pick up, either. You’d be amazed at how many quick, little wins you snag with this practice. One day you’ll see a unit test naming scheme that you fall in love with. The next day you’ll notice a new language feature that will save you twenty lines of code in a lot of your classes. Or, maybe you’ll observe someone using semantics that makes mistakes a lot harder.

Whatever the case may be, looking at a lot of code means taking advantage of a lot of others’ experience. It’s not quite the same as having tons of people review your code, but you can realize some of the same benefits.

Feel a Little Better About Yourself

The last benefit that I’ll offer may surprise you. It’s certainly in a different vein from the first three: feel a little better about yourself.

Doing this will let you feel a little bit better about yourself because it will quickly show you that everyone is human. It’s easy to read books and listen to podcasts or talks and conclude that the experts out there are completely out of your league. But if you go out and review enough code you’ll start to realize that we’re really all just doing our best in a profession with a lot of changes and uncertainty.

In one codebase you’ll see dozens of global variables in every project, and in another, you might see some kind of weird convention that obviously seemed like a better idea than it turned out to be. Looking at a lot of other codebases and realizing that they’ve made and paid for mistakes can make you feel a lot less out of your own depth.

Do What You Can

There are 186 hours in a given week, and you probably spend 50 of those sleeping and 40 of them working, leaving only a paltry 78 for living your non-work life.  And I realize that it’s hard to make a case for spending some of those randomly reviewing strangers’ code on Github.

I’m not suggesting that you go nuts or that you radically alter your life. Rather, I’m suggesting that when you’ve got some downtime or a lull in what you’re doing at work, there are worse ways that you could spend your time than finding projects and learning from that code.

GitHub Programmer (hardware)

Published at DZone with permission of Ryan Pinkham, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Best GitHub-Like Alternatives for Machine Learning Projects
  • Deploy MuleSoft App to CloudHub2 Using GitHub Actions CI/CD Pipeline
  • What Do You Mean by Debugging in C?
  • Continuous Integration for iOS and macOS

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: