« first day (691 days earlier)      last day (3327 days later) » 

12:00 AM
There are 1242 unanswered questions
 
Not a reason for it to be off topic here though.
(Just being the devil's advocate)
 
no, it's not, except for the fact that it has been defined as off topic here too.
 
@Legato I'm here now, if you are still here.
 
And I'm good with it staying off topic.
 
I am, but I think I messed up, starting over now...
 
12:01 AM
Brainfuck is not off-topic; does anyone actually use Brainfuck in a real application? Seems like LOLCODE would fall in the same category...?
 
Thanks Kevin - I'll take a look at SyntaxGenerator. Would you mind taking a look at this question too? codereview.stackexchange.com/questions/84932/…Kent Boogaart 2 mins ago
 
@Legato What are you making?
 
Anyway, I really recommend the essay I linked to. Very thought provoking. I just stopped by to share that.
 
@rolfl This would be the shittiest reason ever to say something is off-topic here given how often we tell SO users being on topic at CR doesn't make something explicitly off-topic on SO.
But, does PP&CG's scope include ungolfing?
 
12:03 AM
Ask them.
@nhgrif - helping people understand how their, or other peoples code work is off topic.
helping people golf their code is off topic.
 
It's really simple, lol. Using an OR operation on two binary numbers in two specific addresses and storing the number. That's the first half.
I think I just started to figure out what I did wrong though.
 
@Legato Simple or not, it's a start ;-)
 
I agree with both of these @rolfl I'm not suggesting either of these things should be on topic.
 
if you can, in a short paragraph, explain how golfing code, or creating a challenge to ungolf code, can possibly be ontopc, then post it to meta.
 
Yeah, It's like day 0, haha.
 
12:05 AM
I'm not saying EITHER of these should be on-topic @rolfl
Golfing code is clearly PPCG.
 
Then what are you saying?
 
1) Write pseudo-code for some particular something. 2) Because you're doing it for a code-golf contest, your original implementation is code-golf. 3) Later, you decide that this particular something that your golfed code does would actually be useful in your other very real project, but you don't want to commit code-golf to that project... so you come to CR to ask for help turning your original golfed implementation into actual commit-able code. — nhgrif 31 mins ago
 
because, i don't see an option C here.
> but you don't want to commit code-golf to that project... .....
at what point is your code ready for review then
 
In my mind, if a person has written golfed code, and can explain how it works; couldn't they easily ungolf it themselves? And if they didn't write it, and can't explain how it works, then it's clearly off-topic here. Not sure how PPCG would treat it
 
> so you come to CR to ask for help turning your original golfed implementation into actual commit-able code.
^^^ And how can you answer that question without giving code as an anaswer
 
12:07 AM
@Phrancis You should be able to make it "non-golf" pretty easily... but there's a lot of things I think askers should be able to do easily that they're consistently not able to do...
 
Like writing good titles I see your point.
 
A code-review question should always have the potential answer: Good code, this is a great example of ......
If you come here and say "I know this code sucks, I have not even tried to make it good, you do it for me..."
then it is off topic.
If you come and say: I tried to ungolf this code, this is what I have, is it good?
that's different.
> but there's a lot of things I think askers should be able to do easily that they're consistently not able to do...
^^^ yes, and we close those questions consistently too
 
@200_success's answer is pretty good. Most convincing thing so far.
 
I like that answer too.
 
> The standard I would use is, the posted code should be as good as the author write, to the best of his/her ability. At that point, it is reasonable to ask others for help to improve it.
 
12:11 AM
If you have a German car, and you're messing with the firmware, then that's about the only time Code Golf is on-topic on Code Review.
Would code with compiler warnings be automatically off-topic then? — nhgrif 7 mins ago
Your constant drive to get 100% coverage and understanding of messy, ill-defined, and undefinable problems is excrutiating
Code Review will never have a 100% satisfactory definition of scope.
3
never.
and, even if it does for you, it will not have it for everyone.
 
