« first day (3756 days earlier)      last day (1178 days later) » 

12:22 AM
So I've been struggling for an elegant design for this kind of paradigm. I have an item with a method like bool item::is_valid() {return check1() && check2() && check3();} So, this is kinda fine, but hard to understand what exactly failed when is_valid() returns false. Is there some good way to curry that information?
Notice that even doing something like this:

auto check1_result =check1();
auto check2_result = check2();
return check1_result && check2_result;

Has a potential performance implication
 
12:41 AM
@Mikhail What type are you returning that could give that a performance implication? If check1() and check2() are both returning bool, a performance hit would be rather unexpected (in fact, I'd usually expect identical generated code).
 
short circuit evaluation
 
Oh, you mean the call to `check2` even if `check1` has already failed? Fair enough. In that case, I'd probably do something on this order:
auto check1_result = check1();
return check1_result && check2();
 
The real issue is how to curry the failure information to the start of the call stack (aka the first check)
 
Yes, for that you probably want something like 0 = all good, 1 = 1 failed, 2 = 2 failed.
auto check1_result = check1;
if (!check1) return 1;
return 2 * !check2();
 
I've been trying something like template<bool choke_on_failure> is_valid() - > bool where it will std::runtime/invalid_argument_error on failure.
 
12:49 AM
If you have a lot of the check functions, you'd probably want to put pointers to them in an array/vector, and walk through it:
for (int i=0; i<checks.size(); i++)
if (!checks[i]())
return 1 << i;
return 0;
 
well the checks crawl the MRO, so its more like base_class::is_complete() && derived_completness_check()
MRO is probably the wrong word, I've been talking too much python recently
 
@Mikhail I think I get the general idea nonetheless.
 
1:02 AM
Personally, I'd prefer that those were handled in the ctor--either the ctor throws, or we have a complete object of the most derived type.
 
Testing engineers using python a lot. It sounds like someone is testing compiler(s) a lot.
Subject:  	Apple Worldwide Developer Relations Intermediate certificate update.
 
Yeah, requiring a completed structures is usually the best idea, on the other hand the job of my code is to actually complete the structures :-)
 
Please give more eccentric names to your certificates.
 
Today I unironically used ##__VA_ARGS__. Was a hard day.
 
@Mikhail So you're writing what should be in the ctor. Okay.
@Mikhail My condolences.
 
1:07 AM
Hows the snow down in San Diego?
FML, I tried to mix parameters packs and exceptions, fuck, what am I writing
 
1:40 AM
@Mikhail Haven't seen any snow here at the house, but yeah, I guess some parts of town saw a little. By San Diego standards it has be brutally frigid for a few days now. So cold that in fact, Even I actually put on a light sweater, but when I went to the store, there were people in winter coats that looked suitable for a trek to Mount Everest or the south pole.
 
Yet, no human in modern history has been anywhere other than earth and it's moon.
Talking big, achieve small!
 
2:25 AM
 
@TelKitty Relax, there's plenty of space.
 
2:40 AM
Like the big dense forest behind your backyard.
 
exactly
It was more or less a play on words.
 
 
2 hours later…
4:37 AM
Sometimes, I upload chicken pictures for no reasons.
 
 
8 hours later…
12:21 PM
@TelKitty I'd say you were being cocky but those are both hens ;p
 
12:33 PM
but roosters surround themselves with hens and brag about it
 
so cocky right!?
 
12:54 PM
@Mgetz Despite play of words, my white/creamy hen indeed walks like a rooster, with her head up and chest high. She also enjoys gang fight, once I saw her running over the yard so she could join a cockerel fighting a pullet.
 
oh my
 
On the other hand, she lays a lot of eggs, blue coloured eggs. Not mother hen material, but a very good chicken.
 
trans chicken?
 
@TelKitty some guys went behind the moon :p
Which is the farthest anyone's been from humanity as a whole
 
@ratchetfreak Iron lady type of chicken maybe. She is at the top of the peck amongst my chickens.
 
1:05 PM
I have heard that hens do form a 'pecking order' and there is a 'queen' chicken
 
@Morwenn I thought only spaceship with robots went to the back of the moon, not humans?
 
Apollo 13 happened
Also I'm not talking about landing
As far as space goes, we might not have set foot anywhere else, but the tech has greatly improved in a few years
Partially reusable rockets, cubesats and their deployers, space tugs, propellant depots, etc.
 
@TelKitty nah we've been to the moon
 
The last two had been theorized for decades and now we're finally seeing them for real
We've potentially got maiden flights for 3~4 new heavy launchers in 2021
 
@Mgetz We are not talking about to the surface of the moon, but to the back of the moon, there is a subtle difference :p
 
1:10 PM
@TelKitty ah fair, sorry. Yeah backside is a bit dangerous for humans
 
The concept of a space station around the Moon sounds super cool anyway, no matter how small ^^
Just a few weeks ago we had the first ever automatic rendez-vous of a Lunar ascent module and a Lunar orbiter for a sample collect mission
And there's even an EVA today to connect some minor ISS module
And just a few days ago we launched a cubesat whose goal is to try to use water as a propellant
There's a whole lot of space stuff happening, and it's cool to see advances in most domains there ^^
 
 
2 hours later…
2:48 PM
isn't moon orbit way more irradiated?
 
It sure doesn't benefit from the same protection the Earth orbit benefits from
 
3:08 PM
@PeterT yes and no? It's not van allen belt levels
 
 
2 hours later…
5:22 PM
 
5:44 PM
posted on January 27, 2021 by Herb Sutter

This special Guru of the Week series focuses on contracts. Postconditions are directly related to assertions (see GotW #97)… but how, exactly? And since we can already write postconditions using assertions, why would having language support benefit us more for writing postconditions more than for writing (ordinary) assertions? JG Question 1. What is a postcondition, … Continue reading Got

 

« first day (3756 days earlier)      last day (1178 days later) »