DEV Community

Cover image for 1 Mistake Amateur Developers Make That Slow Down Development
Karl Esi
Karl Esi

Posted on

1 Mistake Amateur Developers Make That Slow Down Development

A common mistake that amateur developers do is they make huge changes to the codebase at once.

Meaning, your Pull Requests are too big to make sense of.

They are too big for any meaningful comments or remediation.

And not checking in your code more often, you can introduce problems that are harder to diagnose because of all the changes to the codebase that you introduced.

A Pull Request should really have just one cohesive feature that you are working on, not multiple.

And of course, if a feature is big, then perhaps it should be broken up into multiple logical parts.

So, commit often and make sure to test each commit.

If you have sketched or planned out your feature first, like I just mentioned, you probably have ended up with a checklist of steps to get your feature working.

And every time you check off a step or task, test it and commit it.

And once a feature is a whole, it is fully working and tested, then push your code up and create the PR.

Here is a good example that I came across.

"I commit every time I finish a unit of work, but don't push my code to the server until the feature is fully complete.

I'll try to elaborate with an example:

Say my job is to develop a login system for some website.

I would write my class for a 'user' then commit.

Then I'd create the html form to accept the username and password, and then commit.

Then I would add the appropriate validation(make sure password is long enough, make sure email is valid) and then commit.

This could be three commits in one day or spread over multiple days, it depends on how long each unit of work takes.

Once everything is done, I would then push up my branch, create a Pull Request to be reviewed and then merged into master by somebody who approves that.

If it is a personal project, I would just merge my development branch(es) into master and push to origin.

I would never ever ever push code that would cause a crash, or break the build for a project.

Especially if you are collaborating with others.

So, if you are in the middle of writing a class, but haven't finished typing out a function, don't commit until everything is done, and you can successfully build."

So, if you planned out your work and have some sort of checklist, you would commit at each checkmark.

The main thing here is that don't write a bunch of code and then push them up all at one time.

Rooting for you,

Karl ⛹️

P.S. If you liked this article, consider giving it a like so that the algorithm doesn't think I slept on the job. Also, subscribe on my newsletter. Let's figure things out together. (You can click here. It will take you outside this site. I want to hack you).

Top comments (0)