« first day (352 days earlier)      last day (4599 days later) » 

8:00 PM
@EtiennedeMartel lulz, well no, I'm referring to my name...
 
@TonyTheLion I was referring to the use of Python in the document you linked.
 
@EtiennedeMartel I think that was just a general thing, not specifically to one OS
 
Real men use C.
And then they suffer an eternity of pain of dangling pointers.
 
hahah true
 
But at least they're manlier that way.
 
8:06 PM
manliness is worthless
 
lol
@DeadMG you seem to be good at breaking down most any argument thrown at you
where did you learn that skill?
 
it comes from admitting how incredibly superior I am
 
It's called "snarkiness".
 
and therefore how intrinsically, if I say it, it must be true
therefore, you don't really need to put much effort into it, and merely state it
 
Must be hard getting through doorframes.
 
8:09 PM
why?
 
Because of the sheer size of your balls.
 
admittedly, they are truly massive
I get females every day wishing to inspect them further
 
oh damn
the sheer self-confidence exuded from your very soul...
 
heh
sbi would say, the sheer inexperience
 
lulz
probably, but he's not here, so he won't say it :P
 
8:13 PM
true true
I prefer to think of it more as "Other people aren't right just because they say so, or because they have more experience, or because they're the majority opinion."
 
@DeadMG hmmm interesting, so I guess that makes you question ALL THE THINGS!!
and never take anything said by anyone, as true, just because this person said so
nice, I kinda like that :)
 
precisely
my argument is equal to your argument until and unless you give solid, rational, objective reasons why
and by "equal" I mean "better than"
or "intrinsically superior to"
 
@DeadMG "better" is only defined by the eye of the beholder
it's subjective
 
exactly
 
@DeadMG that is a different thing, I guess
 
8:16 PM
:P
 
I like talking to people, always something to learn :)
 
I don't like talking to people
they're unpredictable and fuck you over when you need them
or they misunderstand what you say, or go back on what they said previously
 
meh, you pessimist
 
@DeadMG You might have some slight trust issues.
 
no, rly?
 
8:18 PM
you could never survive alone
 
actually, I much prefer being alone
 
hmmmm, you know I had the same problem
 
you get much more control
I wouldn't classify it as a "problem"
some people are introverts, some people are extroverts, being an introvert isn't a mental illness
 
never said anything about a mental illness
 
There's a difference between "introverts" and "disliking people".
 
8:20 PM
I'm pretty introvert too
but I like people, and I like being social
 
@TonyTheLion It was an exaggeration :P
 
@DeadMG oh lol
 
@EtiennedeMartel Can't a man be both?
 
@DeadMG Sure. Except that might make you a sociopath.
 
yea, they can, you're living proof :P
 
8:21 PM
heh
 
I'm saying might because I'm no psychologist
 
I am not a sociopath
 
I don't have the sufficient expertise.
 
@EtiennedeMartel well, he's still somewhat social, he's on this chat
 
being a sociopath is defined as lacking empathy, it's really just that simple
 
8:21 PM
@TonyTheLion Chatting with others is easy. Friendship is about sharing shit.
 
@DeadMG no you're a puppy :P
 
but unfortunately, I am blessed with far too much of the damn stuff
 
@EtiennedeMartel I know, all too damn well
@DeadMG not sure if that's an unfortunate fact
 
hello
 
Aaaanyway, gotta go. See ya!
 
8:22 PM
See ya
 
it is most assuredly an unfortunate fact
 
@LewsTherin hi
 
I'd much prefer being less sensitive
and less intelligent, in fact
all it's brought me is misery
 
@DeadMG hmmm
 
I'm :S
Apparently there is a difference between `Object s; ` and `Object *s = new Object()`
@Tony hi
apart from the obvious difference
 
8:23 PM
@LewsTherin very much a difference
 
@LewsTherin Of course there is. new allocates on the heap
and secondly, new Object(); is a value-initialization
 
There's no other difference apart from the obvious differences.
 
i.e., new int(); yields a pointer to an int which is zero, whereas int s; is an uninitialized value
 