I'm not even driving for that @rolfl. I'm driving for consistency.
If LOLCODE is on-topic but ungolfing code-golf isn't, I need an explanation.
If ungolfing code-golf is off-topic because it can't possibly be the best possible code the authoer is capable of, and that's the criterion we're using for that, then are we going to use that criterion to close other questions?
 
LOLCODE is on topic for the same reason that Swift is on topic.
it is a language.
 
Okay, but all code golf is written in a language too...
 
code golfing is off topic for the same reason that scuba diving is off topic
3
 
Can't follow that one.
 
12:18 AM
it is not code reviewing
 
Well wait...
I'm not saying code golfing is on topic...
Ungolfing.
Because... what if I posted some stuff I know is code golf, but didn't mention that it was golf?
It was just a little one-line function, and came with an explanation of what it does, and I asked for help making it readable?
 
Ahh, OK, so then, is code that you wrote while drunk, and high, that you want someone else to make right, on-topic?
 
That's the scenario I was trying to describe with my meta question.
 
"To the best of you knowledge, does this code work?
 
The core question is "help me make this code intelligible."
 
12:20 AM
My dinner is here.
That is important to me.
 
I know what it does, I know it works, I've explained to any potential reviewers what it does.
I've given you enough context for you to compile, run, and debug it.
It's perfect... except it's a garbled unreadable mess.
We massively upvote questions like that all the time. The difference is they're usually huge chunks of code instead of something obscenely condensed.
 
@nhgrif Well, you could always try it and see how the community feels about it, if you're really curious to find out... Seems like it could be one of those "Grey Area" things.
 
I wouldn't even know where to begin in an effort to golf code, and it's not a "skill" I'm particularly interested in picking up.
Any code that I write that even looks remotely "obfuscated" is done so because it's more efficient and efficiency is important, and is never done so without comments.
 
Maybe it's better to leave "well enough" alone?
 
Hrmm?
 
12:26 AM
Well, the way I feel, on the very remote chance that someone would post a golf question that would actually be on-topic according to every other criteria... Maybe not worth spending a whole bunch of time arguing about it?
 
I just committed to CodeUnderstanding, and after having read just one of the questions on Area51, I'm already disappointed that I committed...
@Phrancis If I'm not asking with a or tag on the Meta, usually I'm asking a question that I think might have consequences outside of what I'm actually talking about.
For example, if the consensus were that ungolfing code is off-topic because golfed code "can't possibly be serious code", then don't we have to make and off-topic as well?
 
Fair enough
 
(That's not the consensus, so that isn't happening.)
If the consensus is that code that is clearly not the author's best effort is off-topic, then that rule 1) needs to be in the help-center, and 2) will end up closing some other things...
 
I was more learning towards the "good code" argument
The "clearly" part I guess is what I find difficult to define
In the hypothetical (and far-fetched) situation where a particular OP has learned to golf code from the get go, and that's all they know, then it is actually their best effort...
 
Wouldn't it be extraordinarily ironic though if there existed a StackExchange site whose entire point was to improve code that decided that some questions, despite containing working code, are "not good enough" to be on-topic for improvement...?
 
