Posts

Showing posts from October, 2017

Contributing Some Go to Rosetta Code

Image
In any craft the best results are usually achieved by using the right tool for the job, so the Rosetta Code site is an invaluable resource for thoughtful programmers. There you can compare attempts at solving problems ('tasks') idiomatically in many different languages. I thought some of the gaps in the Go coverage should be addressed… I started off with Smith Numbers - just by rewriting the existing C version in Go. It's interesting to compare the versions side-by-side; it seems clear that the Go version is less cluttered and therefore a little quicker to comprehend. Next Calendar , a classic task I haven't considered since college days. I wrote that from scratch, populating a data structure first, then displaying it. On to Combinations and Permutations where use of the standard math/big library made things very easy. Again, it's interesting to compare the readability of the code with some of the other languages implementing this task. For the A