« first day    last day (59 days later) » 
01:00 - 19:0019:00 - 22:00

7:00 PM
so if I had written my question differently, like: Well I had this duplication in my interfaces, and ...
 
Now, what I am saying is that the people on code review are smart, and can answer your question, and in fact, they have answered your question.
 
while that is true, isn't it somewhat beside the point?
the smart people on CR can and have reviewed broken code.
 
but, your question really boils down to: is my API design good, and here's some code that implements it.
 
does it?
or rather, would it be if the plain-english part wasn't there?
 
Simply by asking whether your inheritance is right, you are suggesting it could be wrong.
to the best of your knowledge, is your API design right? NO!
 
7:02 PM
While correct, that would imply that my refactoring was wrong.
and not the API design in itself.
because the API was there before it, or not?
 
@rolfl In my mind, what it does and the methods it makes available is not necessarily the same thing.
 
Think of this question as: How is my "implementation (in interfaces)" of the given API design?
 
@SimonAndréForsberg ... that's one of the grey areas.
 
@rolfl But if you ask about if it is right doesn't mean that the answer to "To the best of your knowledge, is your API design right?" is necessarily "No". I'd say that the answer is: "I don't know, that's why I am asking"
 
if you don't know, then you want a design review to be sure.
 
7:05 PM
Exactly. And, as I've already written a design of it, I think it's on-topic.
 
if you were to split the question in to two parts, a design review, and a code review, then the design review would be off-topic.
now it is a question of timing.
 
If you were to split the question....
 
the code review is based on an uncertain design until the design review is complete.
if the design review comes back and says the design is crap, then what's the point of the code review?
that's the way I feel about bugs.
the code review of a known-buggy program is pointless until the known-bugs are squashed.
 
@rolfl is it?
 
for the purposes of Code Review SE, yes.
it is explicitly off-topic.
just because we can review buggy code, does not mean that we should!
just because we can review code that is based on a (possibly/probably) changing design, does not mean that we should
if we say we can review code without having a well defined design, then all we are left with reviewing is the style and syntax, because who cares about the functionality?
that could be changing any time!!!!
 
7:10 PM
@Vogel612 But we (usually) have not suggested how to actually fix the problem itself. When we review broken code, we still do it in a CR type of way. Use arrays. Make an enum. private fields. Use final. etc.
@rolfl If design = what the code does, then I agree. If design = method interfaces, then I don't agree.
 
@SimonAndréForsberg of course, but with interfaces that's kinda ... inapplicable isn't it?
@SimonAndréForsberg how is: "what the code does" different from "method interfaces" ?
 
If the purpose of the program is to implement a specific interface, then method-interfaces are the 'important' design.
If the purpose of the program is to solve Euler 1, then that is the 'important' design.
The interfaces used are implementation details.
Maybe the word to use is 'behaviour'.
You need to know how your program should behave before you come to Code Review.
If your program is simply an interface, then that is the program's behaviour, and you need to know what that should be before asking for a review.
 
btw. a DFQ for you to break your heads over.
2
Q: Building a better Collection. Enumerable in VBA

ckuhn203VBA's 'Collection' is.... lacking, so, I've been working on a better Collection object that implements many of the features of C#'s Enumerable. This is very much inspired by this question and a follow up to Sorting a Collection and More imitation of Enumerable. I'm concerned that the API is inco...

 
That is a great example.
How should my program behave?
 
just asked, upvoted by me and mat from what I see.
 
7:17 PM
here's some code!
 
hmm.
no It's clear how the program should behave.
 
Really?
 
> I've been working on a better Collection object that implements many of the features of C#'s Enumerable.
that's how the code should behave
 
I started out writing everything to be static, but the calls felt weird. To clarify, it's the difference between this

Dim c as New Enumerable
Set c = Enumerable.Intersect(collection1,collection2)

and

Set c = collection1.Intersect(collection2)

I opted for the latter wherever it made sense to, (made sense to me) but it makes things inconsitent, because of calls like this.
How should it behave?
 
I opted for the latter wherever it made sense to,
 
7:21 PM
> I'm concerned that the API is inconsistent. Some methods like 'Range' and 'Repeat' are meant to be called from a "static" default global instance, while others are to be called on instanced.. instances of 'Enumerable'.
 
Does my code do what I want in a nice way?
 
he want's his design validated, and that should happen before it is implemented.
 
