News for hackers. Stuff that matters.
Re:Show HN: I started a repo for sharing algorithm implement... by IgorPartola on Monday December 23, 2013 @09:35PM (#6957935)
I like this idea. Here's how I'd expand it if I had 100 hours to kill:

- Rename the repo to be shared and add yourself as a contributor, instead of branding it as yourself.

- Organize the files by src/ALGO/LANG/author-name.EXT. That way the emphasis is on the algorithm, then the language. I don't care much about who implemented it, other than to differentiate it from others' implementations for quality, etc.

- Provide a common-ish API. You don't want to stick your entire algorithm into main(), that's not useful. You want a nice clean interface, so that the consumers of this repo can copy-paste these clean implementations into their own code. Maybe remove main() entirely, and stick it into src/ALGO/LANG/main.EXT. That way I can consume an entire file from your repo without modifying it.

- Provide unit tests. If you separate out main(), you could do stick all the tests into src/ALGO/LANG/tests.EXT. The value of this type of repo would be that I can grab a clean, well tested copy of -sort and use it directly.

- Edit: Change from underscores to dashes in filenames. Underscores are for losers :). Use dashes whenever you can.

- Add lots more algorithms, not just basic ones.

- Get a few friends to add some algorithms, then thoroughly review them in comments on GitHub.

- Provide speed test comparisons of each implementation, stick them in src/ALGO/LANG/speed-tests.EXT

- Now that we are getting fancy with the testing, etc., provide a Makefile or some such for building the various test programs and running unit and speed tests on them.

- Edit: Stub out lots of potential algorithms. Even if you don't know how to implement them, create the directory and main.EXT for them, then open a ticket so that others can implement them. Give everyone that submits a pull request committer access, so they might work directly on this repo and not deal with any friction by having to wait for you.

There is probably more, but the above would eat nicely into that first 100 hours. I have no idea what you'd personally get out of this on the other end. Probably nothing. On the other hand, this could become the repository to check for a weird "2x faster with smaller memory usage" implementation of a red-black tree, or a clever general number sieve, etc.

Re:Show HN: I started a repo for sharing algorithm implement... by kennyledet on Tuesday December 24, 2013 @12:48AM (#6958420)
Sorry I replied to this one late. I was waiting til I had a bit more free time to reply to this one seriously.

You have a ton of great suggestions in here, all taken into consideration and this will definitely help the repo be much better by tomorrow. I will get on it. Thank you.

Most helpful post in the thread vs. "lel it's already been done xD links to wiki site"

>On the other hand, this could become the repository to check for a weird "2x faster with smaller memory usage" implementation of a red-black tree, or a clever general number sieve, etc.

Precisely my aim. Thanks for understanding this!! Apparently other people think I'm trying to make it a primary learning resource or something...

Re:Show HN: I started a repo for sharing algorithm implement... by mkl on Tuesday December 24, 2013 @07:17AM (#6959142)
Missing from the discussion seems to be the subject of licenses. Some of the files have one and some don't (making using the code murky), so you should probably establish a rule of an explicit BSD license or something. "Public domain" isn't suitable as some countries make it difficult or impossible for people to give up copyright (that's why CC0 exists, but I'm not sure how well that works for code).
Re:Show HN: I started a repo for sharing algorithm implement... by kennyledet on Tuesday December 24, 2013 @05:03PM (#6961292)
Ah yes, you're right. I didn't think far enough into it before I pushed the initial commit. I guess I was just excited, but this is perhaps one of the most important changes that need to be made. Thank you for bringing this to the forefront of my mind, it will be a new convention now.
Re:Show HN: I started a repo for sharing algorithm implement... by DallaRosa on Monday December 23, 2013 @09:51PM (#6957976)
Re:Show HN: I started a repo for sharing algorithm implement... by IgorPartola on Monday December 23, 2013 @10:52PM (#6958133)
Nicely done!
Re:Show HN: I started a repo for sharing algorithm implement... by X4 on Tuesday December 24, 2013 @12:26AM (#6958358)