« first day (184 days earlier)      last day (4755 days later) » 

8:00 AM
are you objecting to the fact that it prevents you from ignoring errors?
 
@jalf Ignoring errors? no. I'm objecting to the fact that exceptions move the burden of deciding the severity of an error is from the consumer of an interface to the designer of an interface.
 
@ChrisBecke Please answer my question, what is happening that doesn't need to?
 
"...exceptions are just error codes with explicit checks at every single expression..."
 
@ChrisBecke Okay, and...?
So you mean to say you fail to check all error codes? Then your program is, by definition, incorrect.
 
so your problem is that you're not allowed to ignore errors?
 
8:04 AM
You very rarely, actually need to check the result of every single expression.
 
@ChrisBecke On what grounds? If I don't know that every expression executed without error, I don't know if my program is correct, by definition.
 
(admitting there are specialist software niches where such rigorousness might be an actual requirement)
 
@ChrisBecke If by special you mean general, sure.
Here's your problem: you seem to think correctness is an optional feature. Every had a program crash? That's the mentality behind it.
 
is it me, or have you done a complete U-turn over the last 20 minutes? From "Impossible to perform code reviews on" to "I don't actually want to handle all my errors"
which sounds like something that'd be impossible to get through a code review
 
@ChrisBecke Are you a game programmer?
 
8:06 AM
on occasion.
 
And on not occasion?
 
how many game saves have you lost because the developer didn't bother to handle errors?
I've had a few
 
I work on the asset loading, background updating and server sides of the product
 
@jalf True that. :(
@ChrisBecke And if an asset fails to load, or updating fails, you just ignore errors?
 
how many games have you had to reinstall because the updater (background or otherwise) failed to handle errors?
I've had a few
 
8:08 AM
Out of billions of game-plays... I think close to zero lost.
 
you've played billions of games?
I'm amazed you have time to develop them too
 
no. our players have.
 
Oh, and you've asked every one of them if they've lost a save game due to your sloppyness?
 
@ChrisBecke Does that code handle errors?
 
Or do you just assume that they'd write you a letter when it happened?
 
8:09 AM
Anyway, perhaps it's crass of me, but I asked that because game developers are the worse programmers in terms of correctness that I know of.
 
they can get quite tense if the game doesnt work.
theres money involved
My job, as a programmer, is to ensure that the end users get the best expreience of the software.
 
Which probably involves making sure the code works.
 
and and unhanded is thus a far worse problem than a single asset not loading.
both of them are bugs, there in the users face.
 
(Could you say your first message again? I cannot parse it.)
 
damnit. can't edit.
 
sbi
8:16 AM
There's one argument that usually stops all discussions about which error handling is to be preferred once and for all.
(morning, btw.)
Which code you'd rather work with:
int blrgl1(const frgl& wrgl, frgl& result)
{
  frgl result1;
  if( error_success != xrgl(wrgl, result1) )
    return error42;
  prxl result2;
  if( error_success != yrgl(result1, result2) )
    return error4711;
  if( error_success != zrgl(result1, result) )
    return error768;
  return error_success;
}

frgl blrgl2(const frgl& wrgl)
{
  return zrgl( yrgl( xrgl(wrgl) ) );
}
 
and an unhandled exception is just as much of a problem as an asset not drawing.
 
@sbi morning
 
sbi
And if you're saying the first example is exaggerated, because your code never looks like this, then you're just skipping error handling. Your code should look like this.
 
@sbi just left a comment on the meetup page :)
 
@ChrisBecke Okay, but I don't see how that relates to anything.
 
8:17 AM
@sbi these variable names look like chinese or something :P
 
sbi
@TonyTheTiger Then replace them by foo, bar, foobar etc. :)
 
@sbi lol
 
@sbi The second peice of code isn't correct as you have omitted the error handling.
 
@ChrisBecke The implication of the examples is that the second uses exceptions...
 
sbi
@ChrisBecke No, I haven't. Error handling is done by the outermost function which just reports the error to the user.
 
8:19 AM
@GMan The error generation is only half of how error handling is done.
 
sbi
My point is, in the second example you immediately see what the function does, in the first the algorithm the algorithm is buried under error handling.
 
