Skip to main content
deleted 29 characters in body
Source Link
Laiv
  • 15k
  • 2
  • 34
  • 72

Is there a good balance between readable code and debuggable code, or do we sacrifice some part of one of them (debuggability) for the other (readability)?

The context matters, and your priorities (along with the team) matter too.

For example, #2 flags can be troublesome if isTheOtherThingThere or isWhatEver do heavy calculus. If they do, it would be reasonable to code if/else statements instead or, why not, leave a log trace from each method for debugging purposes.1

Pragmatism is a good way to approach the dilemma. Whatever makes you productive is a good solution too. As @DocBrown suggests, your time (and your team's time) is valuable.

Note that, I have referred the team a couple of times. When it comes to the code we write, we are terrible reviewers and evaluators. Of course, my code is readable! And clean! Is self-evident... Right?

But you know what? Coding is a social act. We make readable code for others, we make clean code for others to understand what we do and how. So, in case of doubts, ask collaborators (teammates, coworkers, community) for opinions, but keep in mindremember who is going to dealdeals with the code 40h a week.


1: Logs can give you a broader vision of the execution context. They offer this vision without having to remember countless conditions and variables. For example, knowing if IsWhatever is false might not be as important as knowing the reasons for whatever to be in its current state and cause the false. If you know that the execution will fail, let it fail quickly! and leave logs to tell you the story.

Is there a good balance between readable code and debuggable code, or do we sacrifice some part of one of them (debuggability) for the other (readability)?

The context matters, and your priorities (along with the team) matter too.

For example, #2 flags can be troublesome if isTheOtherThingThere or isWhatEver do heavy calculus. If they do, it would be reasonable to code if/else statements instead or, why not, leave a log trace from each method for debugging purposes.1

Pragmatism is a good way to approach the dilemma. Whatever makes you productive is a good solution too. As @DocBrown suggests, your time (and your team's time) is valuable.

Note that, I have referred the team a couple of times. When it comes to the code we write, we are terrible reviewers and evaluators. Of course, my code is readable! And clean! Is self-evident... Right?

But you know what? Coding is a social act. We make readable code for others, we make clean code for others to understand what we do and how. So, in case of doubts, ask collaborators (teammates, coworkers, community) for opinions, but keep in mind who is going to deal with the code 40h a week.


1: Logs can give you a broader vision of the execution context. They offer this vision without having to remember countless conditions and variables. For example, knowing if IsWhatever is false might not be as important as knowing the reasons for whatever to be in its current state and cause the false. If you know that the execution will fail, let it fail quickly! and leave logs to tell you the story.

Is there a good balance between readable code and debuggable code, or do we sacrifice some part of one of them (debuggability) for the other (readability)?

The context matters, and your priorities (along with the team) matter too.

For example, #2 flags can be troublesome if isTheOtherThingThere or isWhatEver do heavy calculus. If they do, it would be reasonable to code if/else statements instead or, why not, leave a log trace from each method for debugging purposes.1

Pragmatism is a good way to approach the dilemma. Whatever makes you productive is a good solution too. As @DocBrown suggests, your time (and your team's time) is valuable.

Note that, I have referred the team a couple of times. When it comes to the code we write, we are terrible reviewers and evaluators. Of course, my code is readable! And clean! Is self-evident... Right?

But you know what? Coding is a social act. We make readable code for others, we make clean code for others to understand what we do and how. So, in case of doubts, ask collaborators (teammates, coworkers, community) but remember who deals with the code 40h a week.


1: Logs can give you a broader vision of the execution context. They offer this vision without having to remember countless conditions and variables. For example, knowing if IsWhatever is false might not be as important as knowing the reasons for whatever to be in its current state and cause the false. If you know that the execution will fail, let it fail quickly! and leave logs to tell you the story.

added 373 characters in body
Source Link
Laiv
  • 15k
  • 2
  • 34
  • 72

Is there a good balance between readable code and debuggable code, or do we sacrifice some part of one of them (debuggability) for the other (readability)?

The context matters, and your priorities (along with the team) mattersmatter too.

For example, #2 flags can be counterproductivetroublesome if isTheOtherThingThere or isWhatEver do heavy calculus. If they do, it would be reasonable to code if/else statements instead or, why not, leave a log trace from each method for debugging purposes.

Logs can give you a broader vision of the execution context. They offer this vision without having to remember countless conditions and variables. For example, knowing if IsWhatever is false might not be as important as knowing the reasons for whatever to be in its current state and cause the false. If you know that the execution will fail, let it fail quickly! and leave logs to tell you the story.1

This said, be pragmatic. Pragmatism is a good practice tooway to approach the dilemma. Whatever makes you productive is because, asa good solution too. As @DocBrown suggests, your time (and your team's time) is valuable too.

As @candied_orange repliedNote that, when youI have referred the team a couple of times. When it comes to the code we write, we are concerned about readabilityterrible reviewers and evaluators. Of course, complexity or any other sortmy code is readable! And clean! Is self-evident... Right?

But you know what? Coding is a social act. We make readable code for others, we make clean code for others to understand what we do and how. So, in case of opinionable subjectdoubts, ask otherscollaborators (teammates, coworkers, community) for feedbackopinions, but keep in mind who is going to deal with the code 40h a week.


1: Logs can give you a broader vision of the execution context. They offer this vision without having to remember countless conditions and variables. For example, knowing if IsWhatever is false might not be as important as knowing the reasons for whatever to be in its current state and cause the false. If you know that the execution will fail, let it fail quickly! and leave logs to tell you the story.

Is there a good balance between readable code and debuggable code, or do we sacrifice some part of one of them (debuggability) for the other (readability)?

The context matters, and your priorities (along with the team) matters too.

For example, #2 flags can be counterproductive if isTheOtherThingThere or isWhatEver do heavy calculus. If they do, it would be reasonable to code if/else statements instead or, why not, leave a log trace from each method for debugging purposes.

Logs can give you a broader vision of the execution context. They offer this vision without having to remember countless conditions and variables. For example, knowing if IsWhatever is false might not be as important as knowing the reasons for whatever to be in its current state and cause the false. If you know that the execution will fail, let it fail quickly! and leave logs to tell you the story.

This said, be pragmatic. Pragmatism is a good practice too. Whatever makes you productive is because, as @DocBrown suggests, your time (and your team's time) is valuable too.

As @candied_orange replied, when you are concerned about readability, complexity or any other sort of opinionable subject, ask others for feedback.

Is there a good balance between readable code and debuggable code, or do we sacrifice some part of one of them (debuggability) for the other (readability)?

The context matters, and your priorities (along with the team) matter too.

For example, #2 flags can be troublesome if isTheOtherThingThere or isWhatEver do heavy calculus. If they do, it would be reasonable to code if/else statements instead or, why not, leave a log trace from each method for debugging purposes.1

Pragmatism is a good way to approach the dilemma. Whatever makes you productive is a good solution too. As @DocBrown suggests, your time (and your team's time) is valuable.

Note that, I have referred the team a couple of times. When it comes to the code we write, we are terrible reviewers and evaluators. Of course, my code is readable! And clean! Is self-evident... Right?

But you know what? Coding is a social act. We make readable code for others, we make clean code for others to understand what we do and how. So, in case of doubts, ask collaborators (teammates, coworkers, community) for opinions, but keep in mind who is going to deal with the code 40h a week.


1: Logs can give you a broader vision of the execution context. They offer this vision without having to remember countless conditions and variables. For example, knowing if IsWhatever is false might not be as important as knowing the reasons for whatever to be in its current state and cause the false. If you know that the execution will fail, let it fail quickly! and leave logs to tell you the story.

added 55 characters in body
Source Link
Laiv
  • 15k
  • 2
  • 34
  • 72

Is there a good balance between readable code and debuggable code, or do we sacrifice some part of one of them (debuggability) for the other (readability)?

The context matters, and your priorities (along with the team) matters too.

For example, #2 flags can be counterproductive if isTheOtherThingThere or isWhatEver do heavy calculus. If they do, it would be reasonable to code if/else statements instead or, why not, leave a log trace from each method for debugging purposes.

Logs can give you a broader vision of the execution context. They offer this vision without having to remember countless conditions and variables. For example, knowing if IsWhatever is true or false might not be as important as knowing the reasons for whatever to be in its current state and cause the false. YouIf you know that the execution will fail, so let it fail quickly! and leave logs to tell you the story.

Be pragmaticalThis said, be pragmatic. Pragmatism is also a good practice too. Whatever makes you productive is, because, as @DocBrown suggests, your time (and your team's time) is also valuable too.

As @candied_orange answeredreplied, when you are concerned about readability, complexity or thisany other sort of subjective mattersopinionable subject, ask others for feedback.

Is there a good balance between readable code and debuggable code, or do we sacrifice some part of one of them (debuggability) for the other (readability)?

The context matters, and your priorities (along with the team) matters too.

For example, #2 flags can be counterproductive if isTheOtherThingThere or isWhatEver do heavy calculus. If they do, it would be reasonable to code if/else statements instead or, why not, leave a log trace from each method for debugging purposes.

Logs can give you a broader vision of the execution context. They offer this vision without having to remember countless conditions and variables. For example, knowing if IsWhatever is true or false might not be as important as knowing the reasons for whatever to be in its current state. You know the execution will fail, so let it fail quickly and leave logs to tell you the story.

Be pragmatical. Pragmatism is also a good practice. Whatever makes you productive is, because your time is also valuable.

As @candied_orange answered, when you are concerned about readability, complexity or this sort of subjective matters, ask others for feedback.

Is there a good balance between readable code and debuggable code, or do we sacrifice some part of one of them (debuggability) for the other (readability)?

The context matters, and your priorities (along with the team) matters too.

For example, #2 flags can be counterproductive if isTheOtherThingThere or isWhatEver do heavy calculus. If they do, it would be reasonable to code if/else statements instead or, why not, leave a log trace from each method for debugging purposes.

Logs can give you a broader vision of the execution context. They offer this vision without having to remember countless conditions and variables. For example, knowing if IsWhatever is false might not be as important as knowing the reasons for whatever to be in its current state and cause the false. If you know that the execution will fail, let it fail quickly! and leave logs to tell you the story.

This said, be pragmatic. Pragmatism is a good practice too. Whatever makes you productive is because, as @DocBrown suggests, your time (and your team's time) is valuable too.

As @candied_orange replied, when you are concerned about readability, complexity or any other sort of opinionable subject, ask others for feedback.

added 55 characters in body
Source Link
Laiv
  • 15k
  • 2
  • 34
  • 72
Loading
added 95 characters in body
Source Link
Laiv
  • 15k
  • 2
  • 34
  • 72
Loading
Source Link
Laiv
  • 15k
  • 2
  • 34
  • 72
Loading