« first day (413 days earlier)      last day (4536 days later) » 

3:00 AM
That looks ugly as fuck.
 
it's automatically generated
who cares?
 
seriously, when did design patterns become so evil? I was out of the loop for like 10 years and came back to this. I still have the GoF book on my shelf. It totally made sense at the time.
 
@DeadMG What's the c?
 
CompilerContext* c
I'll use it to hold, e.g., types which are specified literally
actually, it would be better if the CompilerContext did the loading of DLLs and such to keep them more centralized, then I can cache them and shit
but I'd still have to be casting them in ugly ways
 
@RMartinhoFernandes sorry, dumb question (no habla Portugese), but I've been wondering: is it pronounced (roughly) mar-TEEN-yo?
 
3:08 AM
@keithlayne design patterns aren't evil. abusing them, however, is -- and abuse is rampant
 
@keithlayne I don't think you English speakers can pronounce "nh" correctly (I'm speaking from experience with people that heard me explaining how to pronounce it), so you can go with that :)
It's close enough.
 
everybody and their monkey wants to use a singleton for something
cause it's one of the few patterns they understand
 
@cHao my reading of design patterns is an attempt to codify best practices that we run into time and again while programming. I think the book says (paraphrased) that software "engineering" will never be a real engineering discipline due to the fact that there is a lack (and maybe always will be) of "book" answers to common problems.
but I would call RAII and a lot of the other things that are talked about here "design patterns" by that definition.
 
as would i
 
@RMartinhoFernandes thanks, I'm just a dumb tongue-tied Merkin, right?
 
Xeo
3:11 AM
Omg
 
singleton
 
it's OK
when it's in a three-way
 
Xeo
I just hunted down a very strange bug
I would insert an item into an unordered_map, and retrieve it with the same key. Strangely, mymap.find(the_key) returned mymap.end().
 
@keithlayne Well, I wouldn't mind explaining it to you, but there's no such sound in English, and I don't know IPA.
 
did "dependency injection" ever get a foothold in C++?
 
3:13 AM
as for "best practices"...if that's the case, why is Singleton given so much credence? it's probably one of the worst "best practices" i've ever seen
 
@RMartinhoFernandes well, I know my name gives a lot of people in the world fits.
 
Singletons are not "best practice"
they're popular because they make life non-OO and therefore easy
until you come to maintain it, anyway
 
exactly.
it probably shouldn't have been in the book, imo.
 
@cHao it makes me want to go read the book again and see if it's not worth tossing
or at least selling on ebay or something
 
Xeo
The cause: I "optimized" some string construction (the key) where I knew the size of the string. this meant that the insert string was a different one than the find string (insert without the trailing \0, find with). they were showing as the same values in the debugger...
 
3:15 AM
iirc, the book itself is not that bad -- aside from giving patterns names that no one would ever use if it weren't for the book
i mean, "visitor"?
 
@Xeo that sucks, at least you found it
 
lol
 
@cHao I remember learning about that in school around the time that the book was first published...made little sense to me at the time. Still makes little sense to me.
 
hate \0 termination
 
Xeo
@keithlayne Yeah, but only because I stepped into the hasher of the map and found that the walk through the string was 3 steps for the first (insert) and 4 steps for the second (find) string
 
3:17 AM
it's how the book ended up interpreted that sucks imo
 
It's called visitor because it visits.
What else?
 
@Xeo unordered_map?
 
Xeo
@DeadMG leading size before the string would be better, built-in std::string so to speak
@keithlayne yep
In a normal map I think it wouldn't have mattered
because those test for equality by lexical comparision
 
See, not having fully jumped into c++11, I wouldn't have had that problem
@Xeo or....it could have been even harder to find if it broke
 
Xeo
Yeah
 
3:18 AM
I think they still fall back to operator== to determine final equality
and that should return false if one of the strings has a null on the end and the other doesn't
 
@keithlayne It's a hash map.
 
including unordered variants seems like it might bring up the whole "hash and equals" crap like from the java guys
 
The committee decided against naming it hash_map to prevent collision with existing implementations.
I find that silly.
 
I remember back when the STL was this SGI thing, and it was not so standard
 
I agree
if you put things in the std namespace that wasn't mandated by the Committee, you get what you ask for
 
3:22 AM
Existing implementation extensions should have their own namespaces.
 
