« first day (982 days earlier)      last day (3952 days later) » 

1:00 PM
@BartekBanachewicz The phone is not the biggest problem. The chat interface is crap. And the full interface doesn't work much better either.
 
@R.MartinhoFernandes you gotta get used to it.
 
Someone has downvoted the question that I have posted more than a month, lolz
 
Doesn't make it any better.
 
but I agree that in this particular example an app would be better
 
JBL
My current mental state : "For the C++ is dark and full of terrors".
 
1:01 PM
Ugh, std::function arguments.
 
again with that "unnecessary type erasure" ? :F
 
You are even using it in a template...
 
I don't know why I keep doing that
it just seems intuitive
 
> typedef boost::function<void(const Ctl4xxDataExt::fft_t&)> FUNCTYPE_ONFFTDATA;
 
And in every other language, like Lua for example, it is.
 
1:03 PM
let me pass FUNCTYPE_ONFFTDATAs into callback registration functions and leave me alone
 
Tomalak to the rescue.
 
@LightnessRacesinOrbit lol
 
sbi
Wow. @GMan reappeared in the lounge? How did that happen?
 
Next Lounge project: better chat.
 
1:06 PM
@CatPlusPlus in Flask!
 
XMPP or bust.
 
chat is fine
I randomly upvote people - here have an upvote! — Telkitty 猫咪咪 26 mins ago
>.<
dick
 
@CatPlusPlus "Lounge project", lol
 
@LightnessRacesinOrbit flagged as not constructive
 
@LightnessRacesinOrbit :'(
 
1:09 PM
@BartekBanachewicz okay but now we don't know that the sole upvote on the question was bullshit
 
@R.MartinhoFernandes have you ever thought that Cicade could be a hot young chick?
 
@LightnessRacesinOrbit crap. let's just ban her
 
because you have never met her ...
 
I updated my answer again
It's even better
and by far the best
 
no need to try, lounge is in a bad mood today
 
1:11 PM
I don't care about down votes anymore. I updated because I think other people might want to see what a good solution is
 
Dude, move on, post other answers.
 
i have plenty of other answers on other subjects
 
sbi
@Telkitty猫咪咪 Have you ever considered that the robot could be a hot young chick?
Those who've met her might not tell just because they want to keep her to themselves.
 
@raxman needs more std::begin/end
 
@sbi OMG why am I not surprised! How could have I ignored all those signs!
 
1:13 PM
it's good now...the best answer has -11
 
But yeah, it's better now.
 
it also shows I can do C++ when I have to
 
@raxman I took my downvote off it.
 
thank you!
 
no hard feelings.
 
1:14 PM
@raxman You are so far the #2 troll in this lounge. Once I leave for the day you will be number 1.
 
Please note thought that dynamic arrays are something really fishy, and with C++14 std::begin/end will work with std::dynarray if it appears in the standard.
 
awesome
 
@BartekBanachewicz Ugh, if that thing makes it.
I hope not.
 
I hope that too.
 
I decided not to go to metalouge because I sorta of asked for it withe the Linus post. I was annoyed that people were telling me I can't blend C and C++ together.
metastackoverflow
 
1:18 PM
Gosh, metalounge
 
@raxman you can, it's just the result is rarely good.
the fact that C++ can use C doesn't mean you can start throwing unsafe C functions all over
it's mostly to ease using C libraries, but they have to be wrapped in proper abstractions before they can be sanely used
 
but if anyone cares, which probably most of you don't, I actually prefer C++ to C. Well I like C for small projects, for testing optimization and stuff. But I would never want to develop a full application in C.
Actually, I'm stuck with C# these days
most of my coworkers have moved on to C# and python now
they write some C or C++ libraries for parts that need optimization still
 
C# is nice, but I think it wouldn't mix very good with OpenGL, and the only other use I'd have for it would be tooling/GUI apps which I write like once a year
 
I use OpenTK
it works quite nicely with OpenGL
 
@raxman The project I've been working on required quite CPU-intensive computations (lots of memory)
I also use, at least still at this point, a lot of flow from CPU mem to GPU mem
 
1:21 PM
have you worked with Xeonphi?
 
@BartekBanachewicz Why wouldn't it mix very good with OpenGL?
 
@raxman Nobody was telling you that.
 
