« first day (91 days earlier)      last day (4859 days later) » 

4:00 PM
what
"For integral types, there shall be an addition operator. The result of invoking this operator is undefined."
 
And then we will have like 10 normal questions on SO and 990 faqs, because people will constantly fall into the same traps over and over.
 
lol
I was actually thinking of making exception specifications
but the default is throw(...)
and violating them is UB
and they're checked by the compiler like Java's checked exceptions
 
@DeadMG I don't like Java's checked exceptions, they hinder writing generic code.
 
template{type T} void func() throw(T) {}
 
@DeadMG What if zero or more than 1 exceptions may be thrown?
 
4:04 PM
uh, T...?
C++0x already has variadic templates
template{type... T} void func() throw(T...) {}
 
Then every generic library function needs a throw T... specification. Sounds terrible.
 
not really
because the default is throw(...)
whereas in Java, the default is throw()
 
Are there any real-world cases where exception specifications significantly improve the quality of code?
 
i thought throw(T...); was valid
 
to be entirely honest
I think that about const, but ask sbi and it's a send from God
so if you ask me, exceptions are another part of the interface and I should provide compile-time verification of them
just like I provide constraints for types
well
"provide" as in, "whenever I get around to actually implementing anything"
 
4:07 PM
but throw(T...) is deprecated anyway if T isn't empty
 
not talking about C++0x
 
I wonder about the ratio imp/des, where des is the number of programming languages designed and imp is the number of programming languages implemented...
 
yeah
I know
but hey, I'm a student, if it never sees the light of day, who cares? good learning experience
 
I would like to see an imperative language that has a better grasp on side effects.
 
what do you mean?
 
4:09 PM
what does it mean?
 
For example, I would like to be able to annotate (and have checked by the compiler) that a given function has no side effects, for example sqrt.
 
you mean like the "pure" specifier in D?
 
And "deeply immutable" objects, a.k.a. "user defined values".
 
first i thought you wrote a :D smily at the end xD
 
lol
you mean like literals?
 
4:11 PM
@DeadMG Yes, but that does not go far enough. A pure function in D can return a different array every time it is called.
 
really? how/
oh
"pure" meaning "pure except the garbage collector" then
 
a pure function only depends on its function arguments
so if you give it a different argument every time it could potentially return a different array everytime
 
@DeadMG If I say MyValue x = select MyValue(3, 4, 5), then no operation on x has any side effects whatsoever. I can only change x by assigning a different value.
 
in my own imaginary language of course
 
so you mean
no ++, +=, etc?
or what?
 
4:13 PM
@DeadMG You can change the variable x, but not the thing that it is bound to. See java.lang.Integer and co.
 
right
so like a shared_ptr<const T>?
 
he means MyValue const*
 
@DeadMG somehow like that, yes.
 
I came up with a genius idea
type deducing constraints
so that instead of having to use typedefs everywhere, like in STL containers
the constraint can deduce them
template { constraint {
    Iterable{int} iterator begin() const;
} container } void func(container c) {
    iterator i = container.begin();
}
no multi-level code?
 
Multi
Level!
 
4:17 PM
how did you do that?
 
four
spaces
in front of every line
 
there we go
 
shift enter
is your friend
 
what do you think?
 
4:19 PM
I haven't grasped the concept yet. And your strangely formatted example does not help :(
 
yeah
I swapped <> for {}
as it would be much easier to parse since {} are not actually involved in any operators or anything like that
 
you made int a container?
that is what c++ concepts were for.
 
no
 
Hm, given a choice between going out and buying groceries in the next couple of hours or staying in SO chat and starving over the weekend, what would you choose?
 
concepts allowed to say Container::iterator i = begin(c);
one could pervertly make "int" an iterator
 
4:23 PM
How is the function begin(c) defined? Generic template that forwards to c.begin() and specialized for non-classes, I suppose?
 
I'd buy groceries, personally
starving not fun
I didn't make int an iterator- int is the argument to the Iterable constraint
 
@FredOverflow dunno exactly anymore. I think it'S by way of concept maps
 
that is
I define a constraint which has a function called begin that returns a type that is constrained by the constraint Iterable{int} and that type shall be called iterator and I shall call a type which passes this constraint "container"
 
Sorry, I don't get it. Do you have a manual I can read?
 
as in, your concept would look something like template<typename T> auto concept Container { typename iterator; iterator begin(T &); iterator end(T&); }; and then when you write template<Container C> void f(C c) { ... } and pass an array for example, it will look up whether there is a "begin" and "end" function that both return the same type and that take the array type
 
4:28 PM
only if you can read my brain
 
if the concept wouldn't be "auto", you would have to write a concept map yourself that defines begin / end. lookup for proper begin/end isn't done automatically then. i think that was roughly the way it works
 
thing is, it's really not complex, but I made all these changes in my head without writing them down
it would be clearer if I hadn't written it all inline
whoops
didn't mean to push enter :(
 
@FredOverflow it's all in n2914
lol
 
Can I post pictures here? Test:
Wanna guess what sorting algorithm that is? :-)
 
abbacus sort?
can't tell without a scale on the x and y axis
 
4:32 PM
It started with a random permutation of numbers 0-99 and what you see is close to the end.
 
oh
quicksort, it looks like
 
it seems to have a weird pattern
 
@DeadMG It's not quicksort
@JohannesSchaublitb It's not DNA sort ;-)
 
i think it'S shellsort
 
@JohannesSchaublitb We have a winner!
 
4:34 PM
lol
it's step 2. you can see it goes up and down :)
 
I was also thinking of template type parameters
like in C++, you can have
template<template<typename T> class X>
in addition I was thinking of doing
template<class X<typename T>>
 
Okay, another one. Which sorting algorithm is this?
 
it's barely started at all
 
Au contraire, it's already half-way through :)
10 elements are already at their final position.
 
that's got to be bubblesort
 
4:42 PM
No, that looks less structured
(Note how "dense" the elements are in the upper left? There's a reason for that.)
 
yeah
it's a cone of elements
 
@DeadMG Exactly.
 
except for the part where there's two elements in one index
 
Where? That must be an animation error.
 
top left
 
4:44 PM
It's a shot from a program of mine where the movements are animated smoothly.
 
there's a group of four, another group of four, then there's one above a line of three
but if you look at the one and compare it to the gap between the ones beneath it, the gap is way too small
 
gang of four!
 
As I said, animation.
@JohannesSchaublitb That's not a sorting algorithm.
 
bug
 
4:45 PM
man
the hell did you guys start asking me about DeadMG++ for? now I totally stopped coding on my engine :(
 
@DeadMG No, you can play with it for yourself, if you like: uploaded.to/file/i23vkm
 
no thanks
 
And then you will discover it is heapsort.
 
@JohannesSchaublitb Will you download and try my program? :)
 
4:48 PM
what if it has a virus?
 
@DeadMG then he should not download and try it, obviously.
 
lol
 
i'm afraid it contains a virus and deletes all my porn
 
Actually, it generates porn.
 
4:49 PM
wait
why would I need to download Google? it's already on the web
 
I always get very aroused when I see sorting algorithms in action.
@DeadMG I don't get it.
 
nevermind
I guess it's just above you
 
@DeadMG Yeah, just like LISP...
 
lol
 
4:51 PM
@JohannesSchaublitb OMG multiple orgasms!
 
sadly it doesn't seem to have teh pixel views
 
I must say graphically, shellsort is my favorite. I don't care it's slower than quicksort :)
 
bubble sort looks really boring and takes ages.
 
sleepy
 
4:57 PM
i want to add that you can write "struct :base { };" to the hidden-features-of-c++ question. but it's locked :(
 
Okay, last picture of today, this one is easy:
 
strand sort
rofl
 
lol
it'S beach sort
 
merge or quick sort
 
Ah, you mean "strand" like "string". That's funny.
 
