What's pushing you to program your own miner. Are you planning into releasing it and getting a fee for every user?
It's a worthy task the OP has set his heart about to do,and it doesn't matter for which gain or how he intends to go about it
What his thread does show is intent,on developing himself,learning and in the end giving back to the community.
I actually know nothing about mining,so I may be if little help,i hope someone who does directs you effectively