Error Handling: Separating from Code for Easier Maintenance

  • Thread starter Thread starter 0rthodontist
  • Start date Start date
  • Tags Tags
    Error
Click For Summary
SUMMARY

The discussion focuses on the challenges of error handling in programming, emphasizing the need to separate error handling from the main code for better readability and maintenance. Techniques such as argument validation and contractual assertions are proposed to achieve this separation. The conversation highlights the importance of code locality and the potential drawbacks of excessive error handling clutter. Participants agree that while separating error handling can enhance clarity, it requires advanced design skills and may not be practical for all programmers.

PREREQUISITES
  • Understanding of error handling principles in programming
  • Familiarity with argument validation techniques
  • Knowledge of contractual assertions in software design
  • Experience with cleanroom software engineering principles
NEXT STEPS
  • Research advanced error handling techniques in languages like Python or Java
  • Explore the implementation of argument validation in various programming languages
  • Study the principles of cleanroom software engineering for formal verification
  • Investigate editor features that enhance code readability and error handling visibility
USEFUL FOR

Software developers, software architects, and anyone involved in maintaining or optimizing code quality through effective error handling strategies.

  • #31
0rthodontist said:
Have you ever seen any programmer make use of this commenting style you are describing? If you're referring to the takes/alters syntax from another thread, I made it extremely clear that it would need to be automatically generated, and that in fact that was part of the point, so that it would provide documentation that a programmer might not have created on his own.

You're the one claiming that this coding style with "separated" error handling is superior to simply having the error-handling intermingled with the code it protects -- not me. I have never seen anyone besides you argue that this would be a good idea, so no, I have never seen anyone else do it.

- Warren
 
Technology news on Phys.org
  • #32
Chroot, were you actually talking about the takes/alters syntax in the other thread as I thought in my last post?
 

Similar threads

  • · Replies 40 ·
2
Replies
40
Views
1K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
9K
  • · Replies 1 ·
Replies
1
Views
3K