well It does what I want, but it feels like my ass looks fat now
 
No, the purpose of his code is to expose an API.
 
nono, after the third block of code it's all hard implementation
 
7:22 PM
Who cares about the hard implementation if the design can change?
 
But if the implementation already does what I want, but it feels clumsy to use the interface
 
More importantly, what's the point of revieing the implementation if the implementation implements the wrong API?
That question is 'classic' is my program doing the right thing, and, if it is, is it doing it well?
 
It's not like it's that much of a refactoring to extract methods (and their headers) to a separate class.
 
let's do that one thing at a time:
the design review is off topic. When you have that settled, come back, and we will tell you if you implement it well.
 
I think this is the same as: I got code xy, and it does what I want, but I think my ass looks fat.
 
7:25 PM
@Vogel612 Yes Vogel. That.
 
@rolfl There's probably going to be a lot of same code from now to later. And even if it's not, CR is a lot about teaching people to code better. If you say "use private final on your fields" then hopefully the OP can apply that to their code in the future
 
I haven't had a chance to catch up yet.
 
@ckuhn203 take your time.
 
If that was a project euler question, it would be "I don't know if I should do a sieve first, or check each number for primeness individually", by the way, here's a version that does it using individual primes.
 
I don't think so,.
It's more like "Here's an implementation the check for the primes with a sieve and an individual check, and it feels clumsy"
 
7:26 PM
So, what's the issue with my question exactly?
 
@ckuhn203 rolfl says it's off-topic, because It's asking for a design review
 
I'm not understanding all of the talk.
 
@ckuhn203 - can I bombard you with some questions?
they may not make much sense until later.
 
Yeah. Sure.
 
Is the code you have there for a 'library' to emulate funcitonality in .net?
 
7:28 PM
Yes.
 
Are you implementinging a range operator in there?
 
It is library code. A utility.
Yes.
 
are you implementing an intersect operator for collections?
Will your code expose it as result = Enumerable.intersect(setA, setB) or as result = setA.intersect(setB)?
 
As it is, it calls result = setA.intersect(setB)
 
Why 'As it is'?
 
7:30 PM
Because I'm not sure it's a friendly, understandable way for it to be called.
 
Thanks.
In my mind, that is a 'behaviour' review that @ckuhn203 s requesting... ;-)
 
I wonder if Enumerable.intersect(setA,setB) would be better.
 
okay, your win
off-topic.
 
when that is 'decided', only then is the code ready for a 'Code Review.se' Code Review.
 
Ok. Now clue me in, because you're saying my question is off topic.
 
7:32 PM
@rolfl if we now assume "as it is" as "I decided"
then It'd be on-topic?
 
And then, at that time, we can say" you know, if you change the API to do Enumerable.intersection(setA, setB) then you could do X, Y, and Z`
and that would be a 'challenge' to the 'design'.
 
Why can't we say that now?
 
That's what I'm wondering.
 
isn't it implemented like that right now?
 
Isn't it better to ask that question when I'm unsure of it? It's already implemented, and I'm unsure if it's best.
 
7:33 PM
yes, but you don't know if your code is implementing the design right, if you don't know what the design is!
 
Yes I do.
I know exactly what the design is.
 
but you are not sure whether the design is right
 
I'm asking if it's right. Ok. Got it.
 
and then we have a design review.
and that's off-topic
 
@ckuhn203 If your whole question was just: should I implement my API as either Enumerable.intersect(setA, SetB) or should I do it as setA.intersect(setB)" then your question would be off-topic.
 
7:34 PM
btw. for the example at hand: why not expose both?
 
So let's go deeper. What exactly about "design" review is off topic to begin with.
 
every answer to a design review is equally valid.
they are too broad by nature
 
@Vogel612 Using optional parameters made it even clunkier.
 

Why all answers to interface-only questions are valid

yesterday, 4 minutes total – 13 messages, 3 users, 3 stars

Bookmarked 3 hours ago by Vogel612

@ckuhn203 damn... no overloads..
 
It's the difference between "does my code have a fat ass", and "what is a thin ass"
(or, if you like fat asses, "what is a fat ass"?) ;-)
 
7:36 PM
That bookmark is awful contrived.
 
@ckuhn203 sure it is, but we're kinda talking extremes here ;)
 
So, if you're making that argument, what kind of API question would be on topic, because from where I stand all of them would be off topic.
So, we're eliminating a whole subset of code and otherwise appropriate questions.
 
