r/AskProgramming • • Sep 22 '21

My professor recommends us making a GitHub account as soon as possible. Why should I?

It's an honest question. His reasoning was like ""in a couple of years, when you graduate and look for a job, you'll be able to show them that you used github for the past couple of years"" and I get that. But right now I'm making programs that are too simple and that are introductory. Like create an array, print only the odd numbers from an array, write Hello world in a .txt file. Scan a .txt and count the occurences of a given word, etc.

58 Upvotes

62 comments sorted by

99

u/scandii Sep 22 '21

the entire (modern) programming industry uses git.

the sooner you start getting used to git, be it github, gitlab, your own repository on a pi somewhere, the better.

on top of that, during your university years you will more than likely build projects which are passable to show off, but will be left collecting dust on a USB-stick somewhere before it gets reformatted to host as storage for three three horror movies during movie night.

so all in all, there is no reason not to start with github now, and you can set projects to private should you wish, and especially getting used to the amazing features that git offers you for handling projects, especially if you have collaborative projects down the line with your course colleagues.

4

u/ajax333221 Sep 22 '21

I didn't know we could have private repos again for free, interesting.

I somehow missed this news for 2 years lol.

0

u/[deleted] Sep 22 '21

[deleted]

6

u/wrosecrans Sep 22 '21

It's a bit like asking if a project is 'big enough' to use a text editor with undo.

41

u/Vakz Sep 22 '21

You could think of it the other way: start learning git now because your programs are simple. It gives you a chance to learn the basic things. Learn how to commit and push. Learn how to add things to an existing commit (The "Oops, I only committed one of the two files I edited" situation). Take the chance to get into the habit of making atomic commits, containing only what the commit message says it does. Learn how to set up new branches for each assignment, merging them into master only once you're done.

This is about forming good habits, not just about versioning code.

This may seem needlessly complex, but if you learn these things now, while the code itself is still simple and you're working alone, you're going to have a much easier time collaborating with other people, when you also have to get into the more complex areas of merging and rebasing.

7

u/born_in_wrong_age Sep 22 '21

Yeah. I was young and dumb, and years later, i ended up learning about rebase in a live project... That was not fun

5

u/[deleted] Sep 22 '21

I think I've worked with you....

3

u/born_in_wrong_age Sep 22 '21

Oh, trust me, you haven't. I am the only tech guy in my company. Imagine learning about more complex git stuff while at work. So far, nothing broke!

0

u/[deleted] Sep 23 '21

[deleted]

1

u/born_in_wrong_age Sep 23 '21

Yeah, now I feel that. I can't write a single line of code without git besides it lol

12

u/Ikkepop Sep 22 '21

Your professor is right, using git is a great and mandatory skill to have, but more then that, it's just a great habbit, and habbits take a long time to build, so start now.

11

u/Shadow_Gabriel Sep 22 '21

When hiring a newcomer, I would be more interested in seeing some basic code that has proper formatting, naming convention, codded using best practices, documentation, proper usage of branches and the commit messages are detailed.

8

u/cahaseler Sep 22 '21

I'm a hiring manager. If I had to choose between two entry-level developers, one of who has 3 years using git for simple projects and one who has done simple projects but hasn't got the experience with git, I'd choose the one with git experience every time. Being comfortable with git is one of the most important skills you can have.

3

u/richhaynes Sep 22 '21

This. The hiring manager just wants to know you competent in git. This is best done through demonstration which needs to be short and succinct. Having a few small and simple git projects is better than some complex project that is more than the hiring manager needs or wants to see.

6

u/skellious Sep 22 '21

People viewing your git history can see how long and how often you've been making commits for. a solid history of commits shows you know how to use github which is important.

Additionally, uploading portfolio pieces, even simple ones, onto there will help a prospective employer see you didn't pick up programming only a week ago.

6

u/hov940 Sep 22 '21

If you don't feel comfortable with your beginner projects being public, you can make the repositories private and thus only you can see them.

4

u/fightsgonebyebye Sep 22 '21

You don't have to make every repo public. You can hide or remove ones you would not like to showcase in the future. Even still, I can't imagine a company being like "wtf, this guy was just learning how to create arrays 4 years ago. That project he just finished on a live app is meaningless now!"

6

u/drBearhands Sep 22 '21