hash_map was not in the std namespace for many versions of g++
 
Xeo
It doesn't belong there
 
Well, I assume at least some implementations had them in std.
 
Xeo
MSVC has an stdext namespace IIRC
 
which is where their hash_map lived safely
 
Xeo
3:23 AM
yeah
btw
 
Then who was the fuck that got us the untypable unordered thing?
 
Xeo
Any reasoning why all type_traits are real structs and not nice template aliases? Would save the hassle with that damn typename
 
@Xeo Wanna a copy-paste version with aliases?
Gimme a sec.
 
probably because they predate template aliases
 
Xeo
I thought of doing so myself actually. Sadly, MSVC doesn't support template aliases. :( Or aliases with using in general
 
3:25 AM
I don't think I'll be using any unordered containers unless I can't avoid it, which is hopefully never.
 
Does a memory leak count as observable behaviour?
 
I'd say yes
 
I think so
 
Xeo
Depends. Does the destructor print anything? :P
 
No.
Trivial destructor.
 
3:26 AM
well, actually, I'm pretty sure it does
 
Xeo
so it also doesn't change any external state
 
because if you keep leaking memory, eventually dynamic allocation will fail
 
Nothing ever accesses the memory.
 
that's not what would have happened if you didn't leak it
 
3:27 AM
@DeadMG Is it required to fail at a precise point?
 
Xeo
Then it's not really observable. :P
 
I don't see a problem with it failing a bit later.
 
Xeo
Why do you ask?
 
no, but your program most certainly can observe the difference between it failing and not failing
 
Heisenberg says yes.
 
3:27 AM
If I write new int; somewhere.
And the compiler cuts it away, will I notice?
 
well, if you ran it in a tight loop waiting for bad_alloc to be thrown
then you would
 
Xeo
@RMartinhoFernandes Oooh, constexpr functions, totally forgot about those for the ::value
@RMartinhoFernandes The question is: Why would you? :P
 
@DeadMG What makes an infinite loop not valid?
@Xeo I answered a silly question.
 
because eventually, bad_alloc would get thrown if you included it
and it won't if you cut it
 
1
A: Pointer or Value in my case?

R. Martinho FernandesThere is only one way to know, which is by measuring. Since you never actually use any of the values you assign, a compiler could, under the "as-if rule" simply optimize both functions down to: bool example1() { return true; } bool example2() { return true; } That would a perfectly val...

 
3:29 AM
that is, the version with new int is not infinite
merely ridiculously long-running, as it were
 
@DeadMG Must it? Can't the implementation fake infinite memory?
Is that forbidden?
 
Xeo
Pedantism at its finest - where is my popcorn?
 
I believe that the Standard accepts that limits like memory do exist
that's what bad_alloc is for
 
What about garbage collected implementations? Aren't those allowed now?
 
indeed they are
however, certainly for a non-collecting implementation, then leaking memory is observable behaviour
for a collecting implementation, it might not be
as the collector will nosh it up
 
3:31 AM
Observable behaviour is defined in terms of the abstract machine.
Your implementation is free to give extra guarantees though.
 
I'm pretty sure that the abstract machine is not defined to have infinite memory
 
But can be garbage collected.
It doesn't require while(new int); to halt.
 
yes
but as long as your implementation isn't collected
 
Xeo
Hm. Can it be that output to standard output doesn't count as "observable behaviour"?
 
that certainly does
 
3:34 AM
@DeadMG Ok, I was checking if some implementation was allowed to discard a stray new int;.
 
ah
in that case, then some implementation might well be allowed to discard it
 
Xeo
Omg, llvm + clang is still building... since... like... 1h or so?!
 
Then vote me up bitches.
Neat, he edited the question to introduce output.
So I edited my answer to discard the allocation and produce the output.
It's a race!
 
condition
you need to nerf the concurrency
 
Xeo
4:00 AM
hm
> // Exclusive ownership pointer that treats the pointee with value semantics
> value_ptr(value_ptr const& that) : p(that.p ? new T(*that.p) : nullptr) {}
That's not very exclusive unless I missed something
Oh, wait
 
@Xeo Could be bugged. I slapped together that for something that was scraped.
So, no testing.
 
Xeo
actually, what is the use of a value_ptr that is copyable? Could just aswell have a plain object around and avoid heap alloc
 
