Skip to main content
Share Your Experience: Take the 2024 Developer Survey
350 votes
Accepted

I changed one method signature and now have over 25,000 errors. What now?

25000 errors basically means "don't touch that". Change it back. Create a new class that has the desired interface and slowly move the consumers of the class to the new one. Depending on ...
Stephen's user avatar
  • 8,838
80 votes

I changed one method signature and now have over 25,000 errors. What now?

Divide and conquer with refactorings Often, breaking up the change that you need to do into smaller steps can help because you can then perform most of the smaller steps in a way that doesn't break ...
theDmi's user avatar
  • 898
41 votes

In software design, should an application remain agnostic regarding its usage with real world data / mock data?

The ideal is that the application is a black box. In testing you feed it a variety of inputs and observe the results. In reality, there are tradeoffs. Some tests are really expensive to write. Some ...
Martin K's user avatar
  • 2,917
36 votes

I changed one method signature and now have over 25,000 errors. What now?

Clarify your task with your boss to help him to understand the problem and your needs as a professional software developer. If you are part of a team, look for the lead developer and ask him for ...
mmehl's user avatar
  • 469
33 votes

I'm not seeing 'tightly coupled code' as one of the drawbacks of a monolithic application architecture

Why X when you can do Y? The problem with questions like these is that no one has ever claimed that you can't take the more difficult route if you really want to. People aren't pointing out that the ...
Flater's user avatar
  • 51.7k
31 votes
Accepted

Event-driven programming: when is it worth it?

Follow the KISS principle: Keep It Simple, Stupid, or the YAGNI principle: You Ain't Going to Need It. You can write the code like: void updateSpecialData() { // do the update. backupData(); ...
Winston Ewert's user avatar
30 votes
Accepted

Coupling: Theory vs Reality

High coupling is bad, low coupling good. I won't put it so black and white. Some coupling is necessary. Plus some roundabout ways to get rid of coupling can introduce too much overhead. In particular ...
Theraot's user avatar
  • 9,151
29 votes

I changed one method signature and now have over 25,000 errors. What now?

Don't touch it. Don't commit anything. Instead, sit down on your chair and shout "Heeeeelp!!!!!" as loud as you can. Well, not exactly like that, but ask any of your senior colleagues for advice. ...
gnasher729's user avatar
  • 45.7k
23 votes

I changed one method signature and now have over 25,000 errors. What now?

Entrenched APIs can't simply be changed. If you really need to change them, anootate and/or document them as deprecated (by whatever means the language allows) and document which API should be used ...
Kevin Krumwiede's user avatar
23 votes
Accepted

Why would a type be coupled with its builder?

I disagree with your assertion that it is a red flag. I also disagree with your representation of the counterpoint, that there is One Right Way of representing a Builder pattern. To me there's one ...
Jeff Bowman's user avatar
  • 1,890
23 votes
Accepted

Where should interfaces be used?

I don't think there's really a simple answer that can do a substantially better job than the statements of the principles and practices that you've already encountered. I know you're aware of this on ...
Filip Milovanović's user avatar
18 votes
Accepted

How to use dependency injection and avoid temporal coupling?

There are several ways to deal with the initialization problem: As answered in https://softwareengineering.stackexchange.com/a/334994/301401, init() methods are a code smell. Initializing an object ...
pschill's user avatar
  • 1,860
16 votes
Accepted

Is it possible to apply DRY without increasing coupling?

All of these options generate additional dependencies between modules. They apply the DRY principle at the cost of increasing coupling. Why yes they do. But they decrease coupling between lines. What ...
candied_orange's user avatar
14 votes

In software design, should an application remain agnostic regarding its usage with real world data / mock data?

On a current assignment I'm seeing literally hundreds of references throughout the entire code base that will do different things depending on the context of data being used. That's likely a ...
JayZ's user avatar
  • 827
13 votes

Event-driven programming: when is it worth it?

The example you describe of a simple data, where the modification triggers some effect can perfectly be implemented with the observer design pattern: this is simpler to implement and maintain than ...
Christophe's user avatar
  • 77.9k
