« first day (710 days earlier)      last day (4243 days later) » 

11:00 PM
@Abyx What I don't get is what "regional" means.
 
Xeo
@sehe Maybe they'll send all Java programmers to prison!
 
@R.MartinhoFernandes yep
 
@MartinJames Shit. i thought I detoxed
 
That question blew my mind. Thanks Xep.
 
@Xeo Great initiative :0
 
11:00 PM
Xeo*
 
@R.MartinhoFernandes a language of a local area
 
This is a great typo.
 
@sehe where?
 
@ThePhD Edit with up arrow. Also: newbie-hints
@Abyx Erm the java thing?!
 
Xeo
11:01 PM
@ThePhD I thought you read our "rules" (newbie hints)? :) They tell you that you can edit with up arrow
 
@Abyx Holy... WTF-
 
I guess I didn't read it closely enough. Now I'm terribly embarrassed ... Ooh, shiny. Edits.
 
 
He read the most important part, Xep.
 
Ok, so, can I assume Lviv is populated by people escaped from mental institutions?
 
11:02 PM
Yes.
 
@CatPlusPlus lulz
 
@sehe o_O
 
Oh that makes for a rather intricate Java joke. We should somehow bake that into the topic line right
 
I can't type all those letters.
 
Erm. One last thing.
 
11:04 PM
@CatPlusPlus Maybe, just some reference to "Lviv" or "not Lviv"?
 
@R.MartinhoFernandes Some might say that Lvov is populated by people living IN a mental institution, I couldn't possibly comment..
 
... If I'm one of those bright-eyed, idealistic 'I'll write my own library' kinda people, and I want to write my own Pointer class (that works like shared_ptr / unique_ptr)
 
Don't.
 
... Um. How do I go about implementing that awesom- Don't?
 
11:04 PM
room topic changed to Lounge<C++>: In Lviv (Ukraine), the programming language Java can get the status of regional [.read-the-rules] [c++] [c++11] [c++-faq]
 
Well, not for actual use.
When you're old and bitter enough, you'll create a library full of template masturbation, and then you'll implement them.
 
room topic changed to Lounge<C++>: In Lviv (Ukraine), Java may become the official regional language [.read-the-rules] [c++] [c++11] [c++-faq]
Hope that's still google friendly
 
Just use existing implementation, no point reinventing the wheel if you're not experienced enough to improve it.
 
@ThePhD shared_ptr is extremely complicated to get right, btw. At least if you keep the same requirements are the one in the standard.
 
If you want a fancy non-standard implementation, then both @R. and @Luc are old and bitter and have their own libraries.
3
 
11:07 PM
@CatPlusPlus Hey!
I'm 25.
And you are the bitter one.
 
@Abyx Oh, only now do I understand you probably tried to send us an Anglicized version of that page. That didn' work here :)
 
SO made me bitter.
 
@CatPlusPlus @R (Is this how I ping people? Neato) Um. I'm not old and bitter (yet), but I've managed to scrum up a pretty robust game engine thus far. It works pretty well, despite using pointers for everything and I haven't vomited any memory leaks just yet. Erm. I just wanted to hook up my Pointer class to a new memory management system I was thinking of building up...
 
And I'm 20, so it's even sadder.
 
11:08 PM
And I haven't reinvented anything that wasn't broken yet.
 
wrt reference counting, there is not-so-bad llvm::IntrusiveRefCntPtr<T>
 
Instrusive ref cunt pooter.
 
@CatPlusPlus I was going to say 'hey it's not like I implement smart pointers' but I've jumped that value_ptr ship.
 