@RMartinhoFernandes isn't there ? @DeadMG true
but in this code
Object s generates code to declare a variable of type Object and and also create that object
 
@LewsTherin and the other too, calls the ctor as well
just in the second case you're returned a pointer, instead of the object itself
 
8:25 PM
Object *s = new Object() generates code to create a pointer variable to type Object and then generates code to create new Object() and return a pointer
 
right.
your point being?
 
you're missing the more subtle difference
the parenthesis
 
one creates the object directly the other doesn't create the object must be done explicitly
 
Object* s = new Object; != Object* s = new Object();
 
@DeadMG really?
 
8:26 PM
oh yes
 
why not?
 
@LewsTherin What's Object?
 
that's the other difference in what you quoted- one has parens, and one doesn't
 
@RMartinhoFernandes just a random class
 
well
for non-POD types, they are the same
but for POD types, one is value-initialization and the other is just, well, no initialization
 
8:28 PM
don't get it...
 
i.e., for an int, *new int is reading an uninitialized variable, but *new int() yields 0
it's a shitty hole of the language
 
*new int deferences the pointer returned? as in the garbage pointer
 
Here:
22
Q: What do the following phrases mean in C++: zero-, default- and value-initialization?

BillWhat do the following phrases mean in C++: zero-initialization, default-initialization, and value-initialization? What should a C++ developer know about them?

@LewsTherin No, no, the pointer is not garbage. It's valid. It just points to... something.
While new int() points to a zero, for sure.
 
@RMartinhoFernandes oh I see ... except zero is not a valid address..thanks for the link
 
No, no, you're confusing this.
 
8:31 PM
it points to a zero
 
so there is an address in memory that is 0x0000,, ?
 
just like if you had said int i = 0; ptr = &i;
one is int i = 0; ptr = &i; and the other is int i; ptr = &i;
except obviously the int is heap allocated and not stack allocated
 
oh so it doesn't point to zero but a memory location that has 0 for a value? lol
I mean in your example ptr doesn't point to 0 it points to i which has 0 for a value...completely different
 
That's why I said it pointed to a zero. Sorry if that confused things.
 
Oh ok that makes sense no problem. I just don't understand why books and lecturers always say A *a = new A()
 
8:38 PM
because, basically, it's a bad idea to not initialize it
 
that A is created at runtime when A a ; a is also created at run time as well
 
it's much better practice to always initialize it#
 
Sometimes you do want just uninitialized storage, but all the time you really want it initialized.
 
@DeadMG yeah I was taught that
why would we want uninitialized storage?
 
Think std::vector.
 
8:40 PM
well, technically, if you initialize it and then write to it, you've wasted some cycles
 
@RMartinhoFernandes ah yeah
 
this is irrelevant on the vast majority of platforms and systems, but in some very rare conditions, it might yield better performance
 
@DeadMG Yeah, sometimes reading from streams is a pain.
 
@DeadMG wasted some cycles? What do you mean
 
well, if you do something like
 
8:42 PM
@RMartinhoFernandes I'm not sure std::vector is a good example. std::vector uses the allocator type, which defaults to std::allocator.
 
int i = 0; if (condition) i = 3; else i = 4; then you've wasted the time it took to initialize i to 0, as you just overwrote that value anyway
 
@DanielTrebbien And? It still uses uninitialized storage.
 
Well, yes, but it's not like the STL writers have a choice not to use uninitialized storage to allocate the underlying memory.
 
@DeadMG I see, so initializing i to 0 wastes a bit of ms
 
@DeadMG What pains me the most in there is that it may prevent useful compiler warnings.
 
8:44 PM
@RMartinhoFernandes sometimes I get warnings that i for example has been initialized a value that's never been used
I just ignore it
 
Don't ignore warnings.
That leads to the dark side.
 
The storage for each vector element is initialized when it's added to the container.
 
I mean int i =0; nothing wrong with that yet it complains
 
@DanielTrebbien That was my point. Sometimes you want uninitialized storage.
 
A std::vector first calls allocate(), then construct(), I believe.
 
8:46 PM
@LewsTherin If you don't use the value, why are you initializing it?
 