4:59 PM
definitely not quicksort
 
@JohannesSchaublitb Right, not quicksort.
And DeadMG is also right :)
So what can we deduce with boolean algebra?
 
that you suck
 
great. it took a 50/50 joker and one wise @DeadMG
 
eh
heh
 
5:01 PM
If I ever have a company, that will be one of my test questions. Map screenshots to the corresponding sorting algorithms. (But I won't hire @DeadMG, he's too mean.)
 
why? nobody is expected to know them by screenshot
 
Expected interview questions are boring.
 
i like this sort of interview questions
 
lol
not only am I not to be expected to be able to match them, but it's got about the benefit of an underendowed titmouse
 
we should have a !sortquestion bot in here, showing a new pic each time xD
 
5:03 PM
Oh and @Johannes can join instantly, he would only reveal awkward errors in my test questions, anyway.
 
i would do so only for the folks being interviewed that i don't want to have in the company
 
@JohannesSchaublitb Why are you inviting them for an interview then, if you don't want them in your company in the first place?
 
for the others i would stay silent so they can spot the mistake and be praised by you xD
nono i'm assuming you will be my boss
 
@JohannesSchaublitb I see :)
Your first assignment is to write a "write a compile-time sort function" interview test ;-)
 
5:08 PM
Hm, Gießen is too far away. Are you willing to std::move? ;)
Oh wait, we could just collaborate via Internet.
 
right. teh internet will do it
 
@FredO: Bugger off are you going to hire me
I'll be hiring your ass
well
you'll wish I was
 
but I won't be
 
5:28 PM
@DeadMG I will hire you as soon as you have completed your compiler and I am convinced that the language it implements is better than C++.
 
lol
I'll hold you to that :P
 
If I ever have a company, mind you. I highly doubt it. But you never know...
 
5:41 PM
ugh
my brain feels like someone scooped it out and replaced it with concrete
 
@JohannesSchaublitb Die Biologie-Sektion auf Deiner Webseite bedarf aber mal eines Updates ;-)
 
@Konrad ja, ich glaube die sollte ich mal überarbeiten oder ganz wegmachen :)
it's soon over 5 years old xD
also, I don't think anymore that "i'm not an atheist". What I am is actually an agnostic atheist, as I say on atheism.stackexchange.com/users/29/johannes-schaub-litb :)
thanks for the video. I'll fav it xD
 
@Johannes: you'll like Pascal's wager, then. can you spot his error?
 
This Mischmasch of Deutsch and Englisch makes mich crazy.
5
 
@Alf yeah I read wiki on it :)
 
5:48 PM
@Johannes: i'm going out to buy some groceries.
 
@JohannesSchaublitb oh, didn't know about the irc channel. Will start to frequent there.
 
he's a black/white world. I don't like black/white worlds. world is like a rainbow
 
@Alf have fun :)
 
5:50 PM
silly me i'm not gone yet. what's difference between chemical and physical romance?
 
@jweyrich ohh great
@Alf i'm totally unromantic. so I guess I can't help :(
 
well it was just a random thought. i think chemical romance is a band, and physical romance possibly a band-aid.
3
no! i'm going shopping
 
@AlfPSteinbach Well played!
 
6:22 PM
Please help support my new proposal: area51.stackexchange.com/proposals/11464/…
 
sbi
@Konrad See my comment to Jeff's answer.
 
@sbi Yea … let’s see how this turns out. In my experience, Jeff’s initial comments are always very defensive. This doesn’t mean it won’t be improved.
 
sbi
@FredOverflow Between you, @Johannes, @Konrad, and me, German is often the most dominant first language of the users here, so let's just switch zu deutsch und be done with es.
@KonradRudolph Yep. Let's hope...
 
@sbi So when is the first German Stack Exchange User Group meeting? In Berlin, of course. After all, @balpha’s here, too.
 
sbi
@KonradRudolph Oh, balpha's German?
Wow, yeah, and a Berliner, too!
 
6:33 PM
I fully support that comment sbi
often find myself falling short
well
more like falling foul
 
sbi
@KonradRudolph It's a great idea, although I would need to unveil my identity to some of you. :(
 
yeah
I was going to support RobertPitt's proposal
but in order to commit
oh no, my real name
 
sbi
@DeadMG You might want to read my last comment to the question.
 
@sbi nah, just your face, not your identity :P
 
yeah
I saw that too :P
 
sbi
6:35 PM
@DeadMG Is that true?
 
why yes, it is
 
@DeadMG just tell area 51 you're "fred nurk", they don't check
 
lol
 
sbi
You have to give a proper ID for supporting a SE site proposal?
 
will do
oh wait, you must wait five seconds to perform this action
one second my arse#
 
sbi
6:36 PM
@FredNurk For some of us... :)
 
