How neural networks actually work

You might have come here after reading an article on AI by Practicum by Yandex. Good choice! Let’s dig deeper into neural networks. A neural network is a kind of database. It stores data (basically…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Learn How to Read Code

When thinking about natural languages, in school you received lessons on both reading and writing and were graded on your proficiency in both.

So, why doesn’t learning to read code get taught nearly as much as writing code? After all literacy is defined as a person’s ability to both read and write in a language for a reason.

If reading code is a skillset, what are signs you or your team lack it?

As a quick exercise, reread those bullet points but replace “can’t read” with “doesn’t understand” and you’ll arrive at the heart of the problem.

This matters because most of the time when a developer is reading code, they don’t have control over what’s written. Being able to read code, even bad code, is a skillset. After all if you’re reading a lot of code because you’re doing a refactor, you wouldn’t be refactoring the code if it had been written at JK Rowling level of excellency, amirite?

Being able to read code is important. Now, how do you get get there?

2. Add comments. Once you’ve found your right piece of code, go through and add comments. Here are few ideas to get you started

3. Notice imports and dependencies. In the example code, onConfirmClearClient() and clearActiveClient()are both functions declared in another file. When it comes to imports and dependencies, reading these functions can help you better understand the code at hand. However, beware of falling into a rabbit hole here as dependencies can have dependencies which can also have dependencies with dependencies.

meme: I head you like dependencies

4. Read other people’s code. This one is huge. If you have a job as a developer then look at code that your teammates have written. If you don’t yet have a dev job, you can look at other people’s code on github. If you go with the latter, do not try to read the entire repo. Instead start with a single function in a single file.

As you work through reading the code (adding your own comments), here are some questions to keep in mind:

After reading someone’s code it’s normal to have a few questions for them. If you’re looking at the code of someone you know, ask them! (I recommend asking in a nice way, developers can be defensive about coding decisions they’ve made). If you’re reviewing code on github, you can leave a comment or ask a more general audience such as /r/whichEverLanguage.

Whenever possible, ask questions, do live code reviews and practice pair programming.

And when all else fails, practice reading code by reading your own first.

Add a comment

Related posts:

How dogs can connect to you emotionally

Animals are one of the world’s best creatures in my opinion. If you’re feeling sad, pets will always be by your side. Pets and humans have influenced each other in major ways. It’s even said that “…

Just keep moving

As a new-to-practice Data Scientist with a list of ex-_____ titles that seems longer than some of my peers’ lifetimes I’m surprised at just how much more I want to learn each day. This probably comes…