@RMartinhoFernandes because I was told it is good practice. :)
I could initialize i to 0 and then the if else or whatever changes the value so it complains
 
ok
 
Whenever someone says something is a good/bad practice, and stops there, ignore them.
 
I want to design a cross-platform API that will support using multiple windows in games
what do you guys think of
 
And if they use "best"/"worst" instead of "good"/"bad", ignore them twice as much.
 
8:48 PM
@RMartinhoFernandes lol
But even the books say that
always good to initialize your variables on declaration
 
That's true. It helps you avoid using the value uninitialized.
But it can also hide bugs if done for the sake of it.
There's nothing wrong with int i /* no initialization */; if (condition) i = 3; else i = 4;.
 
but you know the problem isn't at initialization so one could debug after initialization?
@RMartinhoFernandes yeah because i gets initialized anyways before use
I see
 
Problem is, if you initialize to a dummy meaningless value, just to initialize, you may end up unwittingly using that dummy meaningless value further down, because you forgot to give it a meaningful value.
But if your compiler warns you about uses of uninitialized variables, by not initializing meaninglessly, you'll have the compiler reminding you about that.
 
Sounds like a no win situation or just knowing when to initialize
 
@DeadMG Perhaps the functionality of SwitchToScreen should be moved to the Screen interface. Screen::Accept(Window&)?
 
8:56 PM
unlucky if that happens to you
 
Also, what about using shared ptrs to Screen objects?
 
nah, they're uniquely owned by the OS object
 
@LewsTherin That's key: only you know when to initialize and to what.
 
Should CreateOS() return a shared ptr?
 
no, why would it do that?
what's the ownership to be shared with?
actually, I'm just going to ditch SwitchToScreen
 
8:58 PM
Are you planning on allowing multiple threads to call these functions?
 
@RMartinhoFernandes @DeadMG ok thanks much
 
no
there's only one control thread
 
Oh, okay.
So there's no need for shared ptrs.
as long as the owning object is alive.
 
you can create one from a unique_ptr anyway if you need to
 
template <typename T> using exclusive_ptr = std::unique_ptr<T, std::function<void(T*)>>; seems attractive.
I want support for template aliases in GCC soon!
 
9:01 PM
it is- if you have template aliases :P
 
@RMartinhoFernandes is the members initializers list sort of equivalent to Java's
private string s ="Hello" ; because it executes that code before the constructor is called
 
@LewsTherin Yeah, they're somewhat similar.
 
except in C++, the init list can take arguments from the constructor
 
And in C++11 you can do class foo { std::string s = "Hello"; int x; foo(int x) : x(x) {} };
 
Really you can do that now?
sweet
 
9:04 PM
@RMartinhoFernandes Really?
 
Is it only for strings?
 
no, any type I believe
 
@DanielTrebbien Yep.
@LewsTherin No, not just strings.
 
That is... weird.
I'm not sure that I like it.
 
9:06 PM
wow I like it
NICE!
 
Does C++11 still have deferred constructors?
 
brb
 
As in one constructor can call another?
 
deferred?
 
9:06 PM
oh, that's usually referred to as delegating
and yes, it does
 
Delegated constructors.
 
Yes! That's it.
 
fuck
I am unhappy
 
@RMartin So in your example, when is s constructed?
 
@DanielTrebbien It's as if it was in the initializer list.
 
9:08 PM
Oh.
 
class foo { std::string s; int x; foo(int x) : s("Hello"), x(x) {} }; <- pretty much the same.
 
I wonder how that affects the prescribed initialization order.
 
It doesn't change anything.
 
Initialize base members first in the order in which they are specified, then data members, etc.
 
9:09 PM
the thing is
 
And it's an error to additionally specify s in the member initialization list?
 
I want to offer lots of control, but I also don't want to break my abstraction too much
 
@DanielTrebbien No, that overrides the value.
 
You can override it: struct foo { std::string s = "Hello"; int x; foo(int x) : x(x) {} foo(std::string s) : s(s), x(42) {} };<- valid and foo("blah") will not construct a string with "Hello".
 
9:11 PM
Makes sense
 
Hello loungey people.
 
ok
 