there DOES need to be a catch clause elsewhere
 
@ChrisBecke Yes, as there needs to be checks for certain error codes elsewhere...
 
sbi
@ChrisBecke Yeah. One catch clause, in one place.
With error code, you have to check everywhere.
 
without a catch clause, the first piece of code could be written as the 2nd piece.
 
8:20 AM
@ChrisBecke but most of the error handling code doesn't need to be inside that catch clause. It just has to be in the objects that go out of scope when an exception is thrown
in other words, the error is handled in and by the object that generated it
 
sbi
@ChrisBecke Do that. Show us. Now.
 
@ChrisBecke But since it uses error codes, the error goes unhandled and your program is broken, by definition.
 
@jalf; @sbi I don't know why you bother having this discussion, some people are unable to change their mind about something, no matter what you say
 
@TonyTheTiger oh, Chris has changed his mind more than a few times during this discussion
2
 
@jalf but not in the right direction
 
sbi
8:22 AM
@TonyTheTiger One of the many directions might have been the right one.
 
It's like a compass. No matter what we say, he assumes the position that points in the opposite direction
 
@sbi oh, too many directions in one go create confusion
 
He started out saying exceptions weren't good enough for robust error handling, and ended up saying they forced him to do more error handling than he wanted
 
@jalf that's exactly why there's no point in even trying to have a discussion cause he only seems out to make wrong
 
with a few detours along the way
 
sbi
8:23 AM
@TonyTheTiger Hey, I only threw in this one argument. If he comes up with a convincing argument as to why the first is better than the last, I might even learn something. Otherwise I'll just bow out.
 
forks
 
I don't think what we're having can be termed a discussion anyway
 
i'm sorry for ranting in the comments
 
@sbi heheh smart :p
 
sbi
8:23 AM
@JohannesSchaublitb ohhhhhhh!
 
@sbi I see you have fun!
 
@JohannesSchaublitb Your rants are like sweet, sweet nectar.
 
@jalf what would you term it then? a one ended rant?
 
lol @GMan
little bee
 
@JohannesSchaublitb what ranting comments?
 
sbi
8:24 AM
@GMan ...provided by poisonous, stinging bees.
 
@sbi lol
 
:D
I planned on staying up all night, drank three Red Bulls, but all they made me do is wanna roll over and pass out.
 
@GMan so much for the wings then....
 
Yeah :/ In other news, PacMan (<...............
 
sbi
@TonyTheTiger What's wrong with them wings? You can roll over in the air just fine, and albatrosses sleep during fight.
 
8:26 AM
@JohannesSchaublitb, on the comment on saturday about the class and value initialization, I guess that my wording was not precise, I had spelled a class with no destructors, and then wrote what the implicitly defined (that was missing from the text) default constructor would look like, and how it differed from value initialization. In the presence of a user defined constructor, value initialization and default construction are the same.
 
@sbi hahah but redbull wings are supposed to keep you awake.... @GMan was dozing off with his...
 
I think my wording was all wrong if anything.
 
sbi
@ChrisBecke We're still waiting for you to provide a way that blrgl1() could be written the way blrgl2() is and pass on all the errors reported without using exceptions. If you can't do that, this might be a perfect moment to admit that you just have learned something. (Well, you should have, at least.)
 
@DavidRodríguezdribeas this can lead to surprises
struct A { int const a; }; now A() is valid. But if you have struct A { int const a; int b = 0; }; or struct A { virtual void f() { } int const a; }; and then say A(), then it is invalid.
 
sbi
@TonyTheTiger Does it? And did anyone believe this? ISTR the ads saying "...provides wings" here. As far as I can tell, so far none of the customers have grown wings, yet none have taken them up on that.
 
8:31 AM
Damn it, I need coffee... a class with no constructors (I previously wrote no destructors)
 
It happens surprisingly often to me that I write con instead of de or de instead of con. And I watch it on others too. I don't know what the underlying reason of this is.
 
@sbi quite right, we should write them a formal letter of complaint in regards to false advertising...
 
@sbi @ChrisBecke (Ping.)
 
sbi
@GMan (Pong.)
 
   0     0
|     .      |
 
8:33 AM
@sbi fun game
 
sbi
@TonyTheTiger I'm just pavloving again.
 
@ChrisBecke show us you have guts
 
That just looks like a face or something.
 
@GMan that entirely depends on what a frgl is
 
@GMan very creative :)
 
8:34 AM
@ChrisBecke You said you could write the function, did you not?
 
frgl blrgl2(const frgl& wrgl)
{
return zrgl( yrgl( xrgl(wrgl) ) );
}
if frgl is a class.
 
sbi
@ChrisBecke No, the whole point of this code (and that's why I chose the names) is that it does not depend on what any of the functions do.
 
@JohannesSchaublitb I don't follow, what is invalid in struct test { virtual void f() {} int a; }; and test()?
 
sbi
@ChrisBecke Fails.
 
@ChrisBecke Where are your error code checks?
 
sbi
8:35 AM
It doesn't pass on any errors xrgl(), yrgl(), and zrgl() report.
blrg2() does that.
So what now, @Chris?
 
@sbi he can go weep in a corner somewhere or admit he's learned something
 
sbi
@wilhelmtell One of my professors used to say that in a case of an unexpected error your code should rather cleanly die than dirty mumble on. If you don't know what to do, follow this advice.
 
Let's not be too mean, criticize the argument, not the person. :) Chris is our friend.
(That's not directed at anyone in particular.)
 
frgl blrgl2(const frgl& wrgl)
{
return zrgl( yrgl( xrgl(wrgl) ) );
}
is a potentially perfectly valid way of writing blrgl1. without exceptions. You havn't defined anything about the requirements
perhaps the requiirement is that its written as blrgl1.
 
@ChrisBecke Each of those functions returns error codes.
 
sbi
8:38 AM
@ChrisBecke Don't you try to weasel out of this one! The requirements were well-seen in my implementation!
 
my claim is that, most of the time, that level of rigorousness is not actually required.
 
@ChrisBecke The requirement is a correct program. This requires you handle errors. Where is your error handling?
@ChrisBecke No.
 
How do you choose your identifiers? I am getting dizzy with all the rgl suffixes ...
 
sbi
All of the functions might fail, and all of them need to report that. Somewhere higher on the stack some function will deal with the errors.
 
wouldn't it be easier to just drop them?
 
8:39 AM
@ChrisBecke I thought your claim was that code relying on exceptions could not be code reviewed.
 
In that case, blrgl1 is the canonically correct example.
 
@ChrisBecke You know what, I'll entertain it. What criteria do you use to determine if "that level of rigorousness" is required.
 
@jalf and you are claiming that blrgl2 is correct?
 
sbi
@DavidRodríguezdribeas I was trying to identifiers ones that mean nothing, are impossible to pronounce, and hard to write.
(The point being that they don't have a meaning.)
 
My point here is that we CAN'T as sbi's code reviewers actually see if he has handled the errors.
 
8:40 AM
(That is, of course, bullshit. Every statement must either work without error, or handle the error, or your program is not correct. If you think you can just ignore some errors, you're part of the problem.)
 
sure, the code looks neat, but where is the error handling?
 
@ChrisBecke of course not. It omits all the error handling. @sbi's versions (both of them) were correct
 
@ChrisBecke But they are handled.
 
prove it
 
We know at the very least, his program will terminate.
The language requires it.
 
8:41 AM
and that is not always the correct behaviour
 
@ChrisBecke it is more correct than ignoring an unknown error
 
@jalf in a particular domain
 
I seem to recall you said something about avoiding "inconsistent state"
 
but don't you go pushing your domain assumptions on me
 
terminating the app brings you into a consistent state. Ignoring the error does not
 
sbi
8:42 AM
@ChrisBecke Cleanly terminating in a case of an unexpected error is much more correct that mumbling on not knowing something bad has happened.
 
terminating on error is not universally the correct way to deal with errors
 
Oh I'm sorry, I assumed we could agree on "the domain where correctness matters"
@ChrisBecke we're not. YOU were the one who initially talked about inconsistent state as a bad thing. And now YOU are saying "inconsistent state is preferable"
 
Perhaps it's bad of me to star every other message.
2
 
Don't you have a finite number of stars or something?
 
sbi
@GMan Don't worry, you'll run out of stars after 40 messages anyway.
 
8:43 AM
Hell if I know, I certainly haven't reached it.
Cancel that: yes, there's a limit.
(Per day?)
 
@GMan lifetime
:P
 
:(
@ChrisBecke When is ignoring an error ever correct?
 
@GMan i fib. of course
 
sbi
@GMan Yep.
 
@GMan when termination is a worse experience than continuing on.
 
8:45 AM
@ChrisBecke .................................
You cannot continue and behave correctly, by definition.
 
sbi
@Chris: Do you really want me to provide an example for a calling function that handles errors reported by blrgl1() and blrgl2() so you see the requirements everyone else is already seeing??? As far as I can tell, you're already so deep in your corner, you can't weasel out anymore. All asking for watertight proof can do now is to press you further into it.
 
@ChrisBecke you mean when writing a corrupt savegame on top of my old, working savegame is preferable to terminating before you do any actual damage?
I know you're not the only game developer to think like that, but as a gamer, I disagree
 
If you truly can ignore an error (that is, separate the cause of that error from the program permanently), you should do so. I consider your program broken otherwise.
And the unique case where ignoring it is fine still doesn't justify the use of error codes over exceptions, of which the latter enforces handling over ignoring, the less exceptional case.
Zzzzz
Night!
 
Hi Guys, Might any of you know a C++ implementation of "Minimal Least Squares"?
 
niz
9:00 AM
Hi everyone, does anyone know what method-by-method approach when using static binding in c++ ?
is?
 
What?
 
0
Q: Non-Virtual Interface - how to invoke the correct virtual function

Tony The TigerI have a hierarchy that looks something like this: class Base { public: void Execute(); virtual void DoSomething() = 0; private: virtual void exec_(); }; class Derived : public Base { public: //DoSomething is implementation specific for classes Derived from Base void DoSomethi...

 
niz
method by method approach in c++ ?
vs variable-by-variable approach in Ada
 
@niz: That was questioned today in SO proper and deleted. I don't even know what the variable-by-variable approach of Ada is like so I cannot comment, but you can enlighten me and tell me what that "variable-by-variable" approach means
 
niz
9:18 AM
I am reading a book I found this method-by-method approach in c++ and c# I looked for it everywhere but I don't find anything about it
 
Without any more context on what you were looking for I am at a loss here...
 
@jalf The error handling a game developer chooses to do is related to the severity of the error. If some assets fail to load for some or other reason, thats not good, but perhaps the game can actually run, or we can try again at a lower res. If we fail writing out some logging info, we really don't care. If the game state is such that the save game might be corrupted? Then we would terminate.
 
VJo
hey sbi, whats with the monkey?
 
niz
@DavidRodríguezdribeas yes I understand I am too I don't know why they used this without providing any explanation I think it has to do with static binding anyway I guess I will skip this chapter
 
And how is that related to exceptions vs. return codes? If you feel you can safely ignore an exception do so:
try { loadResource( x ); } catch ( resource_load_error const & ) {}
@niz Just give a bit of context, what are you reading (other than the exact words: method-by-method)?
 
9:23 AM
Also, as no one has yet devised a formal way to prove software correct, the correctness of software is all relative. So it seems to me that all software must be regarded as being in an inconsistent state, as its impossible to actually prove it correct.
error handling mechanisims - exceptions or error codes - just allow you to discover the most visible source of inconsistency.
You choose to terminate the program when the inconsistency surfaces. I choose to continue, because its impossible to prove it wasn't there all along.
 
VJo
@TonyTheTiger you forgot to call DoSomething()
 
If you buy into the arguments of formal logic, that inconsistent programs should be terminated, then I understand why you would prefer exceptions.
 
@VJo lol, that's not the problem however, the problem is that my linker cannot seem to find Base::Execute()
 
VJo
@ChrisBecke What happens if the program can not continue? If a parameter contains an invalid value?
 
But I think a logical extrapolation of that approach is that everynon trivial program should terminate on startup.
until there is a formal way to prove the programs correctness.
 
9:26 AM
:)
 
@ChrisBecke so then there can be no non-trivial program? HUH
@ChrisBecke isn't the correcting proven by the mere fact that program actually runs
 
VJo
@ChrisBecke there are no ways to prove such thing
 
there can be non trivial programs. but only developers who are aware that all software is intrinsically inconsistent, and work around that as an assumption, can possibly write them.
 
VJo
@TonyTheTiger not really. You can have 100% unit test coverage, program pass all possible test cases, and there is always some idiot finding a bug
 
sbi
@ChrisBecke Yeah, we haven't discussed formal ways to prove software correctness. We have discussed the usage of error codes vs. exceptions for reporting and handling errors. And my argument still stands: in the code I posted, blrgl1() and blrgl2() implemented the same algorithm, and the same kind of error handling (pass on the error to your caller) but the latter was much more readable. You still haven't countered this.
 
9:29 AM
@VJo the one that finds the bug is not an idiot, the one that wrote the bug is
 
Outside of, well, I don't know... I think its always necessary to use cost benefit analysis to see how much the potential incorrectness of an approach costs vs the cost of implementing more correctness.
 
@ChrisBecke there are plenty of formal ways to prove software correct. They're just a pain to use and they don't scale
 
@VJo well it's still correct to some degree, no one said anything of 100% correctness
 
@ChrisBecke and this relates to the exception vs error code discussion how?
 
Just blindly applying a rule "this program must terminate because there is an unhandled exception" is not useful.
 
sbi
9:30 AM
@jalf It's a side issue, brought up to distract us from the fact that he failed to prove his point.
 
@ChrisBecke sure it is. Because it catches the case when you forgot to make the trade-off
 
@ChrisBecke it's not blindly applied, it's applied when it makes sense
 
@sbi and what was my point as you understand it?
 
when you, the developer, sit down and say "this error condition is no biggie, we can continue", then you have made the tradeoff, and you can write an empty catch around it as someone said above, to ignore the error.
But when you fail to do this, then the sane thing is to terminate, rather than pretend nothing is wrong
because then you're in undefined territory in every sense of the word. You don't know what is wrong
 
No. The sane thing, in an environment where cost benefit analysis is applied, is to let the consumer of a library decide on the severity.
 
9:32 AM
@ChrisBecke I am pointing at the case when the cost/benefit analysis is not applied
 
With exceptions, the producer of a library makes the alwaysarbitrary distinction between what consitutes exceptional vs non exceptional circumstances.
 
where you forgot that an error might occur
 
sbi
@ChrisBecke You're beating up a straw man here. Terminating a program is when you forget to handle errors. When doing so with error codes, the program doesn't even realize an error occurred. That's much worse.
3
 
user69820
@TonyTheTiger here's your problem undefined reference to 'vtable for Base'
 
sbi
Still, this isn't the problem at hand. The problem at hand is that, if you handle errors, with error code, you can't find the algorithms buried under error handling With exceptions that's not a problem.
@ChrisBecke You said exceptions are worse than error code for error handling.
 
9:33 AM
@sbi and I maintain that position.
 
@ChrisBecke I fail to follow that one. The library writer is always choosing which errors to report, regardless of which mechanism they use to report the error. And you, the user of the library, always choose which errors to handle, which ones to present to the user, and so on
 
@ChrisBecke Exceptions can be caught, propagated, caught and translated, ignored...
 
When it is important to handle errors, error codes give you the ability to look at code, and see that the library at that level of abstraction handles the error correctly, and does or does not go into an inconsistent state.
 
exceptions just change the default for the (common) case when you forget to even consider the error, from "close your eyes and hope for the best", to "shut down ASAP"
2
 
sbi
@ChrisBecke We've all noticed that. However, we've also noticed that you do so despite arguments against it, and despite the fact that you still haven't countered them.
 
9:35 AM
With exceptions, no particular layer can know how many layers up the exceptions will get caught.
 
sbi
You're certainly free to do so. But we are just as free to tell you that what you're doing is stupid.
 
@ChrisBecke are you saying that fopen knows how and where its return code will get handled?
 
@sbi and Im free to tell you what you are doing is stupid. but I won't because I don't know what domain you work in.
 
@ChrisBecke It doesn't matter
 
In my domain, shutting down is almost always the wrong thing
 
9:36 AM
show me a domain where an unknown error is tolerable. Show me an error where ugly, unmaintainable code is preferable
3
 
VJo
@ChrisBecke this is not true. You should handle errors at the points where it is possible to do
 
@jalf no, Im saying that the code that call's fopen, CAN be checked to see that it handles errors.
 
@ChrisBecke and it couldn't be checked if it used exceptions and contained a try/catch block?
 
In all domains, unknown errors are tolerable, by definition
because you have still failed to prove your programs are in fact correct.
 
@ChrisBecke ok, I'm out. Now you're veering into the absurd
5
 
9:37 AM
hence you have to assume they are in fact inconsistent. you just havn't found out how yet.
What is hard with
 
I wonder why you'd do any error handling then
 
Software, to be correct, needs to be proved correct,
no software can be proved correct,
all software is thus incorrect.
 
if unknown errors, by definition, are tolerable, the last think I'd ever want is to turn them into known errors
 
@ChrisBecke so why are you in this business anyways? if by your assumptions everything you do is incorrect! Now we've not only said you're wrong, but you've just said you're wrong too!
 
Because I am willing to make software that works most of the time, and fails gracefully (in my domain) most of the rest of the time.
 
sbi
9:40 AM
@ChrisBecke of course, by all means do so, and have everyone here laugh about you even more.
 
@ChrisBecke you said earlier that in your domain it shouldn't fail
 
and the times it fails ungracefully cost us less.
 
sbi
Anyway, @Chris, I'm going to ground your half of the debate now, by putting you back into my killfile. And I ask everybody (aka @jalf) to stop this waste of bandwidth. The guy's discussion tactics just isn't worth the bother.
 
don't worry about me, I already put him on ignore
 
than the times it fails gracefully.
 
9:40 AM
@jalf I'm joining
 
although I have to admit I'm tempted to follow the "unknown errors are tolerable" school of thought
 
sbi
@jalf Ah. Ok. That leaves @Tony.
 
VJo
hey sbi, why did you put monkey into your avatar? :)
 
sbi
@TonyTheTiger :)
 
I can see how it coudl save me a lot of time
 
9:41 AM
@sbi it's done
@VJo why is the sky blue?
 
This discussion was hilarious. Pity it's over. Chris is a great entertainer. Now I'll have to go back to work :(
 
@VJo lulz
 
sbi
@VJo Monkey?? Be glad I'm not the librarian around here, or I'd unscrew you head and use the remainder as a bowl for my peanut shells.
 
@MartinhoFernandes he's annoying more then anything else...
 
9:45 AM
mmm, for daring to have a different opinion.
 
sbi
@MartinhoFernandes Unfortunately, everyone's now used their stock of stars, so we'll have to wait until tomorrow for another heated discussion.
 
at no point have I claimed fact.
 
VJo
@sbi heh now someone will tell the world is not flat and it doesn't lay on top of elefants on a turtle ;)
 
sbi
@VJo The turtle moves!
 
@sbi It's an orangutan, then?
 
sbi
9:46 AM
@MartinhoFernandes No, it's a gorilla. Orangutans were already out of stock when I applied.
 
@sbi I've still some, see...
 
@sbi lol
 
sbi
Anyway, @VJo:
Nov 1 '10 at 8:37, by Prasoon Saurav
@sbi : What's your display pic all about?
Everything's already been discussed here, you just need to search the archives.
 
@sbi being grumpy :p
 
sbi
@TonyTheTiger Been there, seen that?
@AProgrammer Yeah, I figured that message might acquire one or two of those who came late. :)
 
9:49 AM
I didn't came late, I left early :-)
 
@sbi been there, yes! I can be awefully grumpy!
 
sbi
@AProgrammer Yeah, of course, we can all see that you've already left.
@TonyTheTiger Haha, no, I meant, have you been around back then and saw that?
 
@sbi oh you mean the link to the transcript?
 
sbi
@TonyTheTiger Yeah.
 
@sbi yes I went there, but I knew the answer already :)
November, that's so long ago, can't believe I've been hangin' round here for so long
 
10:11 AM
I suck at sleeping.
 
@GMan I on the other hand suck at waking up... would much rather sleep
4
 
@DavidRodríguezdribeas Hm, I suck at that too. :)
 
Mutha don't wanna go to school today, I think I'd rather stay outside and play -- Extreme
 
ok because of complexity it doesn't compile, but it shows the problem... can anyone help
 
Well, the errors are descriptive. You have extra qualifications for the destructor, for example.
 
10:21 AM
First error:
struct test {
void test::foo(); // !error: extra qualification not allowed, remove test::
 
Worse is that SetString takes the string by non-const reference. >:(
 
@GMan cause it changes the string
 
sbi
@DavidRodríguezdribeas "This video contains content from UMG. It is not available in your country." Have I ever mentioned how I hate that?
 
then return the altered string
 
@sbi you have on several occasions :)
 
10:23 AM
Uhm... you can probably find it somewhere else... the song is "Mutha (don't wanna go to school today)" by Extreme
 
and why then does SetDouble NOT change the double?
 
@TonyTheTiger Isn't that GetString, then?
 
If you have fallen into the trap of not consting the reference parameter because SetString needs to manipulate the string to do its work, then don't pass the string by reference at all.
 
@ChrisBecke @Tony And this.
 
@GMan and what?
 
10:25 AM
@TonyTheTiger Why does SetString modify the argument, but not SetDouble?
 
The actual error is that the method is not found by the linker, and that means basically that you failed to provide the definition (or compile it, or link it) even if you are trying to use it
 
@GMan don't ask, I was trying to keep the same interface in the new code to what the original project had
 
sbi
@DavidRodríguezdribeas I'm sure I can, but I rarely ever bother to.
 
@sbi I think you can live just as happily without watching the video... it's an oldie
 
If the error you actually trying to resolve is: "Error LNK2019 unresolved external symbol "public void _thiscall ScriptingEngine::Execute(void)"
then its a link error
 
sbi
10:28 AM
@DavidRodríguezdribeas That's what I though...
 
based on the fact that you have not included a translation unit in the build that includes the definition of ScriptingEngine's methods
sbi I can understand to a degree. But I don't understand how DeadMG and Tony can come in here and repremand me for not subscribing to the idea that exceptions are the one-true error handling mechanisim, when both of them are so utterly fail at simple things like comprehending the meaning of a simple link error.
 
@ChrisBecke That was unjustifiably rude.
@ChrisBecke Shall I comment on your failure to provide a single coherent argument for your position without floundering around different points? Or your ad hoc approach to error handling that can be summed up as: "don't, unless it affects me"?
3
 
how so? I am vociferously attacked for holding a counter opinion...
 
No, you're attacked for failing to support it.
3
 
@ChrisBecke Just say that you don't use exceptions in your singletons, that will be a nice one to watch...
 
10:38 AM
@DavidRodríguezdribeas >:(
 
lol
 
Now, as a matter of fact I must say that I did that before and I am still alive. There are reasons for not using exceptions in some circumstances, and sbi is fine with that (we have discussed it before), like in a tight loop or when exceptions are not exceptional from a DB perspective, a SELECT that returns an empty set is fine at the SQL level (even if at the next level that particular query not returning anything could be considered an exceptional situation)
 
1. I actually have work to do, so I'' state my opinion, and mostly get back to coding.
2. I've been out of academia too long to partage in rigorous debates over correctness.
3. My proof is not relevant anyway. Its impossible to prove that error codes or exceptions are always better than the other. All that I am arguing is that, in real code, there are a lot of situations where error handling is more effective than exceptions.
exceptions and error codes are iso-something or other. and choosing one over the other is a tradeoff.
and, in my domain, error codes are cheaper than exceptions.
 
1. Not much point to stating it at all; sounds like a lame excuse for backing out when things get uncomfortable.
2. Staying on topic doesn't require academics.
3. Meh, semantics.
You're comparison is incoherent, then, because exceptions are actually cheaper than proper error checks. (That is, checks after every error-returning function.)
 
But in most cases, it is simpler to write correct (I won't go into a definition of correctness here, think of does not produce invalid results) That is, it is simpler not to ignore a hard error if it is an exception than if it is an error code.
 
10:44 AM
@DavidRodríguezdribeas Don't even try to go down that road. Chris will simply argue a rather vague "some errors don't matter" approach.
 
Well, I am not native english, but if it is an error it matters, if it is a valid return it does not matter
 
Proving the difference is where the difficulty is
 
That is the exact point of not abusing exceptions: if it is exceptional throw, if it is just one valid result of the operation, don't throw
 
@ChrisBecke See sbi's framework above.
 
No, I don't find it hard at all, but rather simple.
Does that particular result lead you to unwanted invalid results? Or will the result of your system be equally valid?
 
10:47 AM
@DavidRodríguezdribeas so clearly youve solved that NP complete problem then too?
 
sbi
@David & @GMan: Will you two stop spamming this room? :)
@GMan: You need to go to bed. @David: Don't you have work to do?
:)
 
I guess I misunderstood what you meant, I interpreted: being able to determine the difference
 
@sbi I'm just gonna pull an all-nighter. :/
 
@ChrisBecke Awesome. Defining what is a valid return value is an NP-complete problem now. I thought it was a specification detail.
 
@DavidRodríguezdribeas Being able to effectively determine the difference implies a level of compromise no one seems willing to grant me.
 
10:49 AM
@ChrisBecke Quo warranto.
 
sbi
@GMan Ah, those student days..., erm, nights. Anyway, this is the European chat time. Don't usurp it! :)
 
@MartinhoFernandes Its been 20 odd years since I studied comp sci, but proving software to be bug free was one of those hard problems iirc.
Was it actually a np complete problem? I can't remember any more,
 
Loading a high quality texture for a game may not be an error if you have a fallback (low quality texture) that will make the game experience worse but playable... if there is no low quality texture and failing to load the texture means that the player will not differentiate his partner from the enemy, well that IS an error. I.e. the error is not in failing to load a particular texture, but failure to load any texture
@sbi Right, back to work for me :)
 
"All that I am arguing is that, in real code, there are a lot of situations where error handling is more effective than exceptions." that is already quite a reduction of POV compared to your previous claim that "exception should never be part of a user interface."
As now we agree on the hearth of the issue -- though probably not on details about the proportion of the situations where one is better than the other.
 
@ChrisBecke No one's looking for an algorithm to define what is a valid return value. (That is actually an AI-complete problem.) Defining what is a valid return value is something you do on the specification.
 
10:52 AM
@DavidRodríguezdribeas no i mean if you make the member const
 
@MartinhoFernandes All return values are valid! :)
 
and because the class has a virtual function, its default constructor is non-trivial. so if you do test() to value initialize it, it will zero initialize the const to 0, but then the call to the default ctor will be illformed
 
@AProgrammer raw arrays are necessary yes? But are not part of a sane framework presented to developers to write application domain problems. Thats why we all recommend std::vector right?
I see exceptions in the same way.
 
@ChrisBecke Sure. Now explain why your analogy holds.
 
A hard interface, for geniuses to use.
 
10:53 AM
@JohannesSchaublitb Isn't that actually an error?
 
and wrap up so regular programmers don't have to
 
@DavidRodríguezdribeas yes that's an error
@DavidRodríguezdribeas but if you remove the virtual function, everything is fine, because the default ctor is not called
 
(in the context of that statement, users meant developers, using c++ frameworks, to solve application domain problems
 
@ChrisBecke Errors are errors, regardless of where they happen.
 
@GMan are statements like that considered a tautology even when the phrase doesn't even change!?
 
10:56 AM
Ok, I see where you are going. I did not think of that particular case, that makes my point on sat. even more valid. The expresions a<T>::c() inside a template that takes a T type argument is absolutely dependent and would require the typename if that c is actually a type. Now, the syntax for that typename is another issue... (that I would ignore by just adding a typedef)
 
it is just typename a<T>::c();
 
@ChrisBecke Vector encapsulates the usefull features of arrays in a safer way. Where is your encapsulation of the usefull features of exceptions in a safer way?
 
@ChrisBecke ...the point is you seem to think errors should be handled differently depending on where they are to be raised. This is false.
 

« first day (184 days earlier)      last day (4755 days later) »