700 reputation
1516
bio website
location
age
visits member for 2 years, 7 months
seen Nov 7 at 8:57

Nov
7
awarded  Popular Question
Nov
7
awarded  Nice Question
Nov
7
accepted Is it good practice to rely on headers being included transitively?
Nov
7
asked Is it good practice to rely on headers being included transitively?
Aug
10
accepted C/C++: Which conversion warnings make sense in practice?
Aug
9
asked C/C++: Which conversion warnings make sense in practice?
Jul
5
awarded  Famous Question
Jul
2
awarded  Curious
May
7
awarded  Yearling
Apr
29
awarded  Notable Question
Jan
30
comment So Singletons are bad, then what?
Great explanation of DI, and I've been using DI extensively in the last few years. But I'd like to point out that occasionally, doing DI manually is unreasonably cumbersome, and some languages don't support automatic DI well, e.g. C++. I've found service locators (implemented as singletons, yes) to be a good alternative in those cases, they've got only a few of the weaknesses of singletons you identified above.
Jan
2
awarded  Notable Question
Dec
11
awarded  Critic
Dec
2
awarded  Nice Question
Oct
3
awarded  Popular Question
May
23
comment Naming functions that retrieve a value
@DietrichEpp I'm following your advice after all by now, it's not really helpful to have a verb in the name of pure functions. All the gets are gone now, with the exception of actual accessors (of which I only have few).
May
16
comment Naming functions that retrieve a value
@DietrichEpp That's a good point in favour of not prefixing anything with calculate. I'm not entirely sure about dropping all the get's, but you have a point, there's not really a need for it.
May
15
comment Naming functions that retrieve a value
@DietrichEpp I agree, it's not such a clear distinction. We do say "The sine of x" or more generally "f of x", so function/result is synonymous. In that sense, we might think of sine as a property of a number x though. Aren't all functions that get/calculate a value from some input structure without changing it mathematically pure?
May
15
comment Naming functions that retrieve a value
@DietrichEpp That has me thinking, but I believe I can argue sin() away: sine is the name of an actual mathematical function, while magnitude describes the result of some computation, just like square root. Would I call the sqrt function get_square_root? I think so.
May
15
accepted Naming functions that retrieve a value