@CatPlusPlus I read that in STL's voice.
@LucDanton It's not reinvention!
@ThePhD You need three characters to ping (i.e. @R doesn't work, sadly).
 
11:09 PM
Also current topic is boring.
And the upper pin is boring.
 
Well, not yet. I'm getting hints there's a proposal. Also, this is eating in my gaming time and I need to be efficient about that. Stop pinging me!
 
Why are we even talking about this.
 
Masturbation is reinvention too
 
@ThePhD If you want to try it for practice, go ahead. But it's far from simple (well, unique_ptr is quite simple, but shared_ptr is really nasty)
 
TIL: The Cat may live in Lviv
 
11:11 PM
@sehe He's from Poland.
 
Xeo
@LucDanton Whatcha playing?
 
No, I don't.
Do I look like I'm speaking Java.
 
@CatPlusPlus Mmm. Missing coherence: check. Depressed: check. Objecting to topic: check
 
@R.MartinhoFernandes I'm going more for Unique_Ptr, I think. Where the Pointer<GameTiming> can be passed up and down a stack and only 1 GameTiming struct ever exists.
 
11:11 PM
Why am I clicking links faster than I read them.
Good thing they implemented confirm page.
 
OK, shared_ptr. I push a shared_ptr onto a deque or vector or something, that increases its refCount by one, yes?
 
@CatPlusPlus that white cat? yeah it does
 
@ThePhD That's not what unique_ptr does.
 
@CatPlusPlus lol
 
@R.MartinhoFernandes I'd need to get up and do that on my other computer, which is on another floor and yet I can still hear. Unacceptable!
@Xeo GW2
 
11:12 PM
@CatPlusPlus Well then I'm just completely lost. Should I go back to the google again?
 
You'd pass reference or a normal pointer between things, and only keep unique_ptr where ownership is.
Also singletons are bad and never use them.
And don't let crazy Russians tell you otherwise.
 
... I use a Singleton and I'm not Russian.
 
I didn't said anything
 
.... Goes and changes it.
 
You like singletons.
:.
 
11:14 PM
I'm American, I swear.
 
I just use them when I need them
 
It was a jab at @Abyx.
:thejoke:
Also, depending on what GameTiming is, you might not need to use a pointer at all.
(Well, and how you use it)
 
@ThePhD Conclusive evidence. Americans love to swear
 
Always prefer values.
@LucDanton Also you made me realise I play two MMOs now.
Fuck.
 
@CatPlusPlus GameTiming is a struct that contains 3 TimeSpans (also structs, which essentially just wrap a long long that holds system ticks and does timing calculations). My hope was that I wouldn't have to copy GameTiming up and down the stack 3432894234 times, because it's used a whole bunch. It's also a testbed for a few more cases (like a Texture class) where I don't want to have to recreate or re-ducplicate pixel arrays.
@sehe Verily.
 
11:18 PM
@CatPlusPlus values on stack? they die as soon as you leave them
 
everything_else(IMPORTANT_TYPE&); main() { IMPORTANT_TYPE IMPORTANT_THING; everything_else(IMPORTANT_THING); }
Roughly.
 
@CatPlusPlus Mwhahaha.
 
@ThePhD You don't need to use pointers to not copy things.
 
GW2 and...?
 
11:19 PM
I want GW2.
So badly.
 
I play a necro because I'm cool. What do you play?
 
But fried my graphics card and now I'm restricted to League of Legends and Dota2. At 15 FPS. q_q
 
An jerk asura elementalist.
Necrophilia is not cool I don't know where you live.
 
Apparently the chopper overhead had to do with a big fire in a house "nearby" <1.5km. I hope no kids are missing from school tomorrow (no mention of casualties). Probably just the FD checking for toxic emissions, assisting with heat imaging or similar?
 
I'm getting better at that whole ruining people's day in EVE, though.
GW2 is much more tame.
 
11:21 PM
@CatPlusPlus What's the alternative?
 
But fun to just wander around the map and have stuff happening around you.
@MartinJames I don't know, references maybe.
 
@CatPlusPlus I do pass by reference where I can, but there are a few things that could really benefit memory-wise from something like unique_ptr. But I guess I'm just going to have to suck it up and use unique_ptr or shared_ptr, like a good, idealistic, 'THE STANDARD IS AMAZING' person I guess.
 
@CatPlusPlus Yes, that is how and why I play it. Would not recommend for ruination.
 
Or a pointer to a value if you're crazy.
@ThePhD Define memory-wise benefit.
 
@ThePhD Really, don't pass smart pointers as you would pass references or naked pointers.
 
11:23 PM
Unless your types are like 5MB large, there's no advantage of not using the stack.
 
@CatPlusPlus Unreseatable. Not practical for inter-thread comms, (as you probably guessed I was going to say).
 
@MartinJames Eh?
 
In desperation, I attempted to look at the MSVC++ Source code file 'memory' to see how they define the default deleter for unique_ptr....

Whoever coded this clearly has no interest in anyone else understanding it but them.
 
@MartinJames That's not relevant in function parameters, though.
 
Don't read standard libraries.
When you get recruited by shady organisations that do that, you get your brain liquified and injected into CPU directly.
Don't do standard libraries kids.
 
11:25 PM
=[ I like my brain.
 
@ThePhD They have an interest in making standards compliant library code. Which is pretty hard and specialized.
 
@ThePhD Passing a smart pointer by value means giving ownership. Passing a smart pointer by reference means that the function operates on a smart pointer and not on the pointee. Neither of those has the same meaning as passing a pointer or a reference to the actual object.
 
BS. they just write a regular code, then add __ everywhere
 
@sehe Oh shit. Typical, you make a flippant comment about something, then find out lives are in danger :((
 
No, it's not regular, it's unreadable.
Unless you're already stdlib-crazy.
This is serious brain condition.
 
11:26 PM
lol
 
oh my...
 
I hear WHO alerts about that.
 
@CatPlusPlus Memory-wise efficiency in that I can always guarantee that I'll have a single pointer and won't leak broken or deleted pointers out into the ends of the earth. It also helps for my Array<> class, which has been helping me up until I realize it calls the destructor and destroys my array when it goes out of scope. =[
 
@MartinJames Well, apparently not (according to breaking news services). I'm just keeping it in the back of my mind. That house was literally <50m from our school. So... chances are people know people
 
Don't ever delete stuff manually, no leaks or double-frees or use-after-frees.
 
11:28 PM
@ThePhD ah, like in J**a or C# ?
 
Also stop reinventing stuff already.
 
@CatPlusPlus You need to get your hearing checked
 
@sehe I probably should.
Really, use a value. Cases where you need a pointer are special, not regular.
Learn the real proper modern C++ design.
 
@Abyx Uh. I guess? It's just that unless I do void MakeItCooler ( Array<CoolStuff>& arr ), it'll usually blow up my Array<> if I just do the regular void MakeItCooler ( Array<CoolStuff> arr )
 
(You're still using C++, but at least with style)
Know when to copy and when to not copy.
 
( @CatPlusPlus I wish that I had a better Source Code Formatter for C++. I was doing C# for a little while and that shit spoiled me rotten as far as code formatting went. )
 
MOVE ZIG!
FOR GREAT JUSTICE!
 
@ThePhD Sounds like you're not following the rule of three.
 
Those spaces are ugly.
 
And I'm out, night all
 
11:31 PM
foo(T& x)
 
@sehe All night?
 
@R.MartinhoFernandes Or the rule of Zero :)
 
@CatPlusPlus ..and not copying is more efficient and safer. Yes, I know, some disagree.
 
@R.MartinhoFernandes No no, I do follow. It's just a wish of mine.
 
11:32 PM
Efficient is useless without numbers.
Also when you want a copy, you need a copy, and there's no way around that.
Because you can't do X without doing X.
Unless it's X11.
 
@ThePhD What wish? If you say void MakeItCooler ( Array<CoolStuff> arr ) blows up your array, it does sound like you're not doing copies correctly.
 
@CatPlusPlus yep, it's like a singleton...
 
@Abyx No, get out.
 
I.e., it works unless you're doing it wrong.
 
Wharrgarglb.
 
11:33 PM
@MartinJames Yes, that is true, and it shows when I built my RayTracer on top of the Engine. Each per-pixel calculation was monstrously painful and took far longer than ti should have.

Damn you, copying...
 
NO SINGLETONS
 
@CatPlusPlus uhm... good idea btw, it's 3:33 here
 
@R.MartinhoFernandes It does mean that. It's just when I pass that Array class I made down, and the function finishes, it exits and C++ calls the destructor on it, which calls delete[] on the internal pointer. Obviously it works if I do Array<CoolStuff>& arr and just use a reference like a goodboy, but I wanted to see if I could have a safety-net mechanism built into the Pointer itself, rather than always ensuring I pass by reference.
 
@MartinJames I disagree because I can't think of a situation where you need to consider those two criteria to choose between copy or not copy. I always seems to be able to decide it from the semantics I want. So the efficiency or safety comparisons don't even make sense (i.e. I see it as apples to oranges).
 
@ThePhD Well obviously if you want to mutate something, you need mutable reference.
 
11:36 PM
.... The terms. So many. My brain. T_T
 
Smart pointers are not a tool to replace proper design.
You need to know what you want the function to do.
 
@ThePhD So, you want a reference but don't want to use a reference? That doesn't sound good.
 
Barring typos or other silly mistakes, if you want your modifications to be visible outside, you know you need to use a reference.
 
@CatPlusPlus Something we agree on!
 
In fact, use references by default.
 
11:38 PM
@R.MartinhoFernandes Something like that, I guess.
 
(It's not very 11y, but whatever)
 
@ThePhD The phrase "I guess" does not inspire a lot of confidence.
 
You don't need pointers, unless you really need pointers.
This is the cardinal rule.
 
Seriously, your problem doesn't exist.
It's all artificial, because for some reason you don't like references.
 
... Now that I think about it, I might as well just use references and not bother with the pointer question. I just wanted to make sure I had the safety in case I was going to pass certain pointers up and down a stack, especially large array ones.
... Hm. Well, I feel terrible now and dumb. Back to work!
 
11:40 PM
Now learn Haskell and never use C++ again.
 
Haskell?
 
@CatPlusPlus I was kinda disappointed you hadn't said that yet. :P
 
@ThePhD What makes you think pointers are a better solution than references in your situation?
 
@R.MartinhoFernandes I cut back, because I don't want to annoy you <3
 
Oooh, I'm flattered. I think.
 
11:41 PM
@Insilico I just have a giant array - a pointer - inside of a class. I wanted to make sure that the pointer inside that array class was safe, whether or not I passed it by value or reference in whatever I was doing.
 
@ThePhD To make sure the pointer inside the array class was safe? What are you protecting it from?
 
Giant arrays are probably maybe possibly not good either.
 
Pointers are by definition not very safe.
 
@Insilico Pointer thieves, duh.
 
@CatPlusPlus I can't be bothered with a references/pointers jihad at this time of night either. Besides, I'm a bit pissed and it's a very bad state to be in when any sort of disagreement comes up. We're off to sleep now. G'night all and thanks for all the popcorn!
 
11:44 PM
Have fun.
 
Burn all the pointers.
 
Oh
 
Make them cry and leave.
 
It's too late to edit that message. I just lost all that stuff I typed.
... Well, learn something new everyday.
... Ahhhh, Lazarus can't pick it up either. Bummer...
 
Damn, this user CJAN.LEE alias user1697907 irked me before, right? Now he posted what is basically my code - under a different name, asking the same bloddy question I (tried) to answer in the comments to my own question that he butchered to force his question in...: stackoverflow.com/q/12587148/85371
Now how does that work?! /cc @MooingDuck
(Oh, code copied from my answer here: stackoverflow.com/a/8707598/85371)
 
11:47 PM
Hahahahahhahahahahahahhahahahahahahahahahahahahaha they edited an answer to add a question.
That's a new one.
 
@ThePhD Do you have a PhD? And if so, what area of study?
 
@Insilico I was protecting it from myself, essentially. The problem first arose when I passed Array<CoolStuff> by value into a function. When the function exited, the destructor was called, and the internal pointer - copied into the new Array<CoolStuff> that was made on the stack - blew up the data. After the function exited, my beautiful array was dead. The simple fix is this: pass by reference. That makes sense, it works, and everything is fine.

But I thought to myself, 'how can I protect the internal data if I do pass the overlaying class that holds the pointer by value?' And then I stu
@Chimera I do not have a PhD yet. I'm still an undergrad. But I really program on my free time. Because I'm supposed to become a Computer Engineer. I wish I had a PhD, hah! Also, that dissertation. Can't wait....
 
@ThePhD You did screw up copy semantics/rule of howmanynow.
Copying should not shallow copy the pointer.
 
@ThePhD Really, if that caused something to blow up, your Array class is broken.
 
Unless you're doing refcounting or whatever, but then you wouldn't have this problem.
(Really just use std::vector)
 
11:49 PM
@ThePhD ah, well good luck. Long way from undergrad to PhD.
 
@ThePhD That means either CoolStuff or Array has a bug in either of their copy constructor(s). The pointers/reference thing is a red herring.
 
... Oh. Okay. Let me try something then.
Uh. Just another quick opinion question. Is it good to avoid the Standard Library?
 
No.
 
11:54 PM
3 for No, 0 for Yes.
Well, okay.
 
Avoiding the standard library is why we get half-assed clones of std::string and std::vector that is 20 times slower and 20 times harder to use correctly and 20 times easier to use incorrectly.
 
And broken.
 
Ah.
Sounds reasonable. But I've got a gripe with Unicode and std::string.
 
Seriously, I don't mind people reinventing std::string or std::vector if they worked just as well (or even better), but people don't ever do that.
 
Everyone does.
std::string is terrible.
 
11:57 PM
I'm trying to just make my Array class easy to use and iterate over and etc. I've also felt a little left-in-the-cold by the lack of a true HashTable / HashMap implemenation in the std library, so I've rolled my own.
 
unordered_map
If something is not in std, it probably is in Boost.
 
I don't get it. std::vector is easy to use and iterate over.
 
Less code you write, the better.
 
I've never actually used Boost.
 
for (auto x : xs) { magic }
 
11:58 PM
@CatPlusPlus It sticks because the alternatives... well...
 
That looks like something out of C#
 
@ThePhD Yes. So?
 
It's C++11. Currently supported in GCC>=4.6, Clang>=3.0 (?) and MSVC>=2012.
 

« first day (710 days earlier)      last day (4243 days later) »