Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
7 votes
Accepted

When refactoring many functions that share state in to a single class, how can you avoid writing an "escort" class?

So you've followed people's advice and split some logic and state into a class, but you cannot give this new class a good name. Now is a great time to examine the design decisions that lead you to ...
Greg Burghardt's user avatar
4 votes

When refactoring many functions that share state in to a single class, how can you avoid writing an "escort" class?

These times need to be sent to my server. I originally had two independent methods for handling them, one for deleting from the server and one for upserting. When I realised that they shared state, I ...
Telastyn's user avatar
  • 109k
2 votes

Where did the notion of 'calling' a function come from?

1947: In January 1947 John Mauchly presented general notes at 'A Symposium of Large Scale Digital Calculating Machinery' under the joint sponsorship of Harvard University and the Bureau of Ordnance, ...
vaughan's user avatar
  • 121
1 vote

Origin of "a method should return a value or have side-effects, but not both"

This is just unclear. I have a database. There’s a command “remove all records with property x”, that’s the first category. There’s a query “how many records are there with property x”, which is the ...
gnasher729's user avatar
  • 45.7k
1 vote

Form Follows Function in Programming?

In FORTRAN, form follows subroutine. In Objective-C, form follows method.
gnasher729's user avatar
  • 45.7k
1 vote

Form Follows Function in Programming?

In essence, it's Convay's law: Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization's communication structure. System design (...
Andrey Zaytsev's user avatar
1 vote

Which statically typed languages support intersection types for function return values?

While Rust does not have the traditional OOP notion of inheritance, it does have a notion of traits and trait objects. Object-safe traits perform roughly the same role as interfaces, and trait objects ...
Zoey Hewll's user avatar

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