So I just created my first GitHub repository and started to wonder if there would be any reason why somebody shouldn't post their code. I don't mean the obvious, such as code that is IP of somebody else or any other possible legal situation; I'm talking about a newbie posting their own, albeit terrible, code.

I've heard several times on this site that one of the things that a some of the hiring managers do is check out the person on Github (or similar site), so what if the code is lacking? Would the position desired—for example, if I'm going after a junior developer position instead of a senior developer position—matter?

Put it wherever you can upload your bugs, wiki and code somewhere else even if the site goes down for a month. This means you need access to that data on demand, without having to use an XML parser to pluck your data out of arbitrary views. I almost answered this, but really, it's too simplistic.
–
Tim Post♦Jun 28 '11 at 10:38

6 Answers
6

The purpose of private repositories is to save your code without having it in the open. Such as programs that are proprietary for you at the moment and that you don't want to share. Effectively it's just a place to back-up your private code in a remote repository.

Regarding your worries that your code may be lacking if you publish things openly; you shouldn't fret too much about it. Just having an account on github (at the writing moment) tells me that you're in a higher echelon of programmers and in my experience recruiters only check the code briefly on what you've done. Even though you have some mistakes in your code it is still a better gauge for your prospective employer that you can actually do stuff, which matters more than anything.

Almost 99% of all candidates don't give any indication in their resumé on how much they can program or design a program. Heck, some "Senior Java programmers" I've met were so clueless that they didn't even know what an interface is or why they would use it.

Open source projects are generally hosted for free on these sites, so make two accounts. One for your hobby sandboxes and another that you don't mind the general public looking at. Publish the username of the good one.

There's no harm in hosting on GitHub or Bitbucket. In fact its accessible from anywhere and you can attract other developers to contribute. You could use private repos if you don't want to make projects open source.

And it depends on the hiring manager on how much impact a good github profile makes.

Can't think of anything other than shame or humility. Others have said this much better before, but those are very important personal qualities in a programmer. That's not to say that you should tell everyone how terrible your code is, but they can result in someone striving constantly to improve their work. And the field of programming is so mind-bogglingly huge that nobody can possibly learn everything, or even close to it. So be confident that while any programmer can find faults (objective or subjective) with any other programmer's code (or their own), that doesn't mean your code should be hidden away.

I strongly agree with the accepted answer there. The sum of all things visible about you online is your personal balance sheet. You want to make sure to display as many assets while minimizing liabilities.

If I come across your name and find some of the code you wrote, I can't tell if it's some toy program you didn't care about or if this is your best work.

I just posted my first project on GitHub myself, and I spent good amount of time making sure it is readable by someone other than myself.

If you are just looking for storage, I would take other people's advice and use one of other repositories (online or offline). Personally, I also use Perforce at home (I have no affiliation with the company) for my toy projects. It is a very mature and good product and it comes with 2 free users, so if its just for you, you get full, professional, non-crippled in any way version control system for free.