« first day (546 days earlier)      last day (4385 days later) » 

9:00 AM
Same effect? That is RAII.
 
And refcounting is GC.
 
Hmm
I'm just going off this quote on Wikipedia
> Methods used to manage such resources, particularly destructors, may suffice as well to manage memory, leaving no need for GC.
 
Yeah, quoting Wikipedia solves everything.
 
:)
 
Destructor, Dispose(), who cares. Implementation detail.
 
9:02 AM
What's dispose()?
 
They all run after the fact that resource is requested to be freed.
11AM. Screw this, I'm going to sleep. Everything is boring.
 
Night. Go dream unboring things.
 
PngCodecFactory <---- in a C++ library?? meh
 
Depends on what it does. I have window_factory.
 
oh you make windows?
I thought MS would have a window_factory
 
9:16 AM
window_sweatshop is more like it
 
@CatPlusPlus so when is it a bad thing and when is it a good thing?
 
It's a bad thing when it's a bad thing. If there really is a need to do stuff before creating other stuff, and it's based on third pile of stuff, then a factory of stuff is better than forcing you to do that stuff manually.
 
Why do you need a window_factory though?
 
to create windows obviously
why else?
I mean, ask any Java programmer, he'll tell you
 
Hehe
 
9:20 AM
Because there's stuff to be done before creating windows.
Registering the window class, or connecting to X display.
 
Why would you need to do that multiple times though?
 
I don't. Hence why it's in a factory, and not done in windows ctors.
 
I mean you can create multiple factories, right?
 
You can if you really want to.
Not that it has a purpose.
 
But why not use static?
 
9:22 AM
Where?
It's a library. Also globals suck.
 
It can be in the .cpp only, that's what I did
 
Global.
 
What?
 
That thing.
 
.cpp is global?
 
9:24 AM
sigh
 
I don't understand :(
Tell me so I can fix my possible shitty code
 
9:39 AM
why is this a performance warning ?
 
@TonyTheLion because Microsoft
3
 
oh lol
 
10:03 AM
20
Q: What is the performance implication of converting to bool in C++?

jwfearn[This question is related to but not the same as this one.] My compiler warns about implicitly converting or casting certain types to bool whereas explicit conversions do not produce a warning: long t = 0; bool b = false; b = t; // performance warning: forcing long to boo...

 
Instead of generating a "performance warning" the compiler could just optimize it, but yeah Microsoft.
Similar to spell checking in Office. Instead of figuring out the language you type in for you, it marks everything that's written in Dutch as "wrong".
 
@daknok_t Actually the codegen is exactly the same in both cases
 
@Insilico oh thanks
 
I just watched the browser video. I didn't realise that many people didn't understand what it was
 
@daknok_t yep, been there
 
10:13 AM
@daknokt: I thought the language was dependent on the language the OS is set to?
 
@daknok_t They detect it better these days
It's not foolproof, but better
 
@daknok_t How can they optimize it without breaking langauge conformance?
 
10:29 AM
@Insilico Microsoft shouldn't assume that people don't know more than one language.
 
@daknokt: Windows can switch between languages, no? I'm sure I can have everythinf in Spanish if I wanted
 
@Insilico I was talking about the spell checker that doesn't automatically detect the language you write in. Instead, the user must explicitly set it.
 
@daknokt: I see. Although whether I want something like that depends on how good its heuristics are
Human languages are rather messy
 
Which is even more annoying when you write a document in multiple languages. The spell checker should adjust itself for each sentence.
 
@daknokt: I was just about to mention that
Or, more commonly, if I need to put in code blocks
The spell checker of course goes crazy on it
Although I would use LaTeX for anything technical in the first place
 
10:33 AM
Yeah, Word should use libclang as a spell checker for such cases. :P
 
mawnin
 
@DeadMG: Morning
 
@DeadMG aftenoown
 
hmm
 
Ell
arghhhhhhhh linking errors make me cry
 
10:38 AM
just realized that I specified operator overloads to be, for example, +(args) { body }
 
@Ell prevent them from happening.
Link responsibly.
 
Ell
haha
seriously - I'm using ogre, and I am definately linking libOgreMain.so but still I get undefined reference :O
I'm too ashamed to ask a question about a linking error that I know will just be a stupid mistake :L
 
OGRE is a disgusting Singleton fest that I couldn't lower myself to use
 
Ell
there are a lot of singletons
what is irrlicht like?
 
dunno, actually
 
Ell
10:41 AM
but then again no libraries are ever exactly the way I want them
 
heh
agreed
 
Ell
everyone want stuff different though so :L
I don't really mind the singleton stuff :L
 
@Ell: I've actually never had to use a singleton except for this one time
To wrap TlsAlloc()/TlsFree()
 
Ell
I'm still unsure when to use them - I would say in order to provide access to a shared resource
but I have never needed it
 