Adding to what has been said already, you'd be surprised to learn how simple most industry activities are. Validating data and calling some library functions cover most of what many companies need. It probably is a good idea to keep one or two simple code projects in there so that people at lower development skill levels (like the manager who's going to decide whether to hire you) can see you understand the thing they also understand. I was once rejected for a position because I "didn't know REST"... I did, but wasn't using the (broken) pattern the hiring manager was expecting. Never mind knowing over a dozen programming languages in many paradigms. Yes I am salty over that one, though I probably dodged a bullet.

Besides that, you might always consider your current project to be "not good enough". Just hide any project you consider too simple for your current level ("hello world" probably counts).

1

u/[deleted] Sep 23 '21

I was once rejected for a position because I "didn't know REST"

Urgh. This is such a ridiculous attitude. As if engineers are incapable of adapting, and you couldn't just walk in there and "do REST" their way if that's what they wanted.

3

u/kbielefe Sep 22 '21

Git is very useful even on small projects. It gives you checkpoints that make it easy to answer questions like, "What changed since the last time this compiled?"

GitHub is useful as a backup, in case your hard drive crashes or your laptop is stolen. It lets you work from multiple places without carrying your code around, for example if you work from school computer labs sometimes. It makes it easier to collaborate with others.

As far as a job search, use of git and GitHub would give you a slight edge. We expect to have to teach new programmers, but it's always nice when we don't have to break them of habits like writing 4 different versions of their code in the same file.

5

u/drlecompte Sep 22 '21

Lots of people in the comments seem to be equating GitHub to Git. They are not the same at all. Git is probably the most widely used version control system today, developed by Linus Torvalds of Linux fame. GitHub is an online service where you can host your code in the form of a git repository. You don't *have* to make that code public, although that is pretty much the default approach and generally the reason why people use GitHub in the first place.

Now, as to Git, you should definitely be getting familiar with it as it'll be around for a long time and you're guaranteed to have to use it in any professional environment. It can feel a bit weird to use a VCS for code that only you work on, but I'd still encourage you to make it a habit.

Which brings me to the probable reason why your professor recommended you make a GitHub profile. GitHub hosts a lot of open source projects, and contributing to those projects is a great way to add some experience to your resume. Also, putting up your own code on GitHub for others to use and build upon, is similarly a great way to show your work to future employers and to demonstrate that you can maintain a (small) project. So I get why he recommended it. Even if you're not contributing any actual code to any GitHub project *right now* it's good to create your profile and start poking around, to see what is out there and how GitHub works. If I were your professor, I'd have you collaborate on shared projects in GitHub as soon as you're up to some functionally useful code. Which is sooner than you might think :)

There are also lots of beginner-friendly ways in which you can contribute to projects. Like fixing typos or other small easy to understand errors. It will help you to figure out how the process of pull requests and handling GitHub issues works.

That being said, GitHub isn't the only game in town. There are also (off the top of my head) Bitbucket (owned by Atlassian) and GitLab (which became more prominent in the backlash when GitHub was acquired by Microsoft). You can also perfectly host your repositories on a server of your own. GitLab is, apart from a hosted service, also a package you can run on your own server to have your own GitLab instance.

5

u/LloydAtkinson Sep 22 '21

Why shouldn’t you? Pick a decent username as well.

3

u/zynix Sep 22 '21

Is 420xxx3dg310RDxxx69 a good username?

2

u/[deleted] Sep 22 '21

any suggestions on choosing a good user name/alias?

2

u/rozz_net Sep 22 '21

It's not a problem to use Github for your private projects, even if they're public (free offer).

I often used Github to share code examples from presentations that I gave in local JUG. These programs were not ambitious, just examples.

2

u/[deleted] Sep 22 '21

For junior developers it's great to see their work in dynamic. Like when I was reviewing one dude's git I made a notice that his code from 2018 was worse than his code in 2020, which means he's improved. And he had rewritten his per project.

2

u/anh86 Sep 22 '21

He's right. Even if you take the portfolio aspect away, Github gives you valuable experience you'll need to work on software teams later and allows you to tinker with your code without fear of irreversibly ruining it. Sure, a lot of your very first applications like printing someone's name to a command line are useless in a portfolio but you can make any of your repos private and only keep the good stuff publicly viewable.

2

u/tobysmith568 Sep 22 '21

