User talk:Dchapes: Difference between revisions

From Rosetta Code
Content added Content deleted
Line 10: Line 10:
::It's kind of sad that the way sites like RosettaCode are done make it hard to do the "right thing" for languages like Go (multiple files, with extra test code files and separate main "demo programs", proper revision control, etc). Among other things it doesn't let us show off one of the great aspects of Go (IMO) which is the testing and build infrastructure.
::It's kind of sad that the way sites like RosettaCode are done make it hard to do the "right thing" for languages like Go (multiple files, with extra test code files and separate main "demo programs", proper revision control, etc). Among other things it doesn't let us show off one of the great aspects of Go (IMO) which is the testing and build infrastructure.
::Actually, on that note, does it makes any sense (and is there a reasonably nice way on RosettaCode) to provide extra non-example test files? Something that doesn't show up directly on the example page (it would be clutter and take away from the purpose of simplified examples IMO). E.g. for some of the examples I've submitted I have an associated non-trivial <code>*_test.go</code> file and if someone else wanted to cleanup/change/add-to the example later it might be convenient for them if they had that too. &mdash;[[User:dchapes|dchapes]] ([[User talk:dchapes|talk]] | [[Special:Contributions/dchapes|contribs]]) 15:15, 3 September 2014 (UTC)
::Actually, on that note, does it makes any sense (and is there a reasonably nice way on RosettaCode) to provide extra non-example test files? Something that doesn't show up directly on the example page (it would be clutter and take away from the purpose of simplified examples IMO). E.g. for some of the examples I've submitted I have an associated non-trivial <code>*_test.go</code> file and if someone else wanted to cleanup/change/add-to the example later it might be convenient for them if they had that too. &mdash;[[User:dchapes|dchapes]] ([[User talk:dchapes|talk]] | [[Special:Contributions/dchapes|contribs]]) 15:15, 3 September 2014 (UTC)
:::You can always add subpages. If you just go to http://rosettacode.org/wiki/task_name/Go/whatever_test.go you can create the page, add the text of your test file, and then add a link on the main Go example. We already make subpages for long examples (e.g. [[Pythagorean triples/Java/Brute force primitives]]) so it's not out of the ordinary. Putting links on the task pages to separate pages with more detailed information sounds like a great way to let people dig deeper if they so choose. --[[User:Mwn3d|Mwn3d]] ([[User talk:Mwn3d|talk]]) 15:45, 3 September 2014 (UTC)

Revision as of 15:45, 3 September 2014

Go Sum digits task

[This is in relation to Sum digits of an integer, id=188562. —dchapes]

I don't know what was going on with the non-working tests. Good catch there. Also I don't know why I thought it was worth the complexity to share a function with Digital root. This seems beyond the scope of either task. I'd be in favor of converting Sum digits to a main program like most of the other Go solutions. —Sonia (talk) 03:17, 3 September 2014 (UTC)

Sounds good. I might do that soon-ish but it's not a high priority for me. Of course, feel free to make such changes yourself (and take the opportunity to clean up or simplify my stuff) if you're so inclined.
It's quite possible the old test may have worked pre-Go 1.0. The only actual breakage was that the test function was testSum rather than TestSum and was not found or run by current go test invocations. Although I also chose to also change it from using package digit_test black box test style (which other than for Example* "tests" I'm not a fan of), that wasn't an actual problem.
It's kind of sad that the way sites like RosettaCode are done make it hard to do the "right thing" for languages like Go (multiple files, with extra test code files and separate main "demo programs", proper revision control, etc). Among other things it doesn't let us show off one of the great aspects of Go (IMO) which is the testing and build infrastructure.
Actually, on that note, does it makes any sense (and is there a reasonably nice way on RosettaCode) to provide extra non-example test files? Something that doesn't show up directly on the example page (it would be clutter and take away from the purpose of simplified examples IMO). E.g. for some of the examples I've submitted I have an associated non-trivial *_test.go file and if someone else wanted to cleanup/change/add-to the example later it might be convenient for them if they had that too. —dchapes (talk | contribs) 15:15, 3 September 2014 (UTC)
You can always add subpages. If you just go to http://rosettacode.org/wiki/task_name/Go/whatever_test.go you can create the page, add the text of your test file, and then add a link on the main Go example. We already make subpages for long examples (e.g. Pythagorean triples/Java/Brute force primitives) so it's not out of the ordinary. Putting links on the task pages to separate pages with more detailed information sounds like a great way to let people dig deeper if they so choose. --Mwn3d (talk) 15:45, 3 September 2014 (UTC)