@CatPlusPlus because of buffers, mostly. You know, I can't C#, but I think C++ is better suited for raw memory manipulation I use in Minicraft.
 
telling me what?
 
@raxman nope
 
1:23 PM
Jun 13 at 13:43, by thecoshman
New here? Why not spare some heartache and read the newbie hints.
 
@BartekBanachewicz Buffers are just byte arrays.
You don't need "raw memory" anything.
Also I think structs can be layouted strictly, so you don't even have to serialise or anything.
 
I have to get some work done today. You guys have a good day. This time I mean it!
 
@CatPlusPlus my main structure is an unordered_map<Chunk>, Chunk being array<a few byte POD, n*n*n> and a bit of metadata. From it the actual geometry is constructed on demand.
 
Hell, it'd be better in C# because of attributes.
 
@raxman have a nice day too
 
1:26 PM
Self-describing buffer types.
 
@CatPlusPlus I might want to learn this C# thing over the summer.
Because for the last 6 months, I weren't able to pinpoint any particular flaw that would make it bad for what I need.
Of course I am not even going to mention stuff like "speed" or "memory usage"
 
deterministic destruction.
when you're looking to free those GPU buffers, you're going to find IDisposable a horrifically lacking hack.
 
@DeadMG aha.
so I can't tell it to destruct anything?
 
1:34 PM
you can, it's just that you have to do it in basically every place
it's really C-style malloc/free jobby.
 
can't I use RAII?
 
nope.
no RAII in C#
 
...
What would be the freaking problem to add it?
I mean it has destructors, no?
 
nope
 
1:35 PM
wait what.
 
only finalizers, which are run non-deterministically and asynchronously by the GC.
and in addition, they aren't run in any kind of order, so you can't access members or anything like that because they might have already been collected and finalized
 
Members have not been collected.
 
Java has destructors, right?
 
garbage collector
 
1:36 PM
What the fuck were they thinking.
 
What are you thinking?
 
there is no delete
 
@BartekBanachewicz they were thinking "how would a destructor coexist with a GC'ed language with non-deterministic destruction"
which is a fairly good thought
 
@R.MartinhoFernandes that GC is cool and whatever, but if I want my object to be destroyed immediately I might have a reason for it
 
I'm sorry about that flagged message
 
1:37 PM
which one?
 
@BoltClock which one now?
 
Oh the flag is dismissed. Never mind. Wasn't me.
 
as far as I'm aware, the only language that even tries to make something vaguely like that work is D, and it has a billion other problems of it's own
 
@BartekBanachewicz The language provides alternative mechanisms for that.
 
every other GC'd language doesn't come anywhere near close to RAII.
 
1:38 PM
@R.MartinhoFernandes and are they sanely usable?
 
@BartekBanachewicz yep. But they're not RAII
 
Screw that.
Not even in Java you need that anymore.
 
In C#, using (var obj = new MyObject) { /* obj will be destroyed when this scope is exited*/ }
 
Same in Java, except s/using/try/ and no type inference.
 