Xeo
xD
 
@Xeo Now that I think of it, I think that was for PIMPL.
 
Xeo
4:05 AM
Great. Inmidst the clang build the vbox crashed.
 
Never used it though.
 
Xeo
phew, just executing make from within the build/tools/clang dir seems to continue the build
 
gotta love make
 
Xeo
If anything is fucked up, it's back to compiling llvm + clang, aka 2hrs wait time -.-"
 
still can't believe llvm doesn't come with a linker
 
Xeo
4:12 AM
too bad ld doesn't work for windows, eh? :P
 
does it not work with mingw? Does gold only do ELF binaries or something?
 
I'm pretty sure MinGW uses something called ld.exe.
 
Are you guys all using windows most of the time? How do you afford VS? Or do you get it from your school or what?
 
@keithlayne It's free.
But I get it from school.
But I don't use it.
 
it's free now? boy do I feel old.
 
Xeo
4:21 AM
VS Express is free
 
Xeo
But I get Ultimate from school
 
The Express versions are.
 
The last vs product I actually bought was VJ++, at least that's what I think it was called. Beat that.
Can I use the VS10 express toolchain with VS08? Knowing MS, I'm sure the express IDE is gimped somehow.
I want the C++11 features (I know they had the tr1 stuff before)
 
No idea.
If you want hardcore C++11 (like, variadic templates) you're better off with GCC or clang.
 
4:23 AM
anybody remember sourcesafe? Does that still exist?
 
Sadly, yes, it still exists.
The place where I worked still used it in some projects.
 
I'm still easing into c++11...a good example of how reading about something for a few years doesn't make it easy to use immediately
 
But they were in the process of "migrating" to TFS.
 
As in, there are still new versions coming out? In ~2000, it seemed almost abandoned
Team Fortress Server?
 
No, it's been replaced by TFS. But that doesn't mean it's gone.
@keithlayne Team Foundation Server.
 
4:25 AM
I like my version better
 
VSS is like the IE6 of version control.
 
wow, and I get annoyed when people argue about vcs...svn, or cvs for that matter, work for me pretty well in many situations
 
Xeo
 
I remember when cvs was "new", and people still used rcs a lot
 
Xeo
Touhou OST with epic vocals, me likes
 
4:27 AM
@keithlayne lol
 
I guess at least I learned about vcs early on, thankfully. Even if you use a local repo, it makes things way better.
 
I was really annoyed that it was never ever mentioned in university.
 
I'm still pissed that you kids are orders of magnitude ahead of where I was at your age...fucking interwebs.
Ha, at least I have that over you.
 
I introduced a bunch of classmates to it.
 
@RMartinhoFernandes you said you're doing a graduate degree (or whatever your equivalent is), right?
 
4:29 AM
Yep.
 
"Informatics" of some kind?
 
the school I'm going back to has renamed everything "informatic" something or other
what happened to CS? I'm no math superstar, but I grasp the fundamentals.
I guess it's just not sexy anymore.
 
In Portuguese, "informatics" (well, the equivalent) has always bee then common term for computer stuff.
 
Xeo
Same for german
 
4:32 AM
At this school there is a brand new building for the "motorsports" school
makes me alternately rofl and want to throw up
 
What.
The what school.
 
NASCAR is really big here, it's really probably an awesome mech eng funtime, but sounds retarded when you call it "motorsports"
 
That is true. Though I must admit, NASCAR is my favorite sport, at least there's some practical reason for it.
 
I just don't see granting a degree for what amounts to "I can fuck with a database in VB"
 
That seems pretty common nowadays.
 
4:35 AM
@jozefg WTF bro? I like driving fast too, but I can't watch it. But wrecks are fun.
 
Driving fast scares me.
 
Ha, roads are wider in the US
 
@keithlayne Hey I just can't watch people kick a ball for millions of dollars, it pisses me off
 
lol
I don't need to make an effort to stay under the speed limits, I need to make an effort to cross them. And I don't care about speed limits, I think they're stupid.
 
@jozefg I totally believe it takes a lot of skill, but I can't watch it. Without lots of beer, anyway.
 
Xeo
4:37 AM
@jozefg A soulmate in that regard!
 
I've been places where the drivers were crazy to me. I always was on the verge of pissing my pants.
 
