What's new
Welcome to PS Community

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

How to Handle Bugs by Patrick Triest

Godson

Registered
Joined
Sep 4, 2017
Messages
31
Likes
7
Points
0
Age
22
Location
Port Harcourt
#1
We all hate when we have to stay up all night or work for days just to find bugs in our code.

This is very annoying.�

So what's the best way to debug?

I talked to Patrick Triest, and he shared how he handles bugs to meet up deadlines.

The first is to avoid the “I’ll do the hacky solution now and fix it later” mentality.

It is always much more time-efficient to do it right the first time, since the hacky solutions rarely get fixed “later”, and are likely to cause major issues (in the form of bugs, poor performance, and developer productivity) down the road.

The second piece of advice is to utilize TDD (test-driven-development) or BDD (behavior-driven-development).

Including a test suite with your code (and ideally writing tests *before* writing the code itself), is a great way to catch bugs early on, and will provide some assurance that future code updates don’t break existing functionality.

The third piece of advice is “take your time”.

Make sure that you understand the code you are writing. Do thorough research instead of making guesses on the correct way to do something.

Don’t be afraid to take a few hours to refactor your code structure.

And the final tip is:

Always add comments.

An hour spent polishing your code today can save multiple days of work in six months.

What's your take?
 

Alvin

Admin
Verified
Joined
Jul 3, 2017
Messages
176
Likes
159
Points
43
Location
Enugu
#2
We all hate when we have to stay up all night or work for days just to find bugs in our code.

This is very annoying.�

So what's the best way to debug?

I talked to Patrick Triest, and he shared how he handles bugs to meet up deadlines.

The first is to avoid the “I’ll do the hacky solution now and fix it later” mentality.

It is always much more time-efficient to do it right the first time, since the hacky solutions rarely get fixed “later”, and are likely to cause major issues (in the form of bugs, poor performance, and developer productivity) down the road.

The second piece of advice is to utilize TDD (test-driven-development) or BDD (behavior-driven-development).

Including a test suite with your code (and ideally writing tests *before* writing the code itself), is a great way to catch bugs early on, and will provide some assurance that future code updates don’t break existing functionality.

The third piece of advice is “take your time”.

Make sure that you understand the code you are writing. Do thorough research instead of making guesses on the correct way to do something.

Don’t be afraid to take a few hours to refactor your code structure.

And the final tip is:

Always add comments.

An hour spent polishing your code today can save multiple days of work in six months.

What's your take?
It's good to take your time... But I think rest is important to avoid weakening your body system