12:34 AM
Um, yes that would be ironic indeed
(and that is only my personal opinion)
I'm actually going to bring Brainfuck again, but from a different angle
BF is obfuscated by design, so I think we can use it as an example. If an OP posted "Print Hello World in BF" like this:
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
I feel that would be unreviewable and very damn near golfing
As opposed to (from Wikipedia)
[ This program prints "Hello World!" and a newline to the screen, its
  length is 106 active command characters [it is not the shortest.]

  This loop is a "comment loop", it's a simple way of adding a comment
  to a BF program such that you don't have to worry about any command
  characters. Any ".", ",", "+", "-", "<" and ">" characters are simply
  ignored, the "[" and "]" characters just have to be balanced.
]
+++++ +++               Set Cell #0 to 8
[
    >++++               Add 4 to Cell #1; this will always set Cell #1 to 4
^^ Clearly shows effort in making the code clear
 
You might turn this into an answer on my meta question... the point that BF is ofscated by designed seems very relevant to this discussion, given that exists and is on-topic.
 
OK I just might, after a bit of nicotine
 
I need to figure out the optimal time for posting blog posts.
 
Not sure if there really is one, unless you're targeting a specific region
Weekdays seem to see more traffic though because everyone's busy with RL on weekends :)
 
Thursday mornings?
 
12:48 AM
I don't understand why Brainfuck and LOLCODE is being compared to ungolfing code...
 
I don't understand why ungolfing code should be considered off-topic purely for the sake that it's tangentially related to golfing code.
 
I don't understand why ungolfing code should be considered on-topic.
 
Why should it be off-topic? (without making a point already covered by the help center, i.e. unclear, or asking for an explanation--we're talking about a scenario in which the code isn't unclear and the user isn't asking for an explanation of the code)
 
> we're talking about a scenario in which the code isn't unclear
I thought you said it was golfed?
 
The user has provided enough context for you to copy, paste, compile and run in your debugger, as well as a plain-English description of the code, and possibly even pseudo-code of what the golfed version is doing.
And the user is explicitly asking for help making it readable.
This isn't a "challenge" question.
 
12:53 AM
The scenario you are describing is so unlikely to even happen at the first place.
 
Unlikely and off-topic are two very different things. The likelihood of it happening shouldn't determine whether or not it's on-topic.
If people keep saying "this is SOOOOO unlikely, I'll just post a question myself.
 
I didn't say that it was the same thing.
@nhgrif doing that on purpose just because, in order to create a debate on it would be trolling IMHO.
If I know what the code is doing, and I am able to explain it for others, and I was able to write an obfuscated code for it, why would I ask for help in making it better?
> 1. Is it actual code from a project rather than pseudo-code or example code?
2. Do I want the code to be good code? (i.e. not code-golfing, obfuscation, or similar)
3. Do I want feedback about any or all facets of the code?
 
0
Q: Strongly Typed angle measures

glampertI often work with angles when writing code for 3D rendering and such. Personally, I prefer to measure angles in degrees, but many APIs (including the Standard Library) measure angles in radians. So more than once I have produced bugs by passing an angle in one measure when the function/library wa...

 
And point 1 you just posted is exactly why we bring up LOLCODE and BrainFuck. It's a really irrelevant point at this point in Code Review.
 
1. doubtful
2. okay, but you could have done it better in the first place
3. No, you don't want any feedback about it, you just want help in cleaning it up. "give me the codez"
 
12:56 AM
The other two questions, you could answer YES to.
We don't see questions all the time that say "Help me make this more readable"?
Why is on-topic to make Code A more readable but not to make Code B more readable?
 
Sure we do, but that's when users don't know how to do it themselves.
 
So what the asker is capable of determines what is on and off-topic?
Self-answered questions are now all off-topic.
 
I believe @200_success says it better than I do:
> If the code that is posted for review is deliberately obfuscated, then it was not written with the intention of being "good" code. The standard I would use is, the posted code should be as good as the author write, to the best of his/her ability. At that point, it is reasonable to ask others for help to improve it.

Posting code that is deliberately bad to begin with would make a mockery of the code review process
Self-answered questions are mostly when the OP does not realize how to clean it up at first, but then later realizes how to do it. Or, in some few cases, posting a self-answered question in a general-purpose meant way to show others how it is done.
 
Then could I post a self-answered ungolfing question?
 
You could. But five community members could also vote to close it as off-topic.
 
1:04 AM
And they have to use a custom reason.
rolfl's suggestion:
> I'm voting to close this because: code-golf
Somehow acceptable.
And if I start seeing that, I'll start with
 
or one of the existing reasons, if they see it fit.
 
> I'm voting to close this because: brainfuck
> I'm voting to close this because: lolcode
and
 
I think the key to un-golfing not being a good question is if you golfed it, then you know how to un golf it. Post your unfolded version for review.
 
We all have votes. You can vote to close as you want. I doubt others will agree with you in that case though.
 
I don't think un-golfing is off topic, but it would receive my DV.
 
1:07 AM
@RubberDuck But it's not impossible that you wrote a pseudocode version and then wrote a golfed version (and not an actual, compilable, ungolfed version). Yes, you may know how to ungolf it, but can possessing knowledge of how to improve your code even remotely make your question off-topic?
 
No.
Hence, I don't think it's off topic, but would receive a dv from me for lack of effort.
 
I'd downvote it too... because people shouldn't be code-golfing in the first place. I also autodownvote LOLCODE and BrainFuck, but I don't consider them off-topic and I don't close vote them.
 
I don't think it is possible to ask a non-"unclear what you are asking" ungolfing question without essentially self-answering your question inside your question. In which case it becomes a case of "code not yet written".
 
I'll try to find some time to write an answer for the meta. I think the other side of the coin needs to be represented.
That's a very good point @Simon. I can agree with that.
 
You can make the question clear by including pseudo-code and/or plain-English description.
 
1:12 AM
....which will essentially explain exactly, statement-by-statement, how to write the code the clean way.
So: VTC - Code not yet written
 
No, it will explain what the code does, not how to write it cleanly.
And the code IS written.
There's a compilable piece of code in the question which the asker is asking to be reviewed which 100% does exactly what he wants it to do.
 
No, the code is not written. You're asking others to write it for you.
 
How?
That makes ZERO sense.
How can you say that and leave every other question asking for assistance making the code more readable as on-topic?
You're making an abitrary distinction just because the word "golf" is involved.
What if the asker doesn't even mention that it was written as a code-golf exercise or it was made intentionally obscure?
He just wrote it like that, and someone told him it makes no sense to them, so he wants help making it readable so his colleagues can read it?
 
How would you answer an ungolfing question without providing the clean version of the code?
@nhgrif You can spend your whole life thinking "What if?"
 
In the same way you'd answer any other question asking for help improving the code's readability?
"single letter variable names are unacceptable. you should use descriptive variable names."
"you shouldn't ever really put multiple statements on a single line. white spaces goes a long way toward improving readability."
"single letter functions names are horrendous--I'd call this one fooBarFunction()"
 
1:17 AM
but if you wrote the obfuscated code, you know those things already.
 
How is that relevant, really?
Are all self-answered questions off-topic?
And given that we get non-obfuscated code that has single letter variable names, how do you KNOW that someone who wrote golfed code automatically knows that single letter variable names hurt readabilty?
 
If you wrote the obfuscated code, you didn't want it to be good code.
 
When it was originally written, perhaps not. But I'm not coming to Code Review because I want it to be really good.
I wrote it, and turns out it's an extraordinarily efficient method for doing X.
 
0
Q: Implementing OR with the lc-3

LegatoToday, something possessed me and I started learning assembly. My poison of choice is the lc-3, this is my very first program. It is actually only the first part of a two part problem, but this already took enough that I thought it merited a review, just in case the day's insanity also expresse...

 
My real project needs a really efficient method to do X, but my colleagues won't let me commit such an unreadable chunk of code.
 
1:20 AM
Then why are you coming to Code Review with your ungolfing question?
 
Is it not okay to come to Code Review when you want help improving your code?
Did I miss something?
Isn't improving code the ENTIRE point of Code Review?
 
Time out, everyone. What are we arguing over, anyway?
I'd like to propose that hypothetical Meta questions should be off-topic.
3
 
Sure it is. But the point of Code Review is not to deliberately ask about help with obfuscated code.
@200_success Amen to that!
 
The point of Code Review is to improve your code.
Making your code more readable falls under that umbrella.
 
@nhgrif You want to try asking a on-topic ungolfing question? Go ahead. But I bet I will either VTC as 'unclear what you are asking' or 'code not yet written'
 
1:23 AM
You can't vote to close as "code not yet written" if the code to be reviewed is in the question, compiles, works, etc.
 
We'll see about that.
 
How is that acceptable?
 
I mean it. Take a break, or I'll move the whole thread to another room.
 
Heaven forbid a couple users discuss what may or may not be on-topic on the site.
What's the point of the meta if not to determine site scope?
No one else is trying to have a discussion here that we're interrupting as far as I can tell.
 
@nhgrif Ask it and we shall see. Until then, I'm done discussing this topic. This is not the first time you're asking hypothetical meta questions but I surely hope it will be the last.
 
1:24 AM
It won't. I guarantee it.
When we don't ask hypothetical meta questions, a question gets put on hold and we have a specific question on the meta about it.
And that's okay... but we can pre-empt that and prevent a user's question being put on hold (which is a negative experience for that user)
Or close it and point them to a meta where that issue was already specifically discussed.
 
So... How 'bout them Red Sox?
 
I don't think it's worth it to establish a policy for every possible odd situation. A mountain of policy just raises the barrier to entry, which is something you don't want for a large collaborative effort. — 200_success ♦ Sep 7 '14 at 18:14
 
That meta wasn't even remotely hypothetical.
 
ironically posted to one of your previous meta questions. Although that one wasn't a hypothetical question.
@nhgrif I didn't say it was.
 
I disagree. Or rather, I disagree that a mountain of written policy raises the barrier to entry. If we're okay with this sort of answer, then the barrier to entry isn't raised. If we, however, are not okay with this sort of answer, the barrier to entry is raised regardless of whether or not there was a meta discussion about it. However, the barrier for entry is raised moreso if there's not a meta discussion about it, because despite it being policy, it's unwritten, so it's harder for newcomers to see or understand why the policy exists and they get little opportunity to speak their mind. — nhgrif Sep 8 '14 at 11:24
It's much easier to have an existing meta discussion to point to and let a user who doesn't understand why their question was closed read than to have to go through discussing their specific question for them because even though someone thought up the potential situation 6 months ago, 200_success banned hypothetical questions from the meta, forcing us to have the conversation while an actual question sits on hold in limbo.
 
1:35 AM
I have that power? Oops.
 
There's actually a recent case where a user posted a question, it was put on hold, we opened a meta and pointed the user to the meta about his question, and the user just deleted their question.
 
Problem solved. Let's move on.
 
Problem not solved.
 
78
Q: Thought experiment: What would happen if we didn't have close votes?

Jon EricsonAfter reading "My Love-Hate Relationship with Stack Overflow: Arthur S., Arthur T., and the Soup Nazi" one of our developers wondered what would happen if we didn't have close votes. Disclaimer: I don't know of any actual plans to actually get rid of close votes. Like legalizing marijuana, a chan...

 
Because the question might've been re-openable.
 
1:36 AM
"Might"?
 
> Alex, I am unsure of why you deleted your question. I want to assure you that the debate on meta, and in the site chat room has been very interesting, and I encourage you to come and talk about it. Your question, and circumstances have been hotly debated. You should be part of the discussion. – rolfl♦ Feb 28 at
 
@200_success Wrong. Let's move to bed. Time to sleep! (and situation well handled)
 
> Unfortunately the user has now deleted the question, probably as a result of the extended scrutiny it got.
9
Q: My code works in most scenarios, but this one scenario breaks, and I'd like help fixing that one scenario!

nhgrif My code works in most scenarios, but in this specific scenario, it does not at all do what I intend for it to do. I was hoping to have it reviewed and see if anyone could spot a fix. Is this sort of question on-topic for Code Review? Now, having answered your gut reaction on whether or n...

I'm going to bed.
 
Night @SimonAndréForsberg @nhgrif
 
0
Q: Compile-time printf-style format checking

Steve LorimerCompile time checking of printf-like format strings Inspired by this open ticket on boost, this seeks to complete the work there Given a printf-style format string and associated arguments, a static_assert is performed on whether the format string and arguments are valid. I'm particularly inte...

 
1:48 AM
SUPPORTED_TYPE(char,              'c');
SUPPORTED_TYPE(int,               'd');
SUPPORTED_TYPE(unsigned,          'u');
SUPPORTED_TYPE(char*,             's');
SUPPORTED_TYPE(const char*,       's');
SUPPORTED_TYPE(std::string,       's');
SUPPORTED_TYPE(boost::string_ref, 's');
SUPPORTED_TYPE(double,            'f');
SUPPORTED_TYPE(float,             'f');
That seems a little... unusual/weird?
 
Well, it's certainly an advanced C++ programming technique.
 
Guessing some enum-like thing?
#define SUPPORTED_TYPE(T, C) \
template<> \
struct Type<T> \
{ \
    constexpr static bool supports(char c) \
    { return C != c ? throw std::logic_error("invalid fmt for type") : true; } \
}
 
Is that what they call a "Template"?
Looks like some sort of primitive generics.
 
This question appears to be more suited to Code Review because it asks for opinions about working code. It is not really a good fit for Stack Overflow because it is open-ended with no clear problem to solve. — Radiodef 26 secs ago
 
I've never written a line of C++ in my life, and I still think this is weird. Am I misguided?
constexpr bool isSingleLengthSpecifier(const char (&fmt)[N], std::size_t n)
{
    // h | l | j | z | t | L
    return n + 1 < N &&
           (fmt[n] == 'h' ||
            fmt[n] == 'l' ||
            fmt[n] == 'j' ||
            fmt[n] == 'z' ||
            fmt[n] == 't' ||
            fmt[n] == 'L');
}
Or is C++ literally that hard to read?
 
2:06 AM
Think of it this way.
SELECT WHERE n+1 < N AND fmt(n) IN (`h`,`l`...)
kind of. You get the point I'm sure.
Well, no WHERE...
 
I'm following, I was trying to make sense reading the code, and I could kind of follow but couldn't get the thought out of my head that: the naming sucks || OP might be better served with regex
Or both
 
I suggest that you learn some C++ before complaining.
 
Yeah. Idk C++. It looks weird to me.
In general, not that code in particular.
 
… or in this case, a lot of C++.
 
I have noticed that C programmers really like short names for things though.
Historical reasons, I'm sure.
 
2:15 AM
@200_success Taken
 
2:33 AM
-1
Q: Runtime inheritance in Python

A T#!/usr/bin/env python class Foo(object): @staticmethod def hello(): return 'world' class Bar(object): def __init__(self, class_): tuple(setattr(self, attr, getattr(class_, attr)) for attr in filter(lambda _attr: not _attr.startswith('__'), ...

0
Q: In python, rectangularize a list-of-lists structure

paul23Well considering I have an iterated "lists of lists ..." (upto 4 dimensions) Now I wish to make the full list "rectangular" (or well each dimension equal in size). For a 4 dimensional case I've written out a specific version: x=[[[[4,3,4,5],[1],[2,2]],[[3,6,7],[2,3],[1]]],[[[1]]]] length0 = le...

 
Sure thing… edited. — A T 1 min ago
Still not a great question, but I think at least on-topic
Although... Still looks like example code I guess
 
3:21 AM
@Mat'sMug you around?
 
yeah
working on Refactor/Rename
 
how's that going?
 
pretty well.. only glitch is when DoSomething procedure is called from another class/module and qualified with its module name, like Module1.DoSomething
will be fixed in no time
:)
 
good to hear :)
 
