The tag has no wiki summary.

learn more… | top users | synonyms

45
votes
20answers
4k views

Should you write good documentation and clean code to increase the “Bus Factor”?

One of the main goals of software development companies is to increase their Bus factor This is also advocated in a talk that was organized by Google. That means that you should code and document ...
21
votes
6answers
1k views

How do I prevent unknowningly duplicating code?

I work on a rather large code base. Hundreds of classes, tons of different files, lots of functionality, takes more than 15 minutes to pull down a fresh copy, etc. A big problem with such a large ...
18
votes
3answers
2k views

Does TDD lead to the good design? [duplicate]

I'm in transition from "writing unit tests" state to TDD. I saw as Johannes Brodwall creates quite acceptable design from avoiding any of architecture phase before. I'll ask him soon if it was real ...
102
votes
12answers
32k views

Why is Clean Code suggesting avoiding protected variables?

Clean Code suggests avoiding protected variables in the "Vertical Distance" section of the "Formatting" chapter: Concepts that are closely related should be kept vertically close to each other. ...
3
votes
5answers
591 views

How should I handle exception that *should* never be thrown? [duplicate]

What is the best way to handle errors that shouldn't ever happen? My current way to do this is to throw an exception if the 'thing that shouldn't happen' does happen, like so: /* * Restoring from a ...
33
votes
15answers
3k views

What does Clean Code mean to you? [closed]

A group of developers and I recently started a book club, and our first book of choice is Clean Code by Robert C. Martin. It is a great book on software craftsmanship and I would highly recommend it. ...
14
votes
4answers
2k views

Is code like this a “train wreck” (in violation of Law of Demeter)?

Browsing through some code I've written, I came across the following construct which got me thinking. At a first glance, it seems clean enough. Yes, in the actual code the getLocation() method has a ...
2
votes
2answers
133 views

How to use the Decorator pattern to add little functionality to big objects?

This question regards the usage of the Decorator pattern to add little functionality to objects of large classes. Following the classic Decorator pattern, please consider the following class ...
4
votes
4answers
250 views

How to avoid excessive method overloading?

We have quite a lot of places in the source code of our application , where one class has many methods with same names and different parameters. Those methods always have all the parameters of a ...