I think this may be a good place to read for 'my' take on it:
1 hour ago, by rolfl
They know what their code does, they wrote it, they just don't know if what their code does is 'good'.
If you know what your code is supposed to do, then your code is on topic.
 
That's exactly what I'm asking.
I know what my code is supposed to do.
 
7 mins ago, by ckuhn203
I wonder if Enumerable.intersect(setA,setB) would be better.
You don't know.
 
7:39 PM
Intersect for example. It returns a new Enumerable. I'm unsure of the signature.
No. I do.
 
The whole purpose of your code is to be a library.
 
now it's getting interesting.
 
you are inviting a debate about what your library should look like.
 
@rolfl depends on how you see it.
 
No. I'm inviting feedback on whether or not I've created a clunky interface.
 
7:40 PM
What the code should do: Take 2 enumerables and return one
whether he takes one by instance and one by param or both by param is irrelevant
 
And it does that. What I'm asking is does it do that in the best way.
 
No, you are asking "what is the best way".
currently it does it "this way".
 
@rolfl I am not sure whether he is.
He knows what the code is supposed to do.
He knows that the code does what he is supposed to do.
 
It's been said before that best practice is on topic when it is asked as "is this best practice"
That's what I mean to ask. So, what could be different about how I asked it?
 
But he's not sure whether the code does that in the best way.
 
7:43 PM
@ckuhn203 - I am not meaning to pick on you. You happen to have stumbled in to the path of a lively debate.
And, nothing is being decided right now about your question, so don't worry about it being closed or anything.
 
and for any API creation, the exposed interface is not "what does my code do", but "Does he do it well?"
 
There is a big difference between "what is a good interface for my program", and "Does my program implement the interface well".
 
@rolfl you got the wrong interface here.
 
If you can't say you know what the interface is, you can't have your code ready for review.
 
(removed)
 
7:44 PM
@rolfl Yes, so out of my interest in the debate, not the question, what would be stated differnently?
 
I use interface int he classic sense.
 
and that is already defined here.
 
that is how people call it/use it.
 
@Vogel612 There are interfaces, but I'm not using them here.
 
The problem is, that the goal of any API is to provide a "good" interface, whatever that is.
and what's behind the interface is What it does.
the interface itself is How it does what it does.
 
7:46 PM
@ckuhn203 - if you had said: I decided to implement it using Enumerable.intersect(setA,setB) instead of setA.intersect(setB), is the implementation good?
 
I really do see this as a "Does my code look fat?" question.
> I'm concerned that the API is inconsistent.
 
instead you (effectively) said "I am not sure which one to use. For the moment I am doing X".
 
Are we reading the same question?
 
Argh.
@ckuhn203 - I see your question as having two parts.
part 1 is "is this a good design"
part 2 is "assuming this is a good design, is the implementation good".
 
aka "does my code look fat", right?
 
7:49 PM
Now, on code review, questions containing only part1 are off-topic.
 
I'm still not convinced that part 1 here is off topic.
 
questions containing only part 2 are always assumed to be "based on a predetermined" design, and the code review assumes that design is good, and, if the design turns out to be faulty, then, like any other 'bug' found in the review, it can be commented on.
 
In summary, This is how I wrote this. It feels clunky to me. Does it actually smell?
 
sure, that is how you think of it.
 
Thunderstorm here but i agree with chukn. Will comment more later
 
7:51 PM
@rolfl I think that is too ...
I don't think suboptimal design-choices are as heavy as bugs.
 
depends on the design, depends on the bug.
 
They're often easier to spot and in many cases not that hard to fix
 
Idk. Maybe I'm too close to this.
But distancing myself as far as I can, I don't see an issue with it.
There's code. It works. It does something. I'm not asking anyone to design it for me. I'm asking if it's usable.
 
It is my point that you are not sure what the 'something' in 'does something' should look like.
there is a two stage part to the review.
the first stage has to be to either confirm, or counter the 'signature' of the method.
If the reviewer agrees that your signature is right, then the review is easy
if the reviewer disagrees with the signature, then the whole thing is complicated.
 
Since when do we determine scope based on how hard it is to review something?
 
7:56 PM
all the time.
 
@ckuhn203 it's not about hard to review
 
if the code has bugs, even though it is otherwise reviewable, the question is off-topic.
 
but about: "makes sense to review right now"
 
