Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

jamesjones21
jamesjones21
9,260 Points

When reading others code

Do others feel that when they read others code an try and understand it, do you rush through it? I feel as if I'm rushing most of the time when reading and understanding stuff

2 Answers

Dane Parchment
MOD
Dane Parchment
Treehouse Moderator 11,077 Points

Rushing through code is a sure-fire way to misinterpret it. Generally the only people who can "rush" through code tend to be experienced senior developers/engineers who can quickly identify common code smells.

Generally I do not rush through reading other people's code and tend to take my time. Can I ask why you are rushing through things?

jamesjones21
jamesjones21
9,260 Points

I guess it's the nature of myself where I seem to rush things, where as there is no need to rush if that makes sense? I want to grasp things as quick as possible, but get myself down through not getting it

Eric M
Eric M
11,546 Points

Hi James,

It depends on what my goal is when reading the code. When you saying you're "rushing most of the time when reading and understanding" do you mean that you understand quickly or that you are rushing and trying to understand but aren't sure if you're getting it?

If I want to understand what code is doing, and it's doing something complex, I often have to think through each line step by step, sometimes coming to a function or object and having to stop and go somewhere else in the code to understand that. This can be a bit of a rabbit hole, but if the goal is to incorporate their code into your project it is well worth it. You should ideally know what your program is doing in some depth.

On the other hand, if you just want to get the gist of why someone might choose one design pattern over another, perhaps you don't need to understand every line because the goal is not to understand the specific code as written but instead get a feeling for the higher level concepts at play.

Considering, however, that programming is a craft requiring highly specific instructions, where typos and "simple" mistakes can cause days or weeks of setbacks, it is not an activity I like to rush. Not every manager will agree however :P

Do you feel as though reading code is not getting you the understanding that you desire? Are there any concepts or code snippets we can help with?

jamesjones21
jamesjones21
9,260 Points

I'm currently learning js an I feel as if I'm rushing with things so I try an read code to understand it. So I guess I get myself wound up thinking I'm not getting it and set myself back. But I'm working with PHP on a daily basis an some of the concepts I grasp an some I don't, but when it comes to JS I seem to not grasp the dot notation 😣

Eric M
Eric M
11,546 Points

Hi James,

It's great that you've identified a weakness - you're rushing through to try to learn quickly but actually not learning deeply enough. Now, if that's your default, actually changing your behavior so you don't rush might not be easy but it probably will be worth it. Getting the fundamentals of the language right will be crucial in understanding more complex code.

Try to give yourself time to learn fewer things, but learn them in more depth. Consider using something like the Feynman technique to double check your understanding of a topic and identify gaps.

For dot notation, have you read the MDN article on Property accessors? I think it's a succinct overview. Between Treehouse and the MDN you have two really good sources for learning JavaScript.

Personally I have found my understanding of a topic improves as I read more sources on the same topic, doubly so if between sources I am writing code that uses whatever I'm trying to learn. If you want a third perspective after Treehouse and MDN you could look at 'JavaScript: The Good Parts' or 'Eloquent JavaScript' (the digital version of Eloquent Javascript is free).

And of course keep posting on this forum and striving to get better, by identifying a gap and wanting to improve you're off to a great start.

Cheers,

Eric