> Commandment 8. Honor thy shared data with an invariant, which your code may assume holds when a lock is successfully acquired and your code must make true before the lock is released.
 
what I really need is to store data between repeated renderings of the same 3D scene
 
@TonyTheLion Thanks for the nice PDF :)
@HunderingThooves Hi.
 
9:18 PM
without exposing that to the interface
 
@RMartinhoFernandes Cheer
Damn, need emotes, I'm so used to irc at this point.
 
What brings you here?
 
Nothing in particular, just figured I was bored at work and thought I would like to ask you guys a couple questions about getting into the more professional (yet non-coding side) of C++
 
fire away
preferably without involving literal fire, as that may be dangerous
 
What do you mean non-coding side? C++ is all about coding, isn't it?
 
9:23 PM
I disclaim all liabilities for burns, property damage, serious injury, or death
 
(I hope I didn't spend all this time doing it wrong.)
 
Nah, I meant the testing / communal coding aspects of it (checking out / in files, etc.)
 
@RMartinhoFernandes I often use it for building houses, personally. And setting things on fire. Mmmm, fire.
 
Oh, that's coding in general. That's fine too.
I haven't seen any questions yet, though ;)
 
Well, I think I just need a specific overview of programs / things that I need to look into rMartinho, as I have absolutely 0 experience with stuff like that.
 
9:26 PM
Hmm, okay. I use Mercurial for source control. There's a neat tutorial here: hginit.com, written by Joel.
 
trust me
losing all your source when you leave a hard drive in another town is a bitch
 
I don't like Mercurial. It is very slow for me and I don't like that it creates a humongous number of hidden files for large projects.
I like git much better.
 
Also: What are CVS / SVN? I know I've seen the acronyms tossed around a lot, but I wasn't really sure.
 
oh wait
 
Those are other source control systems.
 
9:28 PM
here was me about to be massively sarcastic
but note to self: Daniel != Hundering
 
CVS is known to make good programmers cry.
 
Older ones. CVS is very old, and not very recommendable. SVN (aka Subversion) was created to fix flaws in it.
And it did good.
 
SVN / Subversion is a newer replacement for CVS.
A lot of developers like Subversion--initially--because it is a better-supported VCS.
Tools like TortoiseSVN are nice to use when starting off.
 
@RMartinhoFernandes No probs :)
 
Companies also seem to prefer Subversion and other central-server VCSs because it is much easier for the IT Department to back up the source repositories.
 
