« first day (1789 days earlier)      last day (3151 days later) » 

6:00 AM
And then suddenly you get a job and you work LESS than at uni
:logic:
I miss having a lot of free time
 
There....
All checked in...
NIGHTY NIGHT
 
Buh-bye!
 
@ThePhD you use tabs for indent, really?
 
Four spaces Anastasiya
 
6:05 AM
@AnastasiyaAsadullayeva Yes.
 
@AnastasiyaAsadullayeva Yes.
 
@ThePhD I am never talking to you ever again
 
;~;
But...
.... But.....
 
Cat has arrived. s/Cat/DSMOS
 
what would you call the opposite of a type-erased type?
strongly-typed type?
 
6:07 AM
type
 
Antonija
 
type-rich?
 
type-engraved
type-inked
 
type-retained :P
(Used antonym search for "erased")
 
6:13 AM
morning
 
morning
shared or unique ptr by default?
If I don't mind someone copying an object returned from a factory, might as well give them a shared rather than unique, no? Otherwise it's restrictive.
 
boost::scoped_ptr ftw
 
boost::quick_scope_ptr
 
(it's the only one that never breaks autocompletion)
 
@AnastasiyaAsadullayeva you can construct a shared_ptr from a unique_ptr, so no restriction
 
6:17 AM
recently used boost::intrusive_ptr. it has its merits.
 
neat, I did not know that
 
unique_ptr<int> ptr(new int(2));
ptr.release(); // release the memory
so ambiguous!
 
@StackedCrooked gnarf
 
unique_lock::release also confused me once.
 
6:20 AM
@AnastasiyaAsadullayeva only thing is the two allocations compared to make_shared
which has only one
 
So an API should rather give a unique_ptr by default and the user makes that shared_ptr if they want? Or other way around.
 
with allocate_shared it can potentially be reduced to zero allocations :)
 
shared_ptr is forever
 
Cat Plus Plus 2016
 
I hate that having a unique_ptr member makes the type non-copyable
 
6:22 AM
@AnastasiyaAsadullayeva Bahah!
 
auto i_hate_sharing = std::move(*shared_ptr);
 
And then UB when shared_ptr gets destroyed, good job
(probably not)
 
that's not ub.
 
It's still dumb
DB
 
@AnastasiyaAsadullayeva depends on what you predict your users to do with the pointer - share it or use it uniquely. Both involve tradeoffs.
 
6:23 AM
the pointer remains shared
shared_ptr (and weak_ptr) is mostly useful for avoiding lifetime bugs in threaded/async code
 
@ArneMertz I don't think it makes a difference in this case, the returned objects are immutable
 
@AnastasiyaAsadullayeva unique_ptr gives you a second allocation (and later deallocation) if you convert it to shared_ptr. Returning shared_ptr by default means that you can use make_shared to avoid that second allocation, but it means that you unconditionally allocate more space for the refcount even if you dont need it when you use it uniquely.
That said, I think returning unique_ptr is cleaner, because it explicitly states that the caller is the sole owner and the factory retains no shared_ptr or weak_ptr in a cache or something.
 
Who cares about allocations, there's a reason there's no release() on shared_ptr, it's not safe thing to do
 
@CatPlusPlus what's your point? does that make shared_ptr better or worse than unique_ptr?
 
Neither. They serve different purposes. And the allocations are inconsequential. Also, I am hungry.
 
6:34 AM
So use unique_ptr if you need to return pointers to new things
 
Hi all
 
Are you new here?
 
Yep. Kind of :)
 
APIs that take pointers shouldn't take either, unless they want to participate in ownership
 
Deviation is not recommended.
Also, welcome!
 
6:35 AM
Thanks.
The rules are basically the same as in Java chat :)
 
@CatPlusPlus ah ok, because it gives you the flexibility to release it if you want to transfer the ownership to something different. Good point.
 
Well, I'm not sure whether it's the right place to ask this. I have read a bit about backpatching on S.O and I cannot seem to be able to answer a question since the actual thing I read about backpatching is like a totally different answer from the ones available to me.
 
@nTuply if you're not sure, why not ask your question on SO?
 
Because there's already like a few of the same questions answered. I understand what it is but the question I have to answer is like a whole different thing. Here it is:

Backpatching is...
A. to patch buggy code
B. to patch in external references
C. to link patch modules
D. to link data segments
E. to link patches back into the main code
 
shared_ptr should be avoided in public interfaces.
 
6:38 AM
And so should unique_ptr
 
unique_ptr makes sense as the return type of a factory imo
 
If you are returning something that the user solely owns, unique_ptr is good.
 
Yes, if you want to return ownership too
 
@nTuply either they answer your question or they don't. If they don't, feel free to ask a new question, referring to the others and explaining why they don't answer your problem.
 
Giving stuff to the API should be a naked pointer, the API owns nothing.
And shared_ptrs should be mostly for the user dancing around with his shit.
 
6:39 AM
Cool. Thanks
 
