11,259 reputation
23477
bio website evincarofautumn.blogspot.com
location United States
age 23
visits member for 4 years, 3 months
seen yesterday

I like programming, language, and collecting hobbies.


Dec
24
awarded  Nice Answer
Dec
11
answered Why do objects created with no assignment not generate a syntax error in Python?
Nov
22
comment Why squash git commits for pull requests?
Strictly speaking, Git doesn’t allow you to change history. Commit objects are immutable. It’s only branch pointers that are mutable, and only then with a “forced update”, which is generally considered something you only do for development purposes, not on the master branch. You can always get back to a previous state using the reflog, unless git gc has been run to discard unreferenced objects.
Nov
17
accepted Values, types, kinds, and…?
Oct
3
answered Alternative to language purity
Sep
30
awarded  Explainer
Sep
17
answered Is there a name for the technique of converting method parameters into a unified form to simplify further processing?
Sep
15
awarded  Yearling
Sep
13
answered Standardization and official guidelines for C++ template parameter naming
Sep
12
awarded  Enlightened
Sep
12
awarded  Nice Answer
Sep
2
awarded  Good Answer
Sep
1
awarded  Nice Answer
Aug
31
awarded  Guru
Aug
24
comment Why doesn't Python have a “flatten” function for lists?
What is an example of when you would need such a function? I’ve definitely needed to flatten an n-D array into a 1D array, but I don’t think I’ve ever needed the heterogeneous equivalent.
Aug
18
comment When is type testing OK?
Equality makes sense. In my experience, such methods often have a form like “if these two objects have the same concrete type, return whether all their fields are equal; otherwise, return false (or noncomparable)”.
Aug
5
comment How to replace inheritance with composition in this case?
Yeah, you posted while I was still writing my answer, though I didn’t read it until after I’d posted.
Aug
5
comment How to replace inheritance with composition in this case?
+1 Your example is equivalent to mine; I only chose a function because I find it simpler. An interface may help document intent, but it’s extensible, so the intent may be diluted over time if you carelessly add methods.
Aug
5
answered How to replace inheritance with composition in this case?
Aug
1
comment Why don't languages include implication as a logical operator?
Sure, I was saying it’s an interesting observation, but not something you should use in real programs because it isn’t short-circuiting and that could take somebody by surprise if they expected did_all_possible_stuff = x.do_required_stuff() and (x.supports_optional_stuff() <= x.do_optional_stuff()) to work.