You should git into the habit of writing code/commits that others can see. Public work stops you from being sloppy - or at least it did for me

2

u/jghobbies Sep 22 '21

It's not just about learning to use git, having a code portfolio to point to is useful. All other things being equal I'm more likely to give a yes to a candidate where I can see samples of their code.

It doesn't have to be github but you should certainly be using git, even for small one-offs (though you don't have to make everything public). I keep my notes in a private repo, every little project I work on.

Use git now on those little intro programs and you'll be well set when you're dealing with larger stuff. Establish the habit.

2

u/Python4fun Sep 22 '21

Using git is a skill by itself. I highly recommend adopting git with a remote (github, gitlab, bitbucket, etc.) and figure out first how to use it while putting your work on master, and then figure out how to work on a feature branch and perform pull requests onto master. These things are worthwhile skills to have by themselves.

Also, being able to use feature branches allows you to hop between different areas of work for a project without having to worry about completing them or harming the work/build. You can have a website and work on a visual redesign on one branch, and then work on reworking the scripts on another branch.

1

u/nutrecht Sep 22 '21

That the stuff is simple is no reason to not use Git for it. So it's in general good advice to get some Git experience. Besides, you can have private repositories with Github if you want.

1

u/LordAlfrey Sep 22 '21

It's a good habit. Also just getting used to git and hub in general will make it easier when you find yourself needing to use them, even for uni projects. I can't guarantee your experience will be the same as mine, but I had many courses where we were given partially built programs to complete, that were hosted on the hub.

1

u/yonatan8070 Sep 22 '21

On top of what everyone else said, you could also use it to share your code from class with someone who might have missed something, and when you'll get to bigger projects you would already be used to having them backed up on GitHub

1

u/Tularion Sep 22 '21

Don't worry about your GitHub profile. You may not push anything useful, but learning Git will be useful to you. And it doesn't take too long to see the direct benefits.

1

u/zynix Sep 22 '21

Take all the advice here and add one more that seems to be missing.

If you're stuck with a code/design problem, a public Github repository OR perhaps better a Gist gist.github.com can make sharing a lot easier.

1

u/[deleted] Sep 22 '21

When you will be doing manual testing, and realise that some change 7 days ago broke something, you will just be able to look it up and retrieve it.

Every professor has a student that loses their final year project due to no version control and some hardware corruption or just fucking up the code teying to solve smt. Same applies to all modules.

1

u/[deleted] Sep 22 '21

As you progress through university, you will be taking more and more advanced courses. Some of these courses will have projects which can be valuable to show to employers as they display a potential skills you have. Rather than just let these projects be forgotten over the years might as well, have them hosted on GitHub where they can be accessible after a few years.

Plus, you get to use Git, which is the most popular version control used in the software world.

You will also be working on hobby projects over the years, and again uploading them to GitHub makes a lot of sense. Plus, you can actually try and get involved in the world of open source and start contributing.

So, overall there are multiple reasons to start a GitHub account and no particular reason not to. You might not use it immediately, but over the course of time.

Note - If you do create a GitHub account, they have a student program where you get access to their premium features if you link your university email. So take advantage of that.

1

u/funbike Sep 22 '21

Git can save your ass when doing school work. You'll need it in your first job.

You'll be able to revert bad changes or make a branch to try something out. You'll clearly see recent change's you've made to help locate where you broke something.

If you don't want to use github, that's fine. If you don't want to use git, you're just making things harder for yourself.

When you get a job, there's a 99% chance they'll require you to use git.

1

u/[deleted] Sep 22 '21

Your github account is now your resume.

1

u/[deleted] Sep 22 '21

chad professor

1

u/xigoi Sep 22 '21

The amount of people here who don't know the difference between Git and GitHub is concerning…

1

u/ericmurano Sep 22 '21

Great advice. It’ll get you used to the cycle of coding and committing.

You could keep all of your small, kata code together in one repo and have actual applications you are writing in their own repos.

You don’t have to push everything up to github, but do get in the habit using git locally on any small thing you do. You can use your git log as a persistent undo stack. Then if you decide the code is something you want to keep, push it.

1

u/autechr3 Sep 22 '21

Maybe you could divide your repositories for each course with folders for each assignment. I definitely think it would be worth it. I promise you will be glad you did. You will have to use it when you start doing group projects anyway. Honestly, I wish I had a github with all of my old assignments in it. Would be fun to look back at it and laugh.