1:41 PM
That gives you deterministic destruction (well, disposal, in C# terms). Unfortunately it still puts the burden on the caller to remember to use such a block, but otherwise, it gets the job done
 
@jalf obj.Dispose() will be called, to be precise.
 
@CatPlusPlus yeah
 
This is pretty much equivalent to execute-around.
 
okay, so the only practical disadvantage of C# over C++ is accurate destruction of memory
 
Which is not really important.
 
1:42 PM
@BartekBanachewicz what do you mean by "accurate destruction of memory"?
 
@BartekBanachewicz using() like that is a far cry from RAII- there's lots of cases RAII covers but using() doesn't. So it really depends.
 
@BartekBanachewicz Who cares about memory.
 
@jalf the one that I'm really concerned with that should be done immediately.
 
@BartekBanachewicz You should not.
 
there's lots of cases RAII covers but using() doesn't[citation needed]
 
1:43 PM
The GC handles all the memory.
 
@R.MartinhoFernandes If the memory in question is on the GPU or otherwise unmanaged, you can't leave it to the GC.
 
No issue with that.
 
@R.MartinhoFernandes I reconstruct a lot of geometry at runtime. I can't let that float around
 
What matters here is other resources.
 
Unmanaged memory is a disposable resource like any else.
 
1:43 PM
@BartekBanachewicz If you cannot, it won't.
 
@R.MartinhoFernandes well, exactly. What about Files, for example?
 
@CatPlusPlus Simple example: RAII is transitive, using() isn't.
 
@BartekBanachewicz What has been said so far.
It's not about memory, though.
(Just like RAII isn't)
 
@DeadMG Uh
 
in C++ every resource is destructible, every container, every bit of code is set up to handle destruction, and the compiler can handle a large amount of it for you, like destructing member variables.
in C#, you have to explicitly dispose of basically everything.
if you write Dispose(), then you have to manually update that method every time you get a new Disposable data member.
if you have a Container<T>, where T is disposable, then you are going to have to dispose of everything in it yourself.
 
1:45 PM
Or you can use IoC container to manage object graphs for you.
 
@R.MartinhoFernandes Ah I remember that from uni. So the file will remain open indefinitely?
it's like, uh.
 
@BartekBanachewicz No.
 
Feels like a step backward somehow.
 
So, no, not really a problem.
 
You should read about it.
 
1:46 PM
Sure, there could be more language support, but it's not crippling by any means.
 
@R.MartinhoFernandes indefinitely = being open for how long GC decides to keep it
 
@CatPlusPlus It's DeadMG crippling.
 
@BartekBanachewicz No.
 
@BartekBanachewicz If you do it wrong, yes. So what.
 
It's scoped to using block.
Or the object graph. Or however you like to manage your IDisposables.
 
1:47 PM
@R.MartinhoFernandes you mean without that using block
 
so I have to write using everywhere that in C++ I would just write {
 
@BartekBanachewicz So if you add a new local variable, you have to using it every single time (hope you never forget)
 
@BartekBanachewicz Pretty much, yeah
 
now if you want to tell me that's a good thing, I am all ears.
 
1:48 PM
In practice it's not as bad the puppy paints it.
 
:sigh:
You can't "forget", because you create a variable within the using block.
 
He just has a lot of trouble getting used to not-my-way.
 
It's scoped to that block and not available outside of it.
 
@CatPlusPlus you can create the variable outside a using block. Which means that you can forget to do the using block
 
@CatPlusPlus I didn't use the word "forget". More like "unnecessary"
 
1:49 PM
@jalf And you can do T* x = new T in C++, so?
 
@jalf Right. There's no protection against doing var x = new DisposeThisOrUnmanagedMemoryLeak();.
 
it's something that I have to write in C# and don't have to write in C++
 
@DeadMG There's no protection against that in C++ either.
 
true, except that T t; is the default, simple way of doing things, in which the compiler protects you.
whereas you have to go out of your way to obtain disposal.
 
can I create more than one variable in one using?
 
1:49 PM
@CatPlusPlus So in C++ you can encapsulate that in the resource-owning class, so that the user of the class never has to do anything error-prone like that. In C#, the burden is on the user of the class to remember to always wrap it in a using block
 
Just like using is the default, simple way of doing things in C#.
 
not to mention things like, the compiler always destructs members for you, for example.
 
using (
 var a = new A(),
 var b = new B()
) {
}
 
You can nest them.
 
@R.MartinhoFernandes sigh
 
1:50 PM
Did I mention IoC? I believe I mentioned IoC.
 
and, of course, if you change a type to require disposal, you have to update every single use.
 
using (var a = new A())
using (var b = new B()) {
}
 
@CatPlusPlus you did and I don't have a slightest idea what that means
 
@BartekBanachewicz Is that much worse?
 
If you change a type to require disposal, you suck.
 
1:51 PM
@R.MartinhoFernandes having to write it at all is bad, and adding that is making it even worse, yes.
 
@BartekBanachewicz Why? It's just one more word compared to what you wrote above.
 
@BartekBanachewicz Basically a way to manage lifetimes in object graphs and make coupling loose.
 
@R.MartinhoFernandes because I am used to the fact that objects are destroyed when they leave scope
 
3 mins ago, by R. Martinho Fernandes
He just has a lot of trouble getting used to not-my-way.
 
@BartekBanachewicz They are destroyed when they leave scope.
 
1:52 PM
But it's something we fight over with C guys
 
The scope is using block.
 
their stuff doesn't destroy, C++ ones do.
 
Not the same thing.
C requires manual error management, using block disposes on exception properly.
 
Let me spell that clearly. I think that using is unnecessary boilerplate
 
@R.MartinhoFernandes I often wonder if any of those programmers who insist on curly braces for every single control block, notice that those are really nested usings and therefore have missing optional braces
 
1:53 PM
@BartekBanachewicz it's a compromise, because "true" RAII doens't mesh well with the GC and the language's goal of being safe (it would be very difficult to ensure that the user will never be able to reference a destroyed object)
 
exception safety is really only one of the benefits of RAII.
 
@BoltClock hehe.
 
@BartekBanachewicz how is it unnecessary?
 
having the compiler automatically generate the destructor for all members, having all containers, all classes etc always destruct properly is a big advantage too.
 
@jalf wait, please tell me how you are able to guarantee that with using and/or normal GC
 
1:54 PM
@BartekBanachewicz ... because the GC can ensure that "as long as the object is visible, it is live and won't be GC'ed, so you can safely access it"
 
I mean, surely this:
using (var a = new A())
{
    using (var b = new B())
    {
        using (var c = new C())
        {
        }
    }
}
 
@BartekBanachewicz using makes the variable scoped inside it. It requires Machiavelli to cheat that.
 
Is a hundred times clearer than this:
 
@BoltClock it's an amazing example how it looks in my mind
 
using (var a = new A())
using (var b = new B())
using (var c = new C())
{
}
 
1:54 PM
BTW it's pretty trivial to just loop over class members and dispose them.
 
with RAII, you're saying "this object dies now. If you still have a reference to it anywhere, tough luck, it's up to you to remember to never dereference that again"
 
@jalf If you treat Dispose() as a destructor, then holding a GC ref to it won't prevent it's destruction. So it's really the same boat.
 
@jalf isn't that what RAII ensures too?
 
@DeadMG Destruction !=disposal
 
@CatPlusPlus :not-sure-if-nice-or-scary:
 
1:55 PM
@jalf You can always stow away a reference from inside using (and it will refer to a dead shell of an object) but that's the moral equivalent of taking a reference to a local in C++.
 
@R.MartinhoFernandes except that the result isn't undefined, because you're referencing a disposed object, not a destroyed one
 
RAII is just a compiler sugar to execute-around p much, so stop treating it as a holy grail that's so much better than execute-around.
 
@CatPlusPlus Stop pretending that compiler sugar doesn't matter?
 
@CatPlusPlus that's like saying C++ is compiler sugar over C
 
It doesn't matter that much in this case.
 
1:56 PM
@CatPlusPlus Firstly, compiler sugar can be pretty fucking important in some cases (for example, lambdas) and secondly, this is not compiler sugar.
because if I write a destructor myself, then I'm duplicating information (the members) in my destructor.
having the compiler do it prevents duplication and improves my code.
that's not sugar.
 
I'd say it's fairly significant when "compiler sugar" can remove potential sources of errors. Such as by allowing a class itself to take over a responsibility that would otherwise have rested with the user of the class (removing one way in which the user could otherwise screw up)
 
writing destructors itself is something good C++ doesn't do
good C++ creates in valid state and destroys itself properly
 
3 mins ago, by Cat Plus Plus
BTW it's pretty trivial to just loop over class members and dispose them.
Types are reified.
 
@jalf That's why I said "moral" equivalent, not technical :) Both are on the same level of evil (most disposable objects are not designed for post-mortem use).
 
Also, if you really insist, T4 templates can generate that.
 
1:58 PM
and now you show me C# that doesn't do "good" things, I think my scepticism is justified
 
@CatPlusPlus The only way to actually do that equivalently would be to use reflection to find all the class members.
 
@CatPlusPlus sure, and so can hiring someone else to write your code for you.
 
@DeadMG Which is trivial.
 
@BartekBanachewicz Most languages do some good things, and lack support for other good things found in other languages. #dealwithit" ;)
 
@CatPlusPlus why can't the language do it for me?
 
1:59 PM
@CatPlusPlus R# helps too.
 
@BartekBanachewicz vOv
Resource management in GCed language is not a problem (that abstracting from C#).
 
except when it is
 

« first day (982 days earlier)      last day (3952 days later) »