SoundAxis/WrenchMG — pull request #1 by RobSeder (2014-12-21 02:27:34+00:00)
Title: Here is a draft of some changes.

Paul,

Since you are using the "Shared" library approach, that is a problem because you can't really test that code (with unit tests). As I dug into the code, I realized I would probably approach things somewhat differently in a few others ways too (namespaces, naming, folder structure, etc).

So, rather than modifying your code, I created an "src" folder and put a solution under that with a PCL library and a unit test project.

It's a good idea to not put your source directly in the root, because you can't then add other things. A common convention is to have "src", "docs", and "bin" off the root of your source control, and then your VIsual Studio solution could be under \src\. if you have documentation, that can go under docs, and compiled binaries or nuget packages could go under \bin (as that is a deliverable, not so much that it needs to be a binary)

With that said, since I was way off the rails, I just went through the code as I would normally for an API. I added XML code comments, argument validation, used full names, and in a few places made some architectural changes. For example, even in non-functional code, it's a good idea to have a little state in an object as possible. Better, is if you set the state upon object creaation (in the constructor), and then make anything public read-only. So, I used that model (from Bob Martin's "Clean Code", and "SOLID principles", if you are familiar).

Please see the "changes.txt" file in the root of the PCL project for a list of the major things I changed and why.

I wrote ~20 tests, and for the couple of classes I attacked, those have near-complete code coverage.

I put in a few hours into this, but before I invest any more, I wanted to see if this was heading in the right direction. If it is, or if you have comments, please let me know - I have zero "ego" about my code. My loyalty is to a high quality codebase, not my personal code. If not, that's OK too. I just wanted to see if I could offer something useful - and also take this opportunity to explore HOW to contribute to an open source project on github. I will do a quick blog post about that too (from the consumer perspective) of how one needs to fork, fetch, merge, push, and then do a pull request. You can see that here: http://blog.robseder.com probably later tonight.

So again - I'm fine either way. I'm not sure if you are looking to go in a different direction, or if you NEED to use the Shared LIbrary approach. However, if you want me to keep going with my approach here (with any comments or preferences from you) - please let me know.

Lastly, I didn't make ANY changes to your existing project, so if you wanted, you should be able to safely accept this pull request if you wanted to explore the project. Alternatively, I can .zip it up and e-mail it to you, instead of you accepting the pull request.

I had fun digging into your project, please let me know if I should do more, or bow out. No hard feelings either way. Thanks!

-Rob