@CatPlusPlus that's what we were talking about the whole time :-)
 
@nTuply Pose your question nicely. Acknowledge you've seen similar questions.
And you'll be fine. Make sure you point out you searched for an existing answer.
 
Okay. Makes sense. I'm afraid of getting tons of downvotes and getting locked out for not asking sensible questions, since it's basically a homework question to be honest
 
@nTuply mentioning the other questions is critical, else some zealot will close your question as duplicate ;-)
 
Mentioning prior research/analysis is more important
 
6:41 AM
Cool. Let me do that then. Thanks
I see
 
more importanter. :P
 
@nTuply show that you put some effort into it and have thought about it yourself. Only dumping homework with no sign of effort on your own will earn you scowls and downvotes.
 
Most importantest ;)
 
@sehe reviewing the other questions is part of the research, but yes :-)
 
Yea. I see that a lot when I read around. My first thought was that, if it's a homework question, it's downvotes straight away lol
 
6:43 AM
Also, good mawning @sehe!
 
Brb, let me see how to post that question.
 
I return/pass references by default. I only use naked pointers if nullptr is a valid input/output. Because this is so rare a naked pointer really stands out.
 
Yes, yes, references are good. Awesome.
 
Such a simple system but it works so well. Why did I not realize this sooner (than 3 years ago)?
 
@nTuply tons of questions are not motivated by pure interest, but because some has something to get done - homework or at the job.
 
6:45 AM
Any time you can get away with a ref is a good time. Really clean and stuff.
 
@StackedCrooked I've been trying to introduce that in a 10yo 2mloc code base after it was all plain pointers as function parameters. Tons of superfluous nullpointer checks...
 
Yeah. Those unneeded checks grated me the most.
 
I need to stop writing this driver and go to bed. Should take a shower first to cool down. Goddamn hot weather. I am really bad at sleeping.
New guy alert. Question dump in...
 
@ArneMertz I'd reckon that it's better to show understanding than to link to questions (because that leaves us to wonder whether OP actually understood or even read them.)
It's my experience, 80% of the times where other questions are defensively linked, the answer was there all the time
@ElimGarak GiuMaz or the Bartek-gone-poor avatar?
 
@sehe ok. I don't have that experience, because I almost never see references to other questions. But I see your point :-)
 
6:50 AM
@sehe GiuMaz. Ah, but no question dump. Refreshing!
Bartek disappeared again. Dayum.
 
I was gonna say - spent too much effort on a nice avatar. Dumps unlikely
@ElimGarak I missed that then?
 
Ah, maybe he's just profusely working.
Or preaching Haskell to kids at the local basketball court.
7
 
Just installed clang 3.7 on Coliru. Let me know if there are any problems.
 
@StackedCrooked will do
@StackedCrooked thx for all the work you're putting into it btw. Always grat to have something at hand that shows me how the code should work :-)
 
np :)
 
7:00 AM
shared_ptr all the things
the Python way!
 
nay
 
> When I introduced Almost Always Auto to the coding standards at my studio it was an unpopular move, precisely because of this ambiguity. I can't see any solution that doesn't break old code.
Lovely. I suppose the guy actually means it was a bad move then
@orlp Huh. It thought it was garbage collected
 
@sehe it's both
@sehe reference counted, and only gc'd to break cycles
 
Interesting.
plink plink :)
 
?
what's 'plink'?
 
7:04 AM
@plink
 
I don't understand
 
@CatPlusPlus Sounds reasonable
 
Kinda redundant. I know. It's a habit. I also catch myself doing that, but I remove the redundant plinks when I do
 
@ArneMertz Same...
 
> Reference counting is extremely efficient but it does have some caveats. (digi.com/wiki/developer/index.php/Python_Garbage_Collection)
hehe; language culture bias
 
7:07 AM
@sehe it is extremely efficient for Python's purposes
Python does so much other stuff you can't really measure the impact of GC
 
Why did they decide to make shared_ptr reference-counted with atomics by default?
We could've had atomic_shared_ptr which does counting with atomics and shared_ptr without
or something
 
@orlp isn't that what I said?
 
@sehe no?
you said it was bias
I claim it is not
 
It is
 
I'd say it's a wise tradeoff, considering the small overhead compared to everything else
 
7:09 AM
@sehe why redundant? refcounts allow for quick release of trivially connected objects. So the gc is only needed to clear up cyclic references and does not need to be run that often
 
All trade offs are legitimated with certain assumptions. That's the bias
 
on top of that, refcounting gives RAII
 
@ArneMertz Whooooooosh. It was about the plinks. <context/>
 
bias is when it's a prejudice
 
Well.
 
7:10 AM
it's not prejudice if you can measure the impact
and decide that it's not significant
 
@orlp ^ that kills it :)
> decide
 
@sehe I guess I lost you somewhere between the "it's both" and your "plink" then
 
Other biases will lead to other decisions. Gah.
You're acting like I'm disrespecting anything here. Why
 