oh and renaming modules/classes isn't implemented yet
 
3:23 AM
i was wondering, have you had a look at this question codereview.stackexchange.com/questions/85020/… ?
 
yeah, has my upvote, as well as RobH's answer :)
 
i really need to vote more...
2
 
made me think of my own code
and Jeroen' answer
 
i was wondering what you think of this solution
private IEnumerable<string> GetHeadOptions()
{
    yield return Head;
    yield return GetComponent<Camera>();
    yield return GetComponentInChildren<Camera>();
    yield return Camera.main;
}
Head = GetHeadOptions().FirstOrDefault(option => option != null);
where string is GameObject or whatever
 
is it me or successive yield return instructions look a bit weird
 
3:26 AM
they do, yeah
so, not a fan?
 
hmm
I like the ?? solution better ;)
 
fair enough :)
 
I'm missing something about hashcodes
the two are in the same project
that's why Module1.DoSomething doesn't get picked up
 
is there a declaration.Project ?
 
I'm not keeping the actual VBProject reference there.. should I?
then a simple reference equality would (should) work I guess... hmm
 
3:40 AM
i dunno, just trying to help debug
it does seem like a strange design to keep ahold of the hashcode, though
 
    public static class VBComponentExtensions
    {
        public static QualifiedModuleName QualifiedName(this VBComponent component)
        {
            var moduleName = component.Name;
            var project = component.Collection.Parent;
            var hash = project.GetHashCode();
            var code = component.CodeModule.Lines().GetHashCode();

            return new QualifiedModuleName(project.Name, moduleName, hash, code);
        }
5 mins ago, by Mat's Mug
I'm missing something about hashcodes
 
lol wat
 
...the intent is to avoid referring to projects by name, because the VBE allows 2 projects with the same name
 
i mean the var hash var code. how do you remember which is which?
 
and then I'm using the hash code of the string content of a module to determine if it was modified since the last time it was parsed. and oh, ...lol
yeah
public QualifiedModuleName(string project, string module, int projectHashCode, int contentHashCode)
 
3:44 AM
that seems like a bad idea
 
doesn't it
I'm very open to alternatives :)
I really messed up here
 
without really knowing the problem and the constraints, i think you should just keep a reference to the VBProject
 
I think so too.
and then I'll try to think of something to avoid hashing the module's content... if there's a way to avoid that
 
like, hashing all the code in the module?
 
yeah
talk about performance hit
 
3:49 AM
why are you doing that?
 
because I have no other way of knowing whether a module's code was modified since last time I parsed it
and storing an int instead of the whole entire string code works better, no?
 
is parsing slow enough that it's worth doing that?
 
yup
it's not only the parsing - parsing in itself isn't too bad. it's the parsing, and then walking the parse tree twice.
when a VBProject has like 20 modules, it makes a hell of a difference
 
i'd guess you'd want to use sha-1, like git does -- not gethashcode
 
that's not crazy at all
what's GetHashCode really doing anyway?
 
3:54 AM
or maybe you could use a FileSystemWatcher
@Mat'sMug what do you mean?
 
@mjolka I could, if the modules weren't embedded in an Excel workbook that might not have been saved since last parse ;)
 
@Mat'sMug ah, dang
ok here's a crazy idea that i haven't thought through at all
 
I mean I don't know how var magic = "hello".GetHashCode(); works under the hood, to return an int
 
excel workbooks are zipfiles, right?
 
yeah
 
3:57 AM
hm... maybe i'll think that through more
 
but I don't think anything gets to the disk until it's saved
in an ideal world I'd find a way to capture keystrokes in a CodePane, and determine if a module is dirty or not - where "dirty" is "modified since last parse" (i.e. not "since last save")
in the meantime hashing the string content seems to work. it just ...stinks
ok removed the project hashcode
building
ugh
 
4:15 AM
hehe... fixed!
thanks @mjolka!
 
np :)
 