@keithlayne everythings better with beer, except when you write shell scripts cause then bad stuff happens
 
rm -rf /*
 
@keithlayne Isn't that like everywhere?
 
oops
 
4:38 AM
@keithlayne Doesn't work.
 
I think driving here is pretty sane most of the time
 
Maybe my insanity threshold for drivers is too low.
 
haha on a c++ related note, anyone know any good libraries for makin an excel spreadsheet?
 
where my wife's from the laws apparently say that pedestrians not only don't have the right of way, but if you get hit by a car (common occurence) the pedestrian is liable for damages to the vehicle.
 
@keithlayne What?
That's totally retarded.
 
4:40 AM
@RMartinhoFernandes she wasn't born in the US
 
You wanna break a guys spine then make him pay for the dented fender?
 
and roger
 
thats... harsh
 
she has scars...
@RMartinhoFernandes she's from a retarded place
 
4:42 AM
...and it's in Europe. I'm just sayin'...
 
:(
Well, I find most drivers here are indeed retarded, so...
 
@jozefg are you on windows? doesn't that stuff pretty much come for free? Some COM crap or something?
She's from the other side of Europe
 
One thing that constantly annoys me is that if I try to keep a safe distance from the guy ahead of me, there's always some jerk from behind that thinks I'm trying to make space for him, and overruns and uses my safety distance.
 
@RMartinhoFernandes which side of the road do they drive on in Portugal?
 
@keithlayne Right.
 
4:44 AM
Is it just england thats left?
 
@RMartinhoFernandes ah, I think that's a global constant behavior
 
Fucking nobody keeps a safe distance.
Then you get news about chain collisions.
I wonder why.
 
Yeah, it's funny, when I was in the army I drove kinda like a maniac, but only in military vehicles
Like, I would behave opposite of normal, never wear a seatbelt, drive right down the middle of the road...
BTW, I am officially a civilian as of last week, so now I can legally be a pacifist
I need to change my little icon thingy
and I can legally talk shit about the president if I feel like it. So empowering!
 
@keithlayne That sounds crazy.
 
@keithlayne Haha congrats man
 
4:48 AM
It surprises a lot of Americans to know that our military falls under a completely different set of laws (much more restrictive) than the rest of the populace.
 
Yeah i didn't know that till recently actually... i felt dumb
 
@jozefg thanks man....you must be from the states if you like NASCAR :)
 
Is military service mandatory there?
 
don't feel dumb
 
@keithlayne Yeah, only Merkins like that :P
 
4:49 AM
@RMartinhoFernandes no, I sometimes wonder if it would be better that way
 
@keithlayne Why?
 
in the '70s we changed to an all-volunteer force...and it scared the shit out of the generals
everyone feels like they have a say, but so few have served
we don't have a necessity to make federal (or just military) service mandatory, the US kind of brags about how we're all volunteers
@RMartinhoFernandes I say again, I am not some kind of pubic hairpiece :)
 
But what it would help making it mandatory?
 
USA pride haha i don't have a lot of experience with military politics though so i can't talk i feel like mandatory wouldn't be bad. They have it in Israel i know...
 
it would make more people understand the military, and maybe be less willing to throw us around like their bitches
IMO Israel would be screwed otherwise, at least from their perspective
 
4:54 AM
Yeah thats true, I have friends there who work in engineering, they said they almost exclusively have to work on defense stuff...
 
I don't necessarily believe mandatory service would be better, but maybe some kind of mandatory federal service. But our gov't is arguably already bloated, and it would cost bajillions that we don't have
@jozefg where you from (if you don't mind the question)?
 
Im from the midwest. yourself?
 
charlotte
but spent about 9 years in the army, all in el paso (or other desert-like places)
 
bit warmer then my climate
 
but from TN originally
...and I don't love NASCAR, I guess I'm a little weird
 
4:57 AM
why'd you join the miltary?
Haha i just said it was my fav sport, doesn't mean i like it all that much
 
well, I needed a job...I had quit school (a good one too, I'm a dumbass) about a semester before graduation, and was programming, but got fired because I couldn't show up to work, and then re-hired because I'm a badass, but I still had problems and left that too.
the army cures insomnia with harsh punishment
 

« first day (413 days earlier)      last day (4536 days later) »