9:32 PM
(Though that's debatable.)
 
@DanielTrebbien So far I've been recommended Git / Mercurial / Tortoise... what tends to be most used in the industry? I don't mind learning how to use / navigate a bunch of different stuff, but for now I just want a bit of practice on something practical.
And I just don't know where to start with cvs / svn / vcs / etc....
 
VCS is "version control system". It's what all of these things are.
 
@HunderingThooves Tortoise is just a front for Mercurial, I believe
 
There's TortoiseHg and TortoiseSVN.
TortoiseSVN was the original.
 
Tortoise is a set of popular Windows Explorer extensions for VCSes.
@DanielTrebbien TortoiseGit too!
 
9:33 PM
TortoiseHg (for Mercurial) forked TortoiseSVN.
 
oh, I didn't know there was anything except TortoiseHg
 
Did that project finally get off the ground?
 
but it's not actually it's own VCS
it's just a GUI / shell extension thing
 
For git, the git gui and gitk tools are usually sufficient.
 
And TortoiseBzr!
TortoiseX frontends are very popular.
 
9:34 PM
and TortoiseRabbit!
 
I heard rumours that the Rabbit part was too slow though
 
RabbitVCS?
Never heard of TortoiseRabbit.
 
@DeadMG Were you aware of RabbitVCS?
 
no
it was a lame joke
just leave it and let it be lame independently
 
9:36 PM
But back to your original question, @HunderingThooves, these are all version control systems (VCSs).
 
You can also find people using the Microsoft tools: Visual Source Safe and Team Foundation Server.
 
VCSs come in two varieties: distributed and centralized/central-server.
TFS and Perforce are commonly used in business.
 
VSS sucks balls, and TFS is somewhat decent, but far from exceptional.
 
Okay, see... this is why I have always shy'd away from this topic...
Everything seems to have about 20 different names and 8 competing technologies.
 
Distributed VCSs include: git, Mercurial, Bazaar, Darcs, Fossil, ...
 
9:38 PM
That noone can seem to agree upon.
 
Yeah, there's a bazillion.
Pick one, try it.
 
Central-server VCSs include: Subversion, CVS, Perforce, ...
 
@HunderingThooves That usually suggests that they're all perfectly servicable.
unlike, say, Visual SourceSafe, which everyone agrees sucks
 
Well, in fairness, when you see 20 products doing the same thing, that typically means that 17 of them suck.
 
9:40 PM
Visual SourceSafe would be much better then what we use
 
And what would that be? E-mail?
 
MKS SourceIntegrity
 
(Yes, I've heard rumours of people using e-mail instead of source control. I don't want to dwell much on it. It's scary.)
 
the client was written in dodgy java
the server is flaky
 
Ew. Dodgy Java.
 
9:41 PM
@MatthewScouten Does the vendor recommend running a weekly script to check for repository corruption?
Microsoft recommends that for VSS.
 
no i don'e think so
 
@HunderingThooves: A good reference to get started with using Subversion is the Subversion book: svnbook.red-bean.com
But I highly recommend a distributed VCS.
 
What can be better than a VCS that acknowledges it will lose your code?
 
we haven't had trouble with repo coruption, just an interface that was carefully designed to maximize the chances of a merge error.
 
Distributed VCSes excel at merges.
Git has an insanely powerful merge engine.
I love that they have a kind of merge they call "octopus".
 
9:44 PM
I know. my sub team uses hg whan we can get away with it.
 
So then I'm tempted to do something like Mercurial + tortoiseHG, does this sound like a reasonable idea?
 
Just to make sure, you're running Windows, right?
 
user457812
Woo, I got the go-ahead on doing a project for my Touchpad for class
 
user457812
And afterward I'll end up doing a sort of presentation on it.
 
Depending on the size of your dev team, you can use BitBucket to host private repos for free.
 
9:47 PM
MKS SourceIntegrity is basically like someone described source control to a martian who had never programmed. The martian outsourced the work to pluto
 
Wow.
Now, if they add the ability to do pull requests to GitHub repos, I'm ditching GitHub for good.
 
They do.
Read the blog post.
 
@RMartinhoFernandes Yes I am running windows
 
In that case, that sounds good.
Get cracking :)
 
9:51 PM
Hahahaha, word.
 
@DanielTrebbien Wait, maybe you misunderstood me. I meant, I do a pull request from my BitBucket git repo to someone GitHub repo.
 
Just for the sake of "workplace" type thing, should I host the mercurial / tortiseHG on one computer and try to connect via laptop?
 
I'm not talking about importing here.
 
Oh! I see.
Probably not, but conceivably one could write a script to sync the pull request systems of the two sites.
 
@HunderingThooves Well, hosting a mercurial repo is as simple as sharing a folder.
Alternatively you can use a cloud hosting service, like the aforementioned BitBucket.
 
9:53 PM
@RMartinhoFernandes We shall see. I will gloriously snatch defeat from the jaws of victory.
 
Come to think of it, there is a GitHub API.
 
@DanielTrebbien That sounds feasible.
 
Maybe combined with a post-commit hook.
 
Alright gents, I'm off for now, thanks for the pointers. Waves
 
I've been willing to ditch GitHub since the "Zed Shaw incident".
@HunderingThooves Bye. Have fun.
 
9:55 PM
@HunderingThooves Bye
 
I will try, You'll see me later like "Damnit this thing doesn't work right" hahahahaha, be well and thanks all.
 
@RMartinhoFernandes The most recent one? I thought that GitHub responded very quickly and fixed the system.
 
I bought this a while ago. Today I decided to watch them all again. After the second one I remembered the rest sucks :(
 
Chris Wanstrath wrote the blog post about it, I believe.
 
9:57 PM
I'm back
Fear me
 

« first day (352 days earlier)      last day (4599 days later) »