oooh this is so freakin' cool!
I can refactor/rename stuff... in VBA!
even if a few kinks are discovered later on, it's still a priceless feature!
 
$20 bucks?
 
Jubilant
 
Cricket?
 
4:20 AM
1
Q: The Guiding Principles of Code Review

rolflWhat do you believe are the Guiding Principles of Code Review? What are the purpose and mission of the site? Recently (and not so recently) a lot of effort and hair-pulling has gone into discussing whether some questions or concepts are in-scope, on-topic, or useful on Code Review. Are there k...

 
@rolfl Australia vs. India ?
 
Yeah..
I figured something jsut happened to make you jubilant, then I checked the score.
 
: ))))))))) very smart
 
> Finch is switched and he has a piercing glare that will get the Indian bowlers worried. He needs to keep this concentration up as he has found it difficult to be his free flowing self so far.
Poetic
 
@StackExchange this should be IMO
 
4:24 AM
> Kohli is having a bowl! Dhoni is going for a shock decision and wants to try and buy a wicket, the crowd loves this change! Let's see if it pays off for India...
 
@rolfl and Epic (literally)
 
> You don't need someone else to tell you it's not good code if you already know it is not the best code you can do.
while true, I have to admit I don't always submit my best efforts. but I agree with the spirit of what I've read of that answer so far
> Asking people to tell you what you already know is a waste of your time, and theirs, and in some ways is disrespectful and inconsiderate.
that's pushing it a bit though
 