bugs get fixed first before the review happens.
design decisions are the same.
 
Imagine someone came and said: "your design is crap"
 
7:58 PM
you have to decide what your code should do, and how it should look, before you ask us to review it, and confirm or challenge whether it it doing things right.
 
would there be any point in him telling you that your method implementing said "crap" design could be better?
 
if you can't tell us what it should do, how can we tell you it is doing it right.
and code review is not the right Q&A site for deciding what your code should do.
 
But this isn't asking what it should do. It's asking if how it does it is okay.
And that's certainly on topic, no?
 
how it does it is on topic.
 
It returns the same either way.
 
7:59 PM
my concern here is that, in your particular case, the actual method signature is critical to 'what' the code does.
 
@rolfl I think the problem here lies in the fact that, how it does it, is already implemented.
@rolfl I disagree
 
Metthod signatures = how it does it
2
 
What makes a method signature off topic?
Because that's what you're saying.
 
Writing on tablet = extremely slow
 
So, here's an example, OP didn't ask, but the method signature is certainly a valid part of the review. So, what's wrong with being unsure about it, and asking.
1
A: Adding string binary numbers

ckuhn203For now, let's ignore the fact that there are easier ways to add binary numbers. There are other issues with this code. Inherits System.Web.UI.Page Why is code that adds binary numbers inheriting from a UI class? There's no need for this. Separate the concerns and create a module for this...

 
8:02 PM
OK, Let me put together a more clear example of what I am talking about:
Fizz buzz is a group word game for children to teach them about division. Players take turns to count incrementally, replacing any number divisible by three with the word "fizz", and any number divisible by five with the word "buzz". == Play == Players generally sit in a circle. The player designated to go first says the number "1", and each player thenceforth counts one number in turn. However, any number divisible by three is replaced by the word fizz and any divisible by five by the word buzz. Numbers divisible by both become fizz buzz. A player who hesitates or makes a mistake is eliminated...
 
Assuming there's an implementation underneath it.
 
FizzBuzz.
 
ugh.
Okay.
 
A question comes up on Code Review:
I need to implement FizzBuzz. Here's my code.
On topic, or off topic?
On topic.
check.
A question comes up on code review:
should I implement fizz buzz using a % 3 and % 5 and string concatenation, or with a %15 for FizzBuzz"
off-topic, design decision only.
 
Agreed.
 
8:03 PM
Now a quesiotn comes up and says:
should I implement fizz buzz using a % 3 and % 5 and string concatenation, or with a %15 for FizzBuzz, Oh, and here it is and I implemented it using %15
On topic, or off topic?
 
Off topic.
 
why?
 
On IMO
 
Because it's contrived....
Seriously though, because OP hasn't made a decision.
 
Edit out thhe first sentence
And then it is on
 
8:05 PM
@SimonAndréForsberg that
 
edit out the first question and the design is 'decided'.
that is my IOQ.
 
Here's one @rofl.
 
no, no more.
Damn, I am hitting the chat rate-limiter like mad!
 
I wrote this implementation of fizzbuzz using %15. Would %3 and %5 have been better?
 
2 mins ago, by rolfl
should I implement fizz buzz using a % 3 and % 5 and string concatenation, or with a %15 for FizzBuzz, Oh, and here it is and I implemented it using %15
 
8:06 PM
On topic, or no?
 
off topic in my version of things.
 
I think it's on too.
 
I agree, too
 
So, an answer to: I wrote this implementation of fizzbuzz using %15. Would %3 and %5 have been better? could be:
> use a switch statement!
 
8:07 PM
@SimonAndréForsberg on a sidenote... mobile < tablet
 
that question invites a discussion unrelated to the code review.
 
@rolf why not?
 
It is a question about "does this question follow best practices"
 
In A vs. B questions, C is to be expected.
 
How is that not a valid review? May I remind you that you did that yourself?
 
8:09 PM
My past actions in no way reflect the discussion at hand ;-) !
 
And to point, Vogel suggested C to me earlier right in here.
I don't see how this is pertinent to the conversation.
 
Also, when I said use a switch statement, I was challenging a pre-determined design.
the question was not "which design should I use", it was "here's my implementation", and my answer was "use a different design".
 
So what' wrong with OP challenging his own design?
 
everything
 
I wouldn't put that into design FWIW
 
8:11 PM
Code review questions should be "is my ass fat", not "what's the best way to make it skinny".
 
