# Should you post basic computer science homework to your github?

I am currently taking computer science coursework as part of a computer science related degree at my University. I was wondering if I should upload the solutions I make for various trivial homework assignments (ie. not more than 20-30 or so lines of code, on basic/fundamental topics) to my GitHub account, or if I should only upload larger course/personal projects to it. I have only been regularly coding for about a year, and a large portion of the code I have written was for a company where I was under an NDA, so I was wondering if this would be an appropriate way to add more breadth to future job applications.

• I don't think simple exercises will add much to your portfolio. – Yuval Filmus Dec 28 '20 at 21:05
• Did you consider contributing to some existing open source project, like fish, GNU bash or RefPerSys ? – Basile Starynkevitch Dec 29 '20 at 6:19
• Yes, but full-time coursework and employment gets in the way of making significant amounts of progress on outside projects. I figured since I'm coding anyway I might as well add it on to my portfolio, so that way employers could tell I'm not just sitting around not coding anything at all. – nyomu Dec 29 '20 at 18:59

No, solutions to homework assignments are not likely to impress potential future employers.

Many professors would prefer that you not post solutions to homework assignments to public Github repositories. Why? If they ever reuse those problems in a future semester, then by making the solutions publicly available you are creating a temptation to cheat for other students, and that can be detrimental. So it would be a kindness to avoid publicly posting solutions.

If you are a student, you can get free unlimited private repositories on Github that you could use for homework assignments. Just make sure not to let them revert to public when you graduate.

• Minor nitpick but free unlimited private repos are to everyone now on github, though students should still take advantage of the developer pack – questionerofdy Dec 29 '20 at 6:07
• That really depends on what the assignment is. Sure, implementing some sorting algorithm is probably not going to impress employers, but if you happen to get an assignment like implementing an actual application over the course of a semester, I don't see why not. I'm not sure if this is common where you're from (I assume not, given the tone of this answer), but I had a few projects like this during my degree. – Noctiphobia Dec 29 '20 at 16:32
• The fact that many professors would prefer that one not publicly posts solutions to homework assignments it's something that, in my opinion, should be better fought rather than supported, and should not deter students from possibly showing-off their skills (a similar opinion of mine on a related matter). – Massimo Ortolano Dec 29 '20 at 18:05
• @questionerofdy Other Git hosting services (e.g. codeberg.org, sr.ht) do more, work better and are less likely to cause problems for you in the future. (sr.ht is not free, though, except in its alpha.) – wizzwizz4 Dec 29 '20 at 18:48
• @Noctiphobia The OP specified not more than 20-30 lines of code on basic/fundamental topics. – user3067860 Dec 29 '20 at 19:42

I'd recommend that you talk with your professors. No one here can speak for your professor (unless your professors is here).

From my experience, I'd bet that most professors would love your enthusiasm but be very reluctant to allow it because of the issues with plagiarism and academic integrity. If you discuss it with the professor you may find that they are open to extra credit projects or something to give you some opportunity to add to your repositories. Go into the discussion fully expecting it to be a long shot.

I've had quite a few syllabi state that storing class work in a public repository would be considered a breach in our academic integrity policies, but at the same time I've also been given permission from other professors to use GitHub public repositories on a number of projects. It usually came down to if the mission of the project is unique to the student/team. When every team is creating a one of a kind project, it usually becomes less of a problem to create a public repository. The best luck I've had getting public GitHub repository approval was with professors that offed independent study extra credit opportunities and when we had group projects.

In any case, never assume that you can upload any coursework to a public repository! Discuss it with your professors.

• "never assume that you can upload any coursework to a public repository": let me add that this advice is probably culture-dependent. In the German academic culture I experienced, the default was that you can share anything. In fact, our student council publicly collects old written/oral exam questions. And professors know this; some even recommend you to take a look at them. Rarely do they kindly ask you to not publish things, knowing they couldn't/wouldn't want to go down to legal path of forcing you anyway. – ComFreek Dec 30 '20 at 12:09
• @ComFreek that’s a good point. I believe the pros of taking this advice outweigh the cons in general because asking will likely do little harm regardless while, depending on the situation, making an assumption can lead to complications. – Joshua096 Jan 2 at 12:46