I thought hard about that one.
I think I stand by it.
 
if CR was only ever useful to the poster, it would be.
 
I tend to ignore questions/askers if I don't feel they have put in the effort I know they can do.
It feels like a "gimme the code" if they can do it already
but are just too lazy
 
4:29 AM
like that bit:
return parentContext is VBAParser.VariableSubStmtContext
    || parentContext is VBAParser.ConstSubStmtContext
    || parentContext is VBAParser.ArgContext
    || parentContext is VBAParser.SubStmtContext
    || parentContext is VBAParser.FunctionStmtContext
    || parentContext is VBAParser.PropertyGetStmtContext
    || parentContext is VBAParser.PropertyLetStmtContext
    || parentContext is VBAParser.PropertySetStmtContext
    || parentContext is VBAParser.TypeStmtContext
    || parentContext is VBAParser.TypeStmt_ElementContext
 
Uhm... ADHD much?
 
ADHD?
 
Attention deficit and hyperactivity disorder....
I am confused how you suddenlty changed to VBAParser... ;-)
 
I mean, I thought of implementing that part exactly as Jeroen suggests in his answer. but left it as is.
 
> If you ask a question and the code it contains does not please you, does not make you proud, or you don't feel has made the best of a challenging situation,
I acknowledge that compromises abound too
Anyway, that post is a combination blog, sentiment, and fishing dump from me.
 