never, ever, ever use a Singleton
 
10:44 AM
@Ell: You would use a smart pointer for shared resources, no?
Presumably they all own said resource
 
Ell
@Insilico well yeah but I mean if you don't own the resource and want to provide a wrapper around it or something
let me think of an example now :L
 
@Ell T*?
oh, yes
some stuff really is process-global, and that's just how it is, stuff like the Standard output
 
Then make a non_owning_ptr<T> or something, so I know what the hell I'm supposed to do with it
 
but that's better just being a global variable
no need for any Singleton shenanigans
@Insilico T*, you mean?
 
@DeadMG: You can use T*, of course, but every time I see it it's almost never obvious what I'm supposed to do with it
 
Ell
10:46 AM
@Insilico I was pondering this earlier
 
in my systems, non_owning_ptr<T> == T*
 
Ell
should I use T* or a non_owning_ptr<>?
 
With just a T* I don't know if I have to use delete, delete[], Free(), free(), HeapFree(), DestroyXXX(), etc.
 
@Insilico Never any of the above.
 
Ell
@DeadMG same here - but other people don't necessarily know that
 
10:47 AM
smart pointer for any owned resource.
if you have a T* you don't own it at all
 
@DeadMG: Unfortunately not everyone is as good at programming as we are
 
and don't do any destructing action on it ever
 
It's simply documentation
 
Ell
yeah
 
@Insilico There's a difference between not having the same paradigm-spanning infinite genius as me, and having the capacity to use smart pointers.
 
Ell
10:48 AM
self-documenting code
 
anyone who can't use smart pointers on a C++ project should be fired
2
 
@DeadMG And there's a difference in understanding when a person reads T* vs. non_owning_ptr<T>
 
no, there isn't
 
@DeadMG And I agree. But I like self-documenting code
 
because they're both not unique_ptr<T> or shared_ptr<T> or my_custom_resource_handler<T>
that's what counts
 
10:50 AM
@DeadMG: Again, I agree. And I wouldn't object to the use of T* to mean "pointer that doesn't own the thing that it points to".
I just prefer to "annotate" the code via the type system
 
the type system already has an annotation for non owning pointer
T*
 
@DeadMG: I guess I'm just aiming for consistency (shared_ptr<T>/T* v.s shared_ptr<T>/non_owning_ptr<T>)
 
Ell
I disagree (With deadmg, agree with insilico)
I would prefer explicit pointer meanings
 
T* already has an explicit pointer meaning
the part where nothing happens when you copy/move/destruct it
 
Ell
Its not explicit enough
unique_ptr is explicit
shared_ptr is explicit
 
10:53 AM
@DeadMG: From experience when people see a T* they immediately start thinking what they need to do with it
 
T* != unique_ptr<T> or shared_ptr<T>, and that's all that has to be
 
Lots of Qt questions I've seen (and answered) were about "What am I supposed to do with a QWidget*?
 
Ell
anyway its all a matter of personal preference - right?
 
References and values aren't very explicit, doesn't cause much trouble
 
that's because Qt was designed by a moron and has no relation whatsoever to good C++ practice
2
 
10:54 AM
It's not C++, it's Qt
 
Not even the simple things like namespaces.
 
or more accurately, as far as I'm aware QWidgets are owned by their parents, and therefore the correct answer is "nothing"
 
@DeadMG Duh. But if they used something that's more than a T* like non_owning_ptr<T> I would probably see less questions about what the hell I'm supposed to do with T*.
 
dumb_ptr<T> is better
 
10:55 AM
@Insilico That's true. But what would be a more useful investment of time is simply to not use a shitty ownership model in the first place.
 
using non_owning_ptr<T> would be like sticking a plaster on a bleeding artery
 
Ell
@DeadMG "as far as I'm aware" - the fact you had to be aware means a more explicit name would be useful
in my opinion
 
not really
it means that Qt sucks
nothing more than that
 
Ell
why does Qt suck?
Qt does the right thing
 
10:57 AM
@Ell: Don't get me started on Qt
 
Ell
its a non-owning pointer... right?
 
3 mins ago, by DeadMG
that's because Qt was designed by a moron and has no relation whatsoever to good C++ practice
 
Ell
:L
 
First of all, it uses a prepreprocessor tool called moc
That's not a typo. It runs before the C++ compiler
And because of it they grafted on a whole bunch of language extensions
 
4 mins ago, by Pubby
It's not C++, it's Qt
 
10:59 AM
So Qt code isn't even standard C++ most of the time
No exception safety whatsoever
They keep reinventing the container and smart pointer classes for no reason
(At least if you are going to reinvent something you should make it better)
 
Cross-platform GUI libraries suck anyway. You can't write a decent cross-platform GUI library.
Platforms are way too different to do that reasonably without suckage.
 

« first day (546 days earlier)      last day (4385 days later) »