Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • It's a very interesting read, thank you. And unlike most responses, it explain why my company has this rule. We are indeed closer to the million lines of code, and from your post I understand that this "pattern" (boolean return, init method...) is safer and less error prone. But I am a bit surprised that the more "modern" approach (exceptions) isn't safer/better/easier at large scale (I know newer isn't always better, but I have the feeling that in software, newer means simplifying dev work) Commented Apr 20, 2024 at 7:18
  • 1
    @sayanel When exceptions were invented, they were trying to make things easier, but probably overshot the mark a bit. For lots of software, where high reliability is desirable but not required, they're quite effective. Several languages have explored ways to make things more provable (such as requiring you to explicitly list what exception classes you might throw), but we're still working on it as an industry. Commented Apr 20, 2024 at 19:36
  • I wouldn't assume your company is doing this just because this is a huge codebase, @sayanel, unless there are more things in line to make this other approach robust as well. Commented Apr 20, 2024 at 21:03