HANDLE ERRORS PROPERLY - Deepstash

Explore the World's Best Ideas

Join today and uncover 100+ curated journeys from 50+ topics. Unlock access to our mobile app with extensive features.

HANDLE ERRORS PROPERLY

Don't ignore errors. They should be handled and communicated effectively, preferably through exceptions, making your code more robust and maintainable.

  1. Check your code for error handling today. Are all potential errors or exceptions accounted for and handled effectively?
  2. Can you recall a situation where inadequate error handling led to issues? How could proper error handling have improved the situation?

57

176 reads

MORE IDEAS ON THIS

BEWARE OF SMELLS

Certain patterns, known as 'code smells,' can indicate potential problems in your design. Understanding these patterns helps you avoid problems before they arise.

  1. Look at your code today with an eye for 'code smells.' Can you identify any and rectify them?
  2. Can you recall a t...

55

136 reads

AVOID DUPLICATION

The "Don't Repeat Yourself" (DRY) principle states that each piece of knowledge should have a single, unambiguous representation within the system. Duplicated code can lead to inconsistencies and bugs.

  1. Examine your code today for any signs of duplication. If you find any, consider re...

56

110 reads

MINIMIZE COMMENTS

In well-written code, comments should be the exception, not the rule. If your code is self-explanatory, there's no need to add extra commentary.

  1. Look through your code today and ask yourself if each comment is necessary. Could the code be refactored to make it self-explanatory inste...

58

225 reads

STAY PROFESSIONAL

Professionalism in software development means taking responsibility for delivering clean, functioning code. Take pride in your work and strive for excellence.

  1. Reflect on your work today. Are there areas where you could have demonstrated more professionalism? How can you improve in th...

56

99 reads

NO OUTPUT ARGUMENTS

Functions should avoid modifying the state of their inputs. Instead, return the results. This practice leads to clearer and more predictable code.

  1. Review your functions today. Do any of them modify their arguments? Could they be refactored to return the results instead?
  2. Have...

59

209 reads

IMPROVE LEGACY CODE

Working with legacy code can be challenging but understanding and improving its structure can greatly aid in maintainability and extensibility.

  1. If you're working with legacy code, try to understand it better today. Identify areas for potential improvement.
  2. Have you encounter...

56

107 reads

UNDERSTAND CONCURRENCY

Concurrency brings its own set of challenges. Writing concurrent code requires explicit strategizing and testing to ensure correct functioning.

  1. If your code uses concurrency, scrutinize it closely. Are you confident it's handling concurrency correctly?
  2. Can you remember a tim...

57

124 reads

MASTER YOUR TOOLS

Understanding your testing framework, like Junit, can make your unit tests cleaner and more efficient. Mastering your tools equates to more efficient and reliable code.

  1. Dedicate some time to explore the features and best practices of your testing framework today. How can you use it m...

56

109 reads

CONTINUOUS REFINEMENT

Your code should undergo continual revision and improvement. By constantly refining it, you can maintain simplicity and flexibility in your software.

  1. Review your codebase today. Identify areas that could benefit from refactoring or improvement.
  2. Recall a time when lack of cod...

57

117 reads

KEEP IT SMALL

Classes should be as small as possible, with a single responsibility. This practice increases code clarity, reusability, and maintainability.

  1. Review your classes today. Are any of them trying to do too much? Consider breaking them into smaller, single-purpose classes.
  2. Can yo...

56

137 reads

FORMAT FOR READABILITY

The way you format your code, including indentation and the use of whitespace, can greatly influence its readability. Consistency is key.

  1. Pay special attention to the formatting of your code today. Make sure it is consistent and follows established conventions.
  2. Consider a ti...

58

191 reads

SYSTEMS MATTER

Keeping system architecture clean and comprehensible is crucial. It's just as important that high-level structures are as understandable as low-level code.

  1. Consider the architecture of your current project today. Is it as clean and comprehensible as it could be?
  2. Have you enc...

57

131 reads

EMERGENCE THROUGH SIMPLICITY

Good architecture often emerges from following simple practices: passing all tests, eliminating duplication, ensuring expressiveness, and minimizing the number of classes and methods.

  1. Reflect on your current practices. Are you adhering to these principles? Where can you implement the...

56

115 reads

USE TOOLS WISELY

Employ tools like static code analyzers and linters to enforce coding standards and conventions. They can help you maintain high-quality code.

  1. Evaluate the tools you're using today. Are there any additional tools that could help maintain your coding standards?
  2. Can you rememb...

56

98 reads

RESPECT BOUNDARIES

Knowing where to draw lines between software systems and how to manage those interfaces effectively can make a big difference in the complexity and maintainability of your code.

  1. Assess the boundaries in your code today. Are interfaces between systems clear and well managed?
  2. ...

59

161 reads

ONE FUNCTION, ONE TASK

Each function you write should have a singular, well-defined responsibility. Keeping functions small and focused makes your code more maintainable and less prone to bugs.

  1. Check your code today for any functions that may be trying to do too much. Consider breaking them down into small...

58

259 reads

TEST YOUR CODE

Unit testing is essential for maintaining code health. Tests should be clean, well-written, and just as maintained as your production code.

  1. Take a look at your test coverage today. Is there any part of your code not adequately covered by tests? Consider writing tests for those areas....

57

132 reads

NAME IT WELL

Choosing informative and meaningful names for variables, functions, classes, and other identifiers helps your code speak for itself, reducing the need for comments.

  1. Review your code today. Do the names of variables, functions, or classes reflect their roles and behaviors? Consider re...

59

293 reads

READABILITY IS KEY

The main objective when writing code is for it to be easily understood by humans. Remember, your fellow developers will interact with your code much more than machines will.

  1. Try to make your code more readable today. Use descriptive names and clear structures.
  2. Think about a...

64

442 reads

CURATED FROM

CURATED BY

asimhusanovic

As an engineer with an official degree in software engineering, I am primarily interested in science and technology. I enjoy reading literature of many genres, and I especially like those from human behavior, sociology, history, and, should I say, science

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Access to 200,000+ ideas

Access to the mobile app

Unlimited idea saving & library

Unlimited history

Unlimited listening to ideas

Downloading & offline access

Personalized recommendations

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates