« first day (3 days earlier)      last day (56 days later) » 

3:49 AM
4
Q: Agnostic means of identifying a number

rhgrant10I'm attempting to provide an agnostic means of identifying a member. I need a nickname, a guid, and one of user_id, email, or phone_number. Since I'm using Python, I try to not care about the Python type of member because, after all, if it has what I'm looking for then I don't really care whether...

^^^ that one.... how do I write ducktyping, by the way, here's my code that sort of works!
 
 
6 hours later…
9:38 AM
> The question is, if my attempts to not care about the type to this extent are reasonable, then is there a way to make this code better adhere to the principle of DRY?
Sounds on-topic to me
> how do I write ducktyping, by the way, here's my code that sort of works!
Sounds off-topic to me, but I don't interpret the question the same way apparently
@rolfl Can you please pin that?
 
 
1 hour later…
@SimonAndréForsberg Done
 
Additiopnally, anyone with > 200 messages in this room is now an owner
 
11:27 AM
I agree with @nhgrif. We're doing a lot of this.
> Well, when you say it this way it's off topic, but saying the same thing that way is on.
I understand semantics is a big part of the conversation, rightfully and necessarily, but...
Well, it's like I said earlier. If the way a question is stated is the issue, it can be edited to be on topic.
Now, that doesn't mean that the plain English isn't important. It is. It's the intent behind the question. So it matters, but people may need some gentle prodding to learn how to write a good question.
 
Yea. Plain English part differentiates mediocre on topic questions from great on-topic questions, but given that a chunk of code with very little plain English is on-topic, it's weird that some non-code phrases make it off-topic.
In that regard, particularly if English is not your first language, there's almost incentive to post less plain-English.
Better to be mediocre and on-topic than to be off topic.
 
11:48 AM
Totally agree with Duck and nhgrif
Sometimes I think it might just be a case of bad formulation. You might want just an ordinary CR-style review, but you might formulate yourself differently, so that someone considers your request off-topic for one reason or another.
I think sometimes we over-analyze what the OP actually is asking for
 
OK, so what you are saying is that we review the code as the code is presented, and any surrounding text is just hints and suggestions and descriptions of what the code is and it's context?
 
And what the OP primarily wants to get out of the answers
 
Don't go onfusing things now.
5
Q: Agnostic means of identifying a number

rhgrant10I'm attempting to provide an agnostic means of identifying a member. I need a nickname, a guid, and one of user_id, email, or phone_number. Since I'm using Python, I try to not care about the Python type of member because, after all, if it has what I'm looking for then I don't really care whether...

> I'm attempting to provide an agnostic means of identifying a member.
 
If I understand what Simon is saying correctly, I agree.
 
> The question is, if my attempts to not care about the type to this extent are reasonable, then is there a way to make this code better adhere to the principle of DRY?
 
11:55 AM
Poorly formulated, but what OP is saying is "This is what I did. How can I make it DRYer?"
 
What are you trying to say @rolfl?
 
We're left reading between the lines a little bit, but I think that's ok.
 
If some Python reviewer starts reading the code and makes the conclusion: "This is not working properly", then they have two options: 1. Add a comment and VTC. 2. Post an answer addressing common CR issues and point out the flaw
 
Yes. That^.
 
Argh, I am getting more convinced..... that I may be wrong.
but I am not quite there yet.
 
11:58 AM
Is there anything right and wrong here?
 
Come to the dark side Luke rofl.
 
0
Q: RESTEasy client that should use generics

Erki M.I have written some code using RESTEasy to handle RESTful service calls and parse the response XML into relevant JAXB annotated classes. At the moment I have seperate methods for each return type: public class RestBase { protected final RestClient restClient; public RestBase() { ...

 
Isn't the point of this chat room to determine what's right and what's wrong?
Erhm... I mean... of course you are wrong @rolfl
 
Refactor my code to use generics!
Gimme the code!
> Could I reduce the amount of code by using generics? I have had some luck with using:
 
SO territory.
> How do I?...
 
12:01 PM
Not according to you guys ;-)
it has code.
it works.
and the text is 'context'.....
 
But if doesn't work as intended.
 
That one is probably one of the most grey area questions
 
All they are looking for is DRY .....
 
@RubberDuck I think the original code works as intended, but he wants to improve it (the cleaniness, not what it does) - but while attempting to improve it he failed.
 
Hmmm. I'm sounding hypocritical, aren't i?
I feel like VTCing my own question right now.
 
12:03 PM
This is more SO territory than the other questions we've discussed I think, but I am not convinced that it's off-topic for CR
This one is essentially: I have this code, I want to improve it. While attempting to improve it, I failed.
 
What was it you told me @Simon? Something along the lines of "It's on topic for SO, but that doesn't mean it's off topic here."
It's definitely borderline because of the "I failed" part.
 
Exactly. Being on-topic on SO and off-topic here are two very different things. Just like improving code is technically on-topic on SO
 
0
Q: Handling infinities in this numerical integration method

ShaktalI have written a parallelized version of Gauss-Laguerre quadrature and am wondering how best to handle infinities that occur due to lack of floating-point precision. Basically, I use Newton's method to approximately solve Laguerre polynomials in order to find the abscissae \$x_{i}\$ and weights...

> I have written a parallelized version of Gauss-Laguerre quadrature and am wondering how best to handle infinities that occur due to lack of floating-point precision.
> I was wondering what design strategy I should take in this approach (bearing in mind that f(x) is user-defined and thus may use NaN as infinity; for instance the following might be used
 
He explains a lot about what kind of improvements he wants, but does not say much about how it is being solved right now.
Let me ask you this, @rolfl. If that question is not on-topic here, where/how would you recommend that question to be posted?
 
Nowhere on Stack Exchange.
 
12:11 PM
And why is that?
 
It does not fit a question and answer format
too broad, and answers would necessarily be too long.
That is just for the questions asked in the text.
 
Opinion based (IMO).
 
the actual code review would be OK, but, he does not care about the code review, rather, he cares about the strategy used to solve it.
He is asking: How do I solve my problem?
not, "Is my solution good?"
 
It's very much a design question. And yes that^.
 
But, the issue you guys say, is that he has code, and the text is not important
(as important)
And I am saying that a code review is meaningless to the asker because that is not what he wants.
so, a good code review, assuming the 'design' is right, would be of low value.
Editing the question to say: "here's my code that does XXX, please review?", will make the question on topic, but it does not change the asker's intentions.
 
12:15 PM
This is a case where it is very clear that the OP does not want a Code Review. Many of the other cases we've talked about are not that clear.
 
No, they are not that clear, but that has been my point all along, there's a line, where is it?
 
He's not saying "I made this decision, was it a good one?" He's saying "what do I do?"
 
You are saying that this question is on the wrong side of the line?
 
I'm not sure where that line is yet.
 
but there is a line?
 
12:16 PM
Appearantly. Yes.
 
In my 'silly words', this question asks for a "design review" and as a consequence, it is off topic, despite having working code.
the asker knows that his design is wrong, even though the code produces results.
 
Ahhh, but it's not asking for a design review, it's asking for help designing it.
 
which is even worse, right?
OK, I have to go for a bit, but I think this question has a test case that has made you stop and think about the problem I see, in a different way.
 
Yes.
It did. Yes.
 
I want to close that question as "too broad", and it will be oo broad on all sites I can think of.
It is asking "how do I (best) solve my problem?"
and that is not suitable for any site (other than perhaps computerscience.se)
 
12:20 PM
@rolfl He has code yes, but is the code working?
 
But, if someone were to challenge my decision to close it as off-topic/too broad, I have no grounds to defend it.... at the moment
@SimonAndréForsberg For the current design, yes.
for the future design that solves the problem in a way that is better, no.
that is my argument all along, that the code is not ready for review.
and the critical component that has to be 'settled' is the design, before we can even consider the code for review..... and, if he came and said: here's my code....
and we said, well, you are not handling NaN right, and that you chould change your design.....
then we can review the design in a code review, but he can't ask for a discussion about whether the design is the best.
an asker has to know what they are trying to accomplish before any code they present is known to be working.
 
Yes. So, how I see it. The difference between that question and mine is his question asks "How should I go about doing this?", where mine said, "This is how I did it? I don't think I did it best. Can it be better?"
 
if they ask for a review, or help with their design aspects, then they cannot know that their code works.
 
And that's the line.
I've done this, is it good? - on topic
I'm thinking of doing this, how would you do it? -- off topic, because it's opinion based.
 
Now, put that in words that can be used as a close reason.
Breakfast time
 
12:27 PM
I'll think on how to say it clearly.
 
@rolfl Again, I disagree about the "design" thing. I think this C++ math question wants to change what his code does, not how it does it. To me, design is not about what the code does.
@RubberDuck With emphasis on thinking of doing this. I.e. he hasn't done it that way yet.
 
@SimonAndréForsberg See, I think of it exactly the other way around. Design is about "what" first. The how is secondary.
 
12:56 PM
OK, so design is the wrong word to use
I am open to suggestions, but bringing it back to the FizzBuzz example, it is OK to say "I did it this way, is it OK", but it is not OK to say "should I use %15 and String constants or should I use %3 and %5 and concatenate Fizz and Buzz, by the way, here is how I have it now?"
 
@rolfl Disagree. Using %15 and String consts or %3 and %5 is about the how, not the what. As long as there is a working version that does the same thing, that's fine by me. (Usually, can't think of an exception right now at least)
 
http://codereview.stackexchange.com/questions/60650/mvc-model-validation-callba‌​ck
That?
never mind
 
@rolfl Without having read all the question, isn't that another case of this:
1 hour ago, by Simon André Forsberg
This one is essentially: I have this code, I want to improve it. While attempting to improve it, I failed.
No wait a minute. It probably isn't
 
1:24 PM
Yeah. Bad example. So, let's reign this in a little. We keep drifting.
This all started with Interface only questions, right? Did we ever land anywhere on that?
Let's eat this elephant one bite at a time.
To summarize that, a lot of us feel Interfaces are on topic only if they're accompanied by an implementation. Some of us feel that they're on topic without one, but are a low quality question without it. Some feel they're just plain off topic as "Example Code".
Is that right?
 
My issue with API only questions is that they are basically saying "how do I create an API that's good", because essentially anything but style and indentation changes to an interface changes "what the interface does".
since that is the entire purpose of the interface, changing it, is changing the purpose.
It is OK to ask does my code implement the interface well, but it is another thing to say "what should my code look like?"
 
Right, and my stance on it is that it can be reviewed, as this seems to prove. codereview.stackexchange.com/questions/60648/…
But it doesn't make for a good question.
On topic, but to be discouraged.
So, my question is: Is that reasonable middle ground?
Because we'll never all agree on it. We will need to compromise.
 
 
2 hours later…
3:49 PM
@RubberDuck I can agree with that
 
 
2 hours later…
6:07 PM
@SimonAndréForsberg The problem is solved; this is more of an edge case which I am asking for advice on how to handle? I get very confused where it is acceptable to ask these sorts of questions due to the large number of related SE sites (SO, Programmers, CS.SE, Math.SE, etc.); but if you think it would be better for CS.SE then I will move it! :) — Shaktal 17 mins ago
 
 
5 hours later…
10:44 PM
0
Q: Tail recursive sort

CeleritasI read from here that quicksort can be tail optimized. I tested the code given and it didn't work: TAIL-RECURSIVE-QUICKSORT(A, p, r) while p < r q = PARTITION(A, p, r) if q < (p + (r-p)/2) TAIL-RECURSIVE-QUICKSORT(A, p, q-1) p = q+1 else TAIL-RECURSIVE-QU...

> My question is how do you actually get it to tailrecurse (using a loop) since Java's optimizer doesn't do this for you?
 
11:10 PM
@rolfl But ultimately... even without this question, wouldn't a good review answer that question anyway?
 

« first day (3 days earlier)      last day (56 days later) »