@sehe could you define said bias?
@sehe because bias has pretty strong negative connotations
"inclination or prejudice for or against one person or group, especially in a way considered to be unfair."
 
Probably. Not relevant though. I was merely quoting that for humor value. Saying "Reference counting is extremely efficient" is likely to get you ridicule in any lowlevel programming environment.
 
7:12 AM
bias has no negative connotation at all
 
@orlp so you're biased against the word "bias"? scnr
 
@orlp PROVE IT. Now, please drop it? I clarified my intentions.
@orlp Ok :)
 
@AnastasiyaAsadullayeva you're clearly biased ;p
 
I didn't use the dictionary when I quoted my quote.
@AnastasiyaAsadullayeva Not to me either. Bias is a "scientific" (or at least statistician) notion to me
@ArneMertz Basically :)
 
7:14 AM
@orlp can you define "everything"?
 
*this
 
@sehe I could but meh
it all comes down to the connotation
if there was none, I have no issues
maybe bias only has a negative connotation in my head
3 mins ago, by Arne Mertz
@orlp so you're biased against the word "bias"? scnr
 
@orlp Next time just ask :0
 
@orlp In a conversation always try to assume the other party is well-intended
 
7:16 AM
@orlp Nah, your dictionary quote is quite supportive. I just don't use it that way. TIL
@orlp Wow. I have never seen that before
 
thought it would get oneboxed
 
That aptly describes how I learn from SO
 
"The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer." - Cunningham's Law
10
there
 
@sehe Nah, I don't think the quoted definition is correct
 
I got it from google
I know that 'google' usually isn't a source, but I don't know where google gets it from
 
7:19 AM
The wikipedia dictionnary article you just linked for example makes no mention of negative connotation
> a particular tendency, trend, inclination, feeling, or opinion, especially one that is preconceived or unreasoned:
 
@AnastasiyaAsadullayeva I don't care. It's pretty supportive. That alone falsifies the "only in my head" hypothesis
 
@sehe It's not supportive at all
He translated the quote, even
 
@AnastasiyaAsadullayeva it is supportive, the question is whether the supporting source is credible
@AnastasiyaAsadullayeva no I didn't, I posted the google link I got it from
 
hahahaha I don't get the same definition between google.com and .nl, that's ~~very supportive~~
 
@AnastasiyaAsadullayeva Is it that important. I believe "especially in a way considered to be unfair." implies negativity. That's my stance. I'm out
@AnastasiyaAsadullayeva lel
 
7:22 AM
@sehe Ok, cya
 
 
.com has "prejudice in favor of or against one thing, person, or group compared with another, usually in a way considered to be unfair."
 
... orlp. That's battering the witness after the confession
@AnastasiyaAsadullayeva wow, that's even more colourful;
 
Anyway if you think bias has a negative connotation, let me clear up a doubt for you: you're wrong.
 
So. In short. I was amused to read that reference counting is extremely efficient. Without qualification (I know the context, but it was still funny to me)
 
7:24 AM
@AnastasiyaAsadullayeva that doesn't change the fact that the source was supportive
the source might be not credible, though
 
Get a room
 
The source is wrong
QED
 
Now. That's bias prejudice
 
> Is it that important
 
7:25 AM
just for teh lulz?
 
What do you mean?
 
Suddenly usually implies unexpected [no pattern here at all]. It's not unexpected if it happens once every 2..3 months
 
I don't understand
I didn't change nickname on a whim, I have a planning to follow, you know.
 
orlp really doesn't know you're Cicada, I guess
 
@sehe oh, mr longdong is cicada?
I guess
 
7:27 AM
It's not a secret...
 
it's just a troll?
 
Well now you spoiled it
 
or
 
@orlp no. It's cicada
 
I just don't see the appeal
of changing your username all the time
 
7:28 AM
Cicada has a hobby
 
@orlp Just a MostValuedRegular®
 
its trolling
 
I did it once, because nightcracker is what I had since I was fkin 10 or smt
 
I don't change it all the time, there's a 1 month delay between changes
 
@orlp so?
 
7:29 AM
@sehe interesting term
 
@sehe do you measure value in plonks or how?
 
AFAIK I've only been fake plonked once by our most beloved lrio
 
Hi mates
 
@ArneMertz Lol. Is this real? Our Robot?
 
7:32 AM
17 hours ago, by R. Martinho Fernandes
Oh yeah, latest thing that I cut myself with: a wardrobe.
 
hi guis
its me ur grandma
just a forward you might like
 
ITT orlp out of touch with lounge
 
@Borgleader I killed it
I'd rather the kids die than the baron :D didn't even get to know them
no regrets
 
Xeo
Nice avatar
 
7:36 AM
Got loaded with muscat grape as an en-cas *o*
 
I have a gf. (hi! first time in this chat thing)
 
hi
 
for specialists
 
@William good for you, take a seat and start bitching
 
7:56 AM
user image
3
 

« first day (1789 days earlier)      last day (3151 days later) »