4:32 AM
so "I don't like that part here" isn't being disrespectful to reviewers then
I'll just shut up and finish reading ;)
 
Disagreeing with a review, or assessing the circumstances in your code and coming to a different conclusion, is not disrespectful at all.
 
it's just.. more than once I posted, proud of what the code does, but not necessarily of how it's written - and without really spending the time to refactor and clean things up.
weekend/community challenge posts for example
 
... it's meant to inspire thought. Not decree a new site policy
The time constraints of a weekend-challenge are part of the "making the best of the challenging situation".
helping you to prioritize differently
 
right
 
infamous:
Nov 30 '13 at 17:15, by rolfl
Also, I think I fell in to the 'get-it-done-fast' trap, and it shows.
 
4:42 AM
haha
dude, that meta post is totally epic.
 
I think (and I am still stewing it over), that it covers what I consider to be the scope and bounds of code review.
 
absolutely. and what I've (we've?) been calling "the spirit", too
 
whether I am right, or wrong, it's how I think about it....
Yeah. For me the 1-sentence thing is important. I know it is 'management speak', but it gives me a way to tie together the desired outcome of every Q&A... the ideal start and end goals.
 
and a bit of a TL;DR ;)
 
1 sentence, with notes.
> Code Review is a site where you can present your best programming efforts in an ego-sensitive environment in order to receive constructive and honest criticisms designed to help you be a better programmer.
 
4:58 AM
0
Q: Always get Broken pipe use sendUrgentData in my Socket Client

chanjianyiI wrote a SocketClient for connect to the socket, and add some callback in it. public class SocketClientV2 { public static void main(String[] args) { SocketClientV2.Listener listener = new SocketClientV2.Listener() { @Override public void recv(byte[] result...

 
5:24 AM
'night CR
 
^ ditto :)
 
tritto ^
2
 
5:42 AM
0
Q: switch case in web api controller

Rohimy web api has 3 controllers for get,post and users CRUD. I named it as DetailsControllor,FormControllor and AuthControllor. In details controllor I used swich case to find out which type of details needed. But I found that code is repeated in switch case. can I use generics to minimize code or i...

 

« first day (691 days earlier)      last day (3327 days later) »