3 ms·
Could be great. Couple things some obvious I'd guess: Can run the code... but, not the tests, which would make in-place refactors considerably easier. Clickin
by pkroll 10y ago
Could be great. Couple things some obvious I'd guess:
Can run the code... but, not the tests, which would make in-place refactors considerably easier.
Clicking Gear for settings doesn't go back to edit window when you're done and you click the Gear again, which is how I first tried to get back to the editor.
No place to set "license" specifically for each piece (and maybe a default in your account settings) making it impossible to take the code and use it without opening Pandora's box.
So little there, and all six days ago... you could grab examples from open source projects and put them in, if you could do that while obeying the license on the code (which comes back to at least showing the license, and maybe also linking to the URL for that piece of code or project).
As this is ultimately "one piece of code with several examples of another piece of code to replace it" despite it being for refactoring, you can imagine it'll be used for "this was a bug, this is the fixed version." Might be useful to provide specific support for that somewhere down the line.
- marcamillion 10y ago> Can run the code... but, not the tests, which would make in-place refactors considerably easier. That's definitely something that I would love to implement in the future - if I can find a way to make it viable. This was just v1 to see if there is even a path that makes sense. >Clicking Gear for settings doesn't go back to edit window when you're done and you click the Gear again, which is how I first tried to get back to the editor. Yeh, I am using the API for Glot.io -- which provides no way to customize that iFrame. So I am stuck with that functionality for now. >No place to set "license" specifically for each piece (and maybe a default in your account settings) making it impossible to take the code and use it without opening Pandora's box. Ohh...this is interesting. Never considered the 'license' bit. Is that really an issue though? You can't add a license on SO, and that doesn't seem to stop people from pasting code snippets. >So little there, and all six days ago... you could grab examples from open source projects and put them in, if you could do that while obeying the license on the code (which comes back to at least showing the license, and maybe also linking to the URL for that piece of code or project). I agree fully, and it seems like it should be pretty easy to do from OSS projects, eh? The issue I ran into was identifying what snippets of code really needed to be refactored and why. That's the counter-intuitive bit, in order to be able to explain why something needs refactoring you have to fully understand what it does. I can most certainly do that for some Ruby code (where most of my experience lies), but once we get into other languages I am kind of outside of my depth (to be frank). So another alternative is to simply search GH Issues for the term "please refactor me". I tried that too, and most of the immediate stuff I found are usually too old or too basic. That being said, if you have any suggestions on specific bits of code from OSS projects you have used that you have seen that could be a good candidate please feel free to share them. I am definitely going to be looking myself too. It's just not as 'slam dunk' as it appears at first thought. >As this is ultimately "one piece of code with several examples of another piece of code to replace it" despite it being for refactoring, you can imagine it'll be used for "this was a bug, this is the fixed version." Might be useful to provide specific support for that somewhere down the line. This is very interesting and I would love to hear more about what you are thinking. Do you mean like someone would post a snippet of code that has a bug and ask for the community to fix it? Then the site would track the various iterations and show the final version? If so, that does sound intriguing and is inline with some other ideas I have. If not, I would love to hear what you meant or just some more thoughts on potential future direction. That being said, thanks for even taking the time to give me such a thoughtful response. I really appreciate it.
- pkroll 10y agoYou're welcome: thanks for making the thing in the first place. :) I don't think people have trouble posting snippets to Stack Overflow and the like, but I do think people have trouble (now or later) USING the snippets posted. Some discussion of the issues at [1]. Still only a few items there. Honestly, for a refactoring site? I'd suggest the things to add would be: all the classic refactorings, for any language you're familiar with. The problem with searching Github for examples is they apparently took out commit-message search a few years back, so you can't search for "refactored" in the commits... just the Issues, which are going to be fewer and less useful. Tried searching Google for "github example refactor" and that shows up several projects. They won't be as "in the wild" as a good refactoring, but they're probably a reasonable place to start. [1] http://meta.stackexchange.com/questions/12527/do-i-have-to-worry-about-copyright-issues-for-code-posted-on-stack-overflow http://meta.stackexchange.com/questions/12527/do-i-have-to-w...