How nice would that be.
 
OK. This discussion is a really challenging one, and time consuming.
 
My Cr questions are= my ass is fat, but I don't know how to make it skinnier.
 
I am getting stubborn about it too, and I probably need to step away from it for a while.
 
And if by that I challenge my own design decisions, so be it.
 
8:13 PM
@ckuhn203 - I appreciate your participation as a 'dummy' we can poke spears at!
2
 
I think you are trying to create a line @rolfl that people will have a hard time understanding. I think it will cause lots of problems.
Code review does not need another gray area
 
That's what I think you are doing ;-)
 
You're welcome guys. I apologize if I was a little too close to this. I am interested in the broader discussion.
 
The cool thing is probably: if we could understand @rolfls point and he'd understand ours, we probably wouldn't even realize what @Simon said
 
To me it boills down to: here is code I have made. Does it follow best practices?
 
8:17 PM
To me it boils down to: how should I write my program, and, by the way, this is what I have right now!
 
Now I don't understand what you are saying @vogel
 
What is it?
 
Such question should be asked as here is how I wrote my program, can it be improved?
 
@Simon well without the trouble understanding it, we couldn't imagin it's hard to understand...
 
9
Q: Quadtree design

MarianI have an application which is used for displaying and modifying huge volumes of point cloud data from lidar files (up to few gigabytes each, sometimes loaded in simultaneously). In the app the user is able to view a 2D image of loaded points (from the top) and select a profile to view in another...

 
8:23 PM
Logging off for now, back tomorrow
 
Now look at the answers.
cheers Simon, TTGH for me too.
(and catch up on some work when I get there).
 
Yep it's more of a programmers question with excess code...
But ima head to bed now.
 
Just one last parting thought, because I'll be heading home soon.
My question. It is a design question of sorts, but it's the last chance to change the design before making changes to it will break client code.
The design was decided on and implemented, now it asks for one last sanity check before it can't be changed.
Just food for thought.
 
exactly - we are not the place to be helping with debating the design (even though we are smart enough to).
and, if it is wrong (the design), then it needs to be fixed before the code is ready for review
 
And how would a single developer know his implemented design is broken if it's not "reviewed" by someone else?
 
8:27 PM
He can't.
 
I don't want an answer. Just throwing that out there.
 
and it sucks.
it's horrible.
but, just because there is no other good place, does not mean that Code Review is the right place.
 
True, but that doesn't mean it isn't either.
 
And, you, personally, have plenty of buddies in the 2nd monitor, and stuff, that can help you with that.
 
I do. Yes.
Idk. Lots to think on. I've gotta go.
 
8:30 PM
Asking if the design is OK is Off topic. Asking whether an implementation implements a design is on-topic. getting 'unsolicited' feedback about the design is what makes an OK answer a good answer.
 
I half expected there to be a single message here with either "Yes" or "No" and the room being frozen :P
 
Let me do that for you....
No
 
rolfl has frozen this room.
 
Cheers
 
Madara Uchiha has unfrozen this room.
 
8:40 PM
hehehe.
 
Although, why would interfaces not be on-topic?
 
11
Q: Questions about interfaces, protocols, and APIs

nhgrifAre questions about interfaces/protocols and APIs on-topic for Code Review? And when I say "protocol", I mean this in the Objective-C/Swift (and potentially other languages) version of the word, which is basically the same as a Java interface. There is this meta discussion: “Code not yet writ...

3
I have to go home, for real, but, it's basically that, if the interface needs to be changed, then the design is wrong too. So, only formatting and style reviews make sense for interfaces. At least, that's one argument.
Deciding whether a Java interface method should return int or Integer could be a big decision.
Gone
 
Has anyone considered this, perchance:
Seems like is pretty active there and is getting answers
But I don't have a horse in this race so I will leave it at that :)
 
9:41 PM
Per the earlier conversation @rofl. Doesn't this answer cover my question? I understand that things change over time, but if we're going to change it, then we better have a good reason.
7
A: Are questions about public interface (API) on topic?

Rik PoggiAre questions about public interface (API) on topic? Yes! If they are from a specific working piece of code. Quoting from the relevant part of the FAQ: If you are looking for feedback on a specific working piece of code from your project in the following areas… Best practices and de...

 
01:00 - 19:0019:00 - 22:00

« first day    last day (59 days later) »