@sbi: they ask for your real name to prompt you to feel obligated to the commitment
 
wtf
my Google account is new to Area 51?
all the other SE sites are linked and I didn't have to reregister
 
@sbi so you're saying you're a celebrity? (;
 
sbi
@FredNurk But it's never publicly visible, is it? ("They" do know my name from the email address I'm using.)
@FredNurk That's one way this would play out.
 
well "Fred Nurk", you are now committed
 
6:38 PM
@sbi correct
 
by the way
don't suppose anyone knows the rules of how shared_ptr constructs from a unique_ptr?
I never used that before but discovered that I need to take a shared_ptr to an object I have a unique_ptr to
 
sbi
@FredNurk Ah, well. Anyway, I won't be supporting this one. As I said yesterday, this needs real commit from people who actually can review code (as opposed to only those in need of review). And I don't feel like I have enough time/willpower at hand to do that.
 
you know, I've been thinking about the anti-flooding thing
I guess Jeff could accurately argue that I really should post larger chunks
less often
just looking at my screen and I really do take up way more of it than anyone else
 
@sbi just commented on Jeff's answer too.
 
sbi
@jweyrich Relaxing based on rep is a very good idea! (Says me with 40k.)
 
6:46 PM
@sbi lol!
 
lol
is it a mistake to design an API for future proofing?
I found myself with a bunch of CommitChanges() methods that don't do anything in the current implementation
but might be useful at some ineffable future point
 
@DeadMG Keep It Simple Stupid.
 
I'm not stupid :(
 
@DeadMG not you. The it.
 
right
don't get it :P
 
6:51 PM
I used to create methods or functions that I was planning to introduce in a near future, but then I looked back to some of my sourcecodes and found various "TODO implement this", or even "This is a temporary workaround. Fix it later." (note: 5 years later).
 
lol
well, the trouble is that some of my existing classes need them currently
and I know that new implementations will need some in the future
but I'm just not sure about the rest
 
I learned one important thing (which I not always follow) during my professional experience -> Make it work first. Improve later.
 
it already works
well
to be more accurate
I have no deadline and can spend however long I like on improving it
 
@DeadMG Doesn't shared_ptr have a constructor taking unique_ptr?
 
indeed it does, I'm just unsure of the semantics involved
 
6:53 PM
ownership transfer
 
@DeadMG ah, go for it then. I wouldn't bother if the implementation stays empty unless the result is compromised.
 
ok
 
getting ownership back from shared_ptr collection is more hack-like though
 
nah
I don't need that
when the user gives me back the unique_ptr I gave them, then I know for a fact that I'm OK to share ownership until they choose to take it away again
 
of course the first german meeting is in frankfurt
lol
 
sbi
6:56 PM
@JohannesSchaublitb And why would that be?
 
for lunch u can choose between frankfurters, berliner (bolls?) and hamburgers
 
because frankfurt was the city where the committee took out concepts!
lol @Alf
 
ich bin ein hamburger
 
lol
nom nom frankfurters#
ok, new question
std::function<> or interface inheritance for callbacks
 

« first day (91 days earlier)      last day (4859 days later) »