1

u/[deleted] Sep 22 '21

your professor is the smartest person alive at the moment. just listen to him even if you don't agree.

1

u/69632147 Sep 23 '21

its your portfolio.

1

u/bacondev Sep 23 '21

Even if doing small projects, it shows that you're actively maintaining/building your software development skills.

1

u/dimonoid123 Sep 23 '21

Since you are student, register for GitHub with your student email (and attach your personal email). This will give you free access to IntellijIDEA and other insanely useful programs. You have to renew access annually. I personally use git even without GitHub, just locally for convenience if I'm not planning to share my code(or just create a private repository on GitHub).

-1

u/McMasilmof Sep 22 '21

I have worked for some years now and never used github.

But i use git on a daily basis. Learn git, gitlab is just a website that uses git. Its nice to publish your code for, but if you dont need that, you dont need github

1

u/[deleted] Sep 22 '21

Github gitlab et al are way way more than just "a website that uses git".

-1

u/PGDesign Sep 22 '21

I'd recommend using github desktop - it makes it so easy to get lots of the powers that git and github give you, no commands needed and the UI doesn't feel overwhelming either. Why I love it:

  • it lets me undo entire logical groups of changes at a time (no repeatedly using cntrl z and then maybe overstepping). This means I can try something I'm not entirely sure about, safely in the knowledge that I can revert it again painlessly. This is particularly useful if you're learning or innovating, as it takes away that feeling that you might screw stuff up.

  • it can be a really powerful tool for debugging in times when something was working until you changed something. You have a log of each commit, and for each one: hopefully a meaningful name and useful description, and it shows the "before" and "after" of each line that changed plus what files where added edited or removed

  • you can also use the history to see what you where working on last, which is often useful on Mondays if you're a bit tired, had a busy weekend without coding and are now staring at your screen wondering what the hell past you was doing. It will tell you what files and lines you did work on. Sometimes, if I know what needs to be done next, but think I'll probably forget by the time I next work on that project, I'll leave myself a reminder note in my commit description.

  • when a windows update temporarily bricked my laptop, I was pretty relieved to remember that all my code, even random meaningless experiments, where all safely on github and I'd be able to download projects one project at a time really easily. Not an entire massive directory in one huge download, not each tiny file, one specific project that I was actually interested in at a time.

  • sometimes its nice to look through your history to see just how far you and your projects have come along

General stuff that using github itself helps with:

  • some website hosting providers have integrations with github so that you can tap a button to update your site or subdomain to your latest commit - no messing around with moving specific files to the hosting

  • "hey do you want to collaborate with me? I'm blah blah on github"

  • building up a presence on github. If you ever go freelance you can use the fact that you've been on github for however many years and done however many commits, to show that you've got experience. It's not really an accurate indicator but some people use those stats as a lazy proxy for how experienced your are.

1

u/[deleted] Sep 22 '21

I'd recommend learning to use the git command line interface. When I'm interviewing engineers, if you cannot use the command line, you're likely not getting hired.

1

u/PGDesign Sep 22 '21

Does the git command line actually do anything that github desktop doesn't do? I can use the command line if I have to, and do begrudgingly where I need to, but github desktop is so well made and seems to do everything I'd ever want it to do, and is far more intuitive and quick to get to what I want than just using git.

2

u/[deleted] Sep 22 '21

Like most other command line tools, it's scriptable. Suppose I want to run all my unit tests locally and once they've passed, commit the working code, push it to upstream and then create a PR. How do I do all that without using command line tools? With a little scripting I can kick off that entire process, end to end, in one go, and even have it SMS me when it's done, or failed, allowing me to nip out for a coffee or something while it's doing it's thing.

1

u/PGDesign Sep 22 '21

That seems great for professional continuous integration purposes in big teams, but is very much overkill for learners like op, and one of those things that for people like myself (as a freelance web/mobile developer) could speed my process up a little, but is quite a big time investment to make.

1

u/[deleted] Sep 22 '21

That's just an example. I'm not going to sit and enumerate every permutation of git CLI scripting until you concede it's worthwhile. The bottom line is, git is a tool, and if all you know about a tool is one person's inference of what it's for, in an abstraction, you don't really understand it. Is that enough? For some use cases, sure. But look at your original question, and then at where it was posted.