11 votes

I changed one method signature and now have over 25,000 errors. What now?

Evaluate Evaluate whether this change is necessary, or whether you can add a new method and deprecate the other. Forward If changing is necessary; then a migration plan is necessary. The first ...
Matthieu M.'s user avatar
11 votes
Accepted

How to avoid many objects in constructors when many steps are performed by a class

If the class is truly simplified to the point that it's just providing a controlled sequence to the operations, and the complexity of each operation is managed by the dependent classes, then I don't ...
Eric King's user avatar
  • 10.9k
11 votes

Where should interfaces be used?

In a nutshell, you should define an interface when you need the ability to map that interface (i.e. capability) to one or more implementations. What does that phrase mean? As an example, if you're ...
Robert Harvey's user avatar
10 votes
Accepted

Why Named Constructors are getting popular shouldn't be an antipattern?

Named Constructors in PHP Don't limit yourself by PHP's single constructor. Use static factory methods. The article is not about coupling. There is zero difference in coupling between using new ...
Caleth's user avatar
  • 11.3k
10 votes

Coupling: Theory vs Reality

And one change in B would have an impact in IB and A. This is not correct. A change to its signature would impact IB and A, but changing its implementation would not. You could change your underlying ...
Telastyn's user avatar
  • 109k
10 votes

I'm not seeing 'tightly coupled code' as one of the drawbacks of a monolithic application architecture

Distributed Systems The problem here is that you're still thinking of this in terms of a single program running on a single machine. Let's say you have three services: A Payment System. A Background ...
NPSF3000's user avatar
  • 285
9 votes
Accepted

Relation between LOC and Cyclomatic Complexity

The paper posted in John R. Strohm's answer is somewhat misleading. Although I don't disagree that there is a relationship between cyclomatic complexity and lines of code, it looks like cyclomatic ...
Thomas Owens's user avatar
  • 82.8k
8 votes

I changed one method signature and now have over 25,000 errors. What now?

If your change to the method signature is merely a name change, the simple solution is to use tools to automate the change in the 25,000 classes that reference the method in question. I assume that ...
MikkelRJ's user avatar
  • 129
8 votes

Why would a type be coupled with its builder?

I understand how annoying it can be when 'appeal to authority' is used in a debate. Arguments should stand on their own IMO and while it's not wrong to point to the advice of such a well-respected ...
JimmyJames's user avatar
  • 27.5k
8 votes
Accepted

How to prevent implementation/algorithm from leaking into unit tests?

A way to avoid this duplication is to create a fixture with explicitly defined values. In this example you would setup the canvas with explicitly defined values for fixture.nativeElement.offsetWidth ...
Dirk Herrmann's user avatar
8 votes

Code coupling introduce by DRY and OOD

lets say I refactored duplicate code into the "gasoline" hierarchy and the "electric" hierarchy, both descending from the "vehicle" hierarchy. So far so good. And then, ...
Ewan's user avatar
  • 76.4k
8 votes
Accepted

Clean Architecture: Use case spanning multiple UI elements

OK, I think you you have a few misconceptions about the architecture itself and that this is tripping you up, so let me try to sort that out. So, domain behavior (the business logic of the ...
Filip Milovanović's user avatar
8 votes

In software design, should an application remain agnostic regarding its usage with real world data / mock data?

Should you ever need to make changes to your core application in order to accommodate for the use of mock data or should your application remain pure and agnostic to how it is being used, and should ...
Flater's user avatar
  • 51.7k
8 votes
Accepted

Unit Testing Controllers without Mocks

Unless you want to re-architect your whole solution, then only other option is to use Fakes instead of mocks. Fake is real implementation of an abstraction, but which is intended for testing and has ...
Euphoric's user avatar
  • 37.5k
8 votes

I'm not seeing 'tightly coupled code' as one of the drawbacks of a monolithic application architecture

If I need a certain part of my application to handle, say, payments, and multiple other parts to interact with the payments system, can I not leverage the abstraction features of the language I'm ...
Telastyn's user avatar
  • 109k

Only top scored, non community-wiki answers of a minimum length are eligible