5:25 I add files one by one while commiting. I have two reasons: 1. I code review my past self, check if i forgot something etc. 2. I formulate the commit message by going over the changes
my 3. I often sneak in smaller drive-by fixes like docstring lies or small refactoring -- so this is how i can split them into separate commits ..which I then might or might not throw away if i change my mind. so it's also a way to lower the barrier of making these quick fixes because i can now rely on myself reviewing and reconsidering them later without putting the main thing in danger by dumb things actually sneaking in via `git add .`
I usually add code as logical blocks, normally parts of files or multiple files, and try my best to ensure that each commit is runnable. This gives me a sensible development history and is very useful with git bisect, which itself is very useful when I later find a strange bug, but cannot identify the source of it.
It's crazy to me that trade schools seemingly aren't more prominent in the IT field in the USA. Where I live, they've been well regarded since well before I was born.
@@ChrisAthanas I'm not so sure about that. Here in NL kids are separated into tracks early high school. These lead to trade school, science education, and something in between. IT and programming education exists on all levels. The in between level, which I think is what prime is thinking about is a 4 year degree, but you get to leave highschool a year early compared to the university track.
10:30 this frustrates the hell out of me, when it comes to Masters programs... I want to study computer science, yet the degrees want to insist that I learn software engineering patterns and cloud computing - likely to help pad the schools' job placement stats. When I asked if I could replace those courses with additional algo/compilter/OS/theory courses, they said "no" :/
Interesting, i am on the other side of this, i want to learn more practical work habits skills in my masters degree but the school where i live has a lot of theoretical classes.
In my university, there's a mandatory software class for electrical engineering where students learn about linux programming and they also learn about git, valgrynd etc. This semester we started teaching devcontainers too, though only at a very basic level.
15:08 I went to a school that genuinely did exactly that - a two year course with a singular focus of preparing you for the workforce. The school board consists of hiring mangers. To be on the board the company must also hire interns from the school. Students in the same vain are required to complete an internship to graduate. The internship can be with any company related to the degree.
I had attended Prime's git session on frontend masters... And now I can say that I know git.. atleast I know the part of git that is often used in production, that part which most people fail to understand and perform big oopsies here and there.. thanks Prime❤️
It's weird how many people think there was no source control before git. No, people weren't forced to email zip files back and forth before git. There was actual source control software before git, and it was often more intuitive than git is now.
15:00 In Canada, we have 2 and 3 year programs. Confusingly for most people, we refer to those as College. We refer to bachelors, masters, and PhD courses exclusively as University to differentiate it. The 2 and 3 year courses are essentially vocational training, with much more emphasis on the practical side of things. If you take a third year, there's a lot more of the theory there. A computer programming course for example wouldn't introduce DSA and such until year 3 if you chose to take the 3 year program. An example of the sort of classes in a college course would be like a couple courses on Java, several classes on web development (one class is just intro to HTML/CSS and SUPER basic JS, next class would be mostly JS focused, maybe using React or some other framework), Classes on networking, digital logic/boolean algebra, basic stats, some embedded dev on an arduino or similar device, etc. The classes are broad, basic, and heavily focused on practical experience. They're generally much easier than the University/academia stuff. They're not as laser focused as a bootcamp, so students get a much broader introduction to programming. The 2 year programs I would consider not a great choice, since they really leave out all the useful comp-sci stuff, but someone who is a motivated self-learner could make do with it and self-learn all the comp-sci they need later. Many colleges also have co-op programs where they require students to take (paid!) internships for a semester per year, ensuring that students get real-world experience before even graduating.
That actually sounds amazing. Teach practical job stuff first and then go conceptual once you know students can do some form of basic programming job. I got a Software Engineering bachelors in the US thinking it would be more practical than CS. Only took a single web dev course senior year and just got more math requirements than CS to get the coveted “engineering accreditation” and did way too much UML. I think we could learn from Canada here!
I've been using Git for 10+ years and if I use "git add ." or even "git add -u" that's a huge exception. I'm pretty much always using "git gui" to commit individual lines, not files. I'm basically doing myself a code review while I'm creating the commit and I'll typically catch a stupid typo or some other simple issue before even completing the commit in the first place. It also allows committing logical changes. For example, if I actually fixed one small bug in existing code and implemented a new feature, that should be two separate patches even if both happen to co-exist in my working directory. Basically make as small commits as possible but every commit should be able to be reverted as a single commit. If reverting that single commit makes no sense, then it shouldn't be a single commit. Commits should be atomic.
In Denmark, we have the concept of a "trade school" kinda engineering alternatives to the more traditional university bachelor+masters. They are shorter (3.5 years) with half-a-year of mandatory internship in a company with other engineers. All the courses is industry-oriented (more practical and less theoritical) and we learn the techonologies in demand here (C#, Git, HTML/CSS, React, SQL, Testing, CI/CD etc.). At the same time you get a bachelor in engineering, where you can either go out and work or study for a masters of science in engineering (a few foundational physics/math electives are necessary to go this path). This education is offered for lots of fields, like civil engineering, computer/software engineering, bio/chemical engineering, mechanical etc.
15:30 sounds like prime talking about a vocational training system. In Germany nobody has to go to a university to become a software developer, you just do a paid, dual (on-site at a company aa well as on-site at a vocational school) apprenticeship as a software developer for three years.
Definitely on board for trade schools being prioritized. I think bootcamps are a great format for updating your skills and getting familiar with new technologies, so amend them instead of removing them. But university education has become overblown, especially with how much it costs in the US.
I agree with Primes take on this wholeheartedly. A surface level understanding of git does not really provide enough workflow benefit over manual tracking of small personal projects. A deeper understanding would inherently 1) make it easier and understand 2) faster to use and 3) allow for more access to the more complex benefits. Also a degree should emphasize the mechanism behind any tool since there is no guarantee that git will remain the de facto solution 30 years later.
16:14 @ThePrimeagen in Germany we actually have vocational training, spanning 3 years for two separate occupations. IT specialist for system integration and IT specialist for software development.
2:15 You could have also just run "git rebase --continue" after creating one or more extra commits. Git will accept that just fine because it specifically supports splitting commits when you "edit" a commit during a rebase. It may mess "git rerere" a bit but everything else will be just fine.
19:20 I think that one null check 40 lines before is the correct way to go but it's sometimes good to have an assert() near the use site to trigger and error if somebody modifies the code above. The idea is that assert()s are active while developers are modifying the code but it's not needed to run in production version. And if developers are running with assert()s disabled, they should be shamed of themselves.
41:00 Basically ThePrimeagen elevator pitch for the coffee is "This is targeted to developers and will have the same price as Starbucks but higher quality."
For the git in school, so far, whenever we have had team projects they would always tell you to use the school gitlab (for multiple reasons) (ok actually first year there was a full year project where they just said you can use whatever implementation of version control you want, which I didn't really like since they gave no info on what options you may want to pick and kinda just threw first years into the deep end, luckily I already knew git from using it personally and just told everyone how to use it, although we did some cursed stuff with it.) Anyway, we were directed on commands and a brief summary of different git flows and why you may use them and said that for that courses project you should try to implement a kinda github flow (it very much wasn't because they needed it to fit some marking schema, idk). It felt much better than the first year but a lot of the time just felt that there were still some stuff missing. But hey, schools are already doing some of the stuff Primeagen is saying, just maybe not enough.
lol its funny thats how things were in the late 90s early 00's for Web Development. It was considered a trade at that time...Honestly I think they should keep the CS Model for the first 2 years and the second 2 is a straight up bootcamp...similar the Software Engineering degree but more in depth.
We used to have 4 year bachelor equivalent trade schools here in the netherlands. But the introduction of the bachelor/master system is messing them up as they all want to be more academic. They were ok, but I still didn't get any courses on source control (git didn't exist yet).
I learned git on college, graduated like 10 years ago Went to SUNY potsdam and they had their own git server, and all the computers in the comp sci computer labs ran Linux
You know it's interesting about how AI services and things are shifting academia into a newer direction that I think is like how was described as an older, more ephemeral style of grading that required participation in the group. Because homework and reports and stuff like that are basically toast. idk
a tool is something you gotta respect and so, I hear ya about, when schools teach git, but don't teach it properly, they are giving people credit for knowing something they don't really know. And it comes across anyway as, they don't respect the tool
I’m deep in the sauce and I still do git add . , git commit, git push… I just run git status and git diff -staged 400 times before because I’m apparently cyber ocd
Always rebase your branches before merging a pull, and generally squash merge each pull request. If you rebase frequently, any issues rebasing are very manageable. And if you feature branch gets really big (and does and undoes and modifies itself in a place that may have changed on main) then you can squash some of your commit in the branch and then rebase.
I don't think universities should teach any specific tools, but rather more theoretical foundations which are universal and don't become that quickly stale. Teaching specific tools / languages is totally fine for more vocational institutes where you need to learn stuff that is directly applicable at work. Having said that using particular techs/languages as an example is probably great idea, but I'd rather see graph theory and conflict resolution algorithms taught at unis than particular tool
I learnt git myself through practicing, i recently have had some freelance jobs where i had a bunch of smarter devs than me on every aspect, well as you guessed they didn't know the crucial roles of git and their whole hard working job was fixing conflicts and i laughed my but on them 😂
Unfortunately there are many issues with this course. Back merges are not identified as issues. Rebase suffers badly from multiple conflict resolution sessions. Many problems.
I personally don't use GIT that much, basically because I used to trust in my own criteria when merging code and not leaving it to a merging tool (completely), sometimes there is bussiness decision to be made in order to know which code has to be pushed to remote. I usually do pull after push and if there's a conflict I revert the whole thing and resolve it with Beyond Compare (or any diff tool you wanna name) all in local before pushing to remote, it gives me peace of mind always. I always hear from colleagues "you will never be a senior developer if you don't learn all the bells and whisles of GIT, blablabla", but I rather to learn other skills that gives value to the product and help to solve problems, so I choose the tools and how I'm gonna do it, mind your own businesses. I mainly do this because i'm not vegapunk from onepiece, the amount of tech skills you can attach to your head is not infinite so I choose which to master and which to learn the very basics.
I really like actually preserving the history of the existence of a branch. I cut feature branches from master, rebase them back on master whenever master has changes, and then I _merge_ the feature into master when it's done. Then if my feature has a critical bug we revert the entire merge. Edit: also git push --force-with-lease exists and is wonderful.
CS education works very differently here in India... they only talk about stuff without teaching us to implement the foundations. I had to learn everythng on my own... rendering the degree practically useless
Go watch a FREE video on git for about an hour at most on youtube, and it will cover you 99.999% of all professional grade development out there. For those that think you are the special one that needs this course cos you are the 0.001% developer, good luck with paying for these courses no matter how cheap it is.
Why not just an irl bifurcation. University education and Vocational school. I mean we already have something of a sorts, but it's all about what the industry will accept. You also have to pay people a good wage to work at a vocational school vs a university where while they may be paid like shit (i had a professor at a decent school paid like 45k), they get to put that institution on their resume. This is the problem you are up against. Irresponsibly tearing down institutions is not the answer though. Not that anyone in this video suggested that.
I accidentally deleted my project's source files trying to get git to track it. Never used it again. My only familiarity with it is in resolving the problems with it, and finding that in general, you just have to delete everything and clone it fresh. Like when everyone was changing their primary branch from master to main, I searched it, I tried to figure it out, could never get it to switch the upstream to main. Fetching tags and branches is hit or miss. Don't know. It's just never worked for me, something about it is designed completely counter to how my mind wants to work. Which results in me finding all the small cracks to go in and completely screw everything up.
If you are a dev then you are going to be using git all the fn time, just as you'll be using an IDE or a text editor or compilers if you use C or some other shit and debuggers fairly often. Not learning part of the basic common tooling for the general environments i think is a massive blunder.
Git has merkle trees data structures (which is also used in blockchain), should schools teach fundamentals of tree traversing and hashing. These are very CS concepts, and git is a great case study.
If your CS curse didn't teach you GIT by year 3, you should be able to get full refuns in that shit. It's literally like if driving class would just nit teach you how to check oil in your car, cause "it's theory of driving, not real driving here".
Before using git, I had a script that automatically zipped my current project on Windows startup. The zip file was named after the current day and time. I regularly uploaded those zip files to an FTP server (manually) and actually never lost any data by accident.
I have been questioning why I use git for personal projects and recently set up an automated hourly (rsync) backup of my dev files to another disk on my computer. A missing feature is to have some historical backups to rewind changes.
Most developers rolled thier own backup routine before source control became popular. We were all forced to when we lost our work just once, maybe twice for a slow kid like me.
Good grief, we had trade schools, polytechnics, apprenticeships up til the 1970's. Only 10% of kids went to university to float away in academia and research etc. Since then we had the big push to get every kid a "university" education, which involved renaming all the trade schools and polytechnics to "university". Along with the whole disaster of kids having to borrow piles of money to do the study that is now demanded of them. No longer any chance to get a grant or work and study. And of course the bachelors degrees simply got devalued, unless you were one of the luck few to go to a traditionally renowned university. I have been watching this disaster unfolding since I graduate in 1979.
On the other hand when I've worked at places hiring fresh-out-of-college devs, the fact that the colleges teach a lot of useless information but couldn't even be bothered to expose students to git was infuriating. Because _consistently_ I'd have to spend 70% of their onboarding time walking them through "okay, first you have to git add, then- no you have to type git add- no you can't do a commit yet because you have to stage things first... Yeah git _is_ really useful I have _no idea_ why your teachers didn't tell you about it :eye-twitches:" These kids aren't even _at_ the starting line half the time.
Yeah... there are certain tools every CS student should learn, and Git is one of them. Version control, debugging practices, and an example of a build system should be mandatory stuff you learn.
I recall first version control. Sources on 64MB USB drive, once in the week we met with friends, we compared our new files with "repository" copied them over. If two of us had files modified in last week, we manually checked for conflicts. Then maybe in 2003 or 2004 we started using tortoisesvn.
My daughter was in a hackathon at 14 years old, where I witnessed a bunch of children learning Git; on a random mix of Windows and MacOS. Git has to be taught in school. Because teachers without it will give you assignments full of bugs. My daughter actually quit high-school computer science because of all of the drudgery of just catching up to debugged code. High school and college absolutely must teach basic Git as a prerequisite. I think CS professors saying that "teaching git is not my job!" are total idiots. It's a prerequisite to any class where the teacher needs to disseminate code. The teacher ALWAYS has bugs; that get mixed in with student bugs.
@@ar_xiv that's exactly what the problem is. most of the kids download the zip. they can't get the example to work. the teacher has YET ANOTHER bug; almost every other project. if teacher keeps putting out new versions, it's chaos when the patches come in over the buggy code that the kids are writing. Rather than.... teacher diffs to see what the kids did, and merging the teacher's bug fixes. "just send zips around", or "just put code in a directory" is why git was created in the first place; to stop that madness of multiple editors on the same archive.
I feel this. No so much that they need to teach git, but that requiring the subject will force teachers to learn it, and thus improve the deployment of their assignments. That makes sense. Assignments of complexity can make the learning more "cool". But deployment of assignments with complexity requires a level of ops sophistication many teachers lack.
@@robfielding8566bro idk what school you went to but my teachers use Linux and CML and bash to make sure all files follow same format and syntax and don’t have bugs
@@ryanfeeley2407what projects do you think students work on? Their not projects that build , their usually stand alone 2week-1month projects . A student submits it and moves on. GIT has no place in this . These aren’t mass contributed projects
I learned to not use "git add ." after adding 1000 meta file changes to a unity project during my first job. Also, another job had a build system that added unwanted local configs occasionally. So I think double checking isn't bad. Also, I also think going file by file helps remove any extra comments or unused code. Like a mini pr you do for your own code.
@@marioprawirosudiro7301 You can't just add them to a git ignore. Unity meta files sometimes need to be adjusted. Because they positioning and more game object values. I don't know what it was but something slightly adjusted every unity object in the scene after I saved. Sorry, but you not very convincing. We all make mistakes, and looking at you work before committing is probably going to help in the long run as a professional.
@@jeremylakey680 I know. This is one of the biggest reasons why I moved away from Unity. Back then my solution was to ONLY include the scripts, zip away the corresponding meta folder and share it on a file sharing site so my teammate can have the same ones, effectively treating the meta files as blobs (which tbh, it effectively is). We did this for every commit. It was tedious, but still better than dealing with the incessant messages because the meta files keep changing.
The issue with this is that programming without a ruined education is very limiting. Existing vocational trade schools you are thinking of exist, but they are largely terrible at picking good subjects to teach and often hire incompetent people as instructors.
Or... you just use git feature built into intellij. I have used so many git tools as well as git cli and there's nothing easier and faster to use than the feature simply built into intellij. No git add -a. Everything you want to be added is just automagically added
Hey Lane, I'm a new graduate who was feeling pretty dispirited the last few weeks while trying to find a job. Your videos have really helped motivate me and put me on the right path to enjoy making projects and doing some leetcode in the meantime. Thanks for all you do!
In Germany, we have the concept of a University of Applied Sciences. You will also be able to do a Bachelor's or Master's but the goal is not to prepare you for academia, it is to prepare you for a career in the field. And often, professors are actual practitioners who do the teaching on the side. The degree also includes projects where you help a company with some practical problem.
Pull main into your branch, resolve commits, push and squash back into main. Clean, fast, easy, and hides the horrors that happened on the feature branch. Also supports reverting.
28:00 "Always bet against yourself". I totally agree. Always assume you've made a mistake you're not aware of and you'll need to fix the code two years into the future when you cannot even remember writing the problematic line. The code should be as simple as possible to be easy to debug and commit messages should explain *why* the line of code was written in the first place. Commit messages should not explain *how* the code was modified because automatically generated patch already contains that information. It's okay to *also* include summary of changes but it's not replacement for documenting why the code was modified. AI generated commit messages can only do the summary part at best.
BTW, couldn't agree more on teaching how to build it (git) and how the distributed algorithms work, how 3 way merge works, etc, etc... Once you know that, using the tool is easy, and you have the benefit of being able to build other systems that use those same ideas (just hopefully not blockchain stuff) :)
Starting from 28:00 Is it not already possible to use squash commits on merge without using rebase? One only needs to resolve the merge conflicts once per merge into their feature branch. This points toward the norms around your team's contributions. If you're releasing with branches, developing branches off of other branches, maintaining a feature for a long time outside the main, rebase makes more sense. It's less necessary for trunk based development.
No we don't need to teach git. It is an overly convoluted version-control software. The fact that you need a class to avoid "big oopsies" should be a big hint. The most effective devs are often those who avoid needless complexity, something that is often learned with age and experience..
Just think about kids at CS programs who are trying to learn git when they don't understand all the foundational concepts that it relies on. If you don't know about hash functions and content-addressable databases, how can you understand git commits? If you don't understand trees and pointers and graphs, how can you understand git history and branches? If you don't know what a stack is and the push/pop interface, you'll learn about git stash and most of your confusion will be about stacks, not about git stash. Git is a good way to get quickly exposed to a lot of programmer culture in an informal way, just like any other good command-line tool. But an academic program should take a more systematic approach to learning the concepts in a more formalized and in-depth way, not just hold your hand through learning to be a consumer, like some sort of wildly expensive boot-camp.
Honestly I have senior (senior, senior) devs in my team that use a git frontend and have no clue what is happening in the background. It's insane the checks and config scripts we need to add to make sure people don't fuck up our repository. I feel like it has gotten better with newer devs, as they tens to at least use the CLI.
Technically, I have a proposal. What if we remove useless degree. Like instead of having phd or masters, we should just have professional degree. So you can have bachelor's degree in computer science (this teach you the basics and fundamental concepts) Then you can get the Professional degree (which teach you businesses setting, corporate, how programming is done in those setting) Just to note. Every business and company is different. You can't technically teach everything, but at least Professional Degree should teach you how real world works.
5:25 I add files one by one while commiting. I have two reasons: 1. I code review my past self, check if i forgot something etc. 2. I formulate the commit message by going over the changes
my 3. I often sneak in smaller drive-by fixes like docstring lies or small refactoring -- so this is how i can split them into separate commits
..which I then might or might not throw away if i change my mind. so it's also a way to lower the barrier of making these quick fixes because i can now rely on myself reviewing and reconsidering them later without putting the main thing in danger by dumb things actually sneaking in via `git add .`
Same
I usually add code as logical blocks, normally parts of files or multiple files, and try my best to ensure that each commit is runnable. This gives me a sensible development history and is very useful with git bisect, which itself is very useful when I later find a strange bug, but cannot identify the source of it.
It's crazy to me that trade schools seemingly aren't more prominent in the IT field in the USA. Where I live, they've been well regarded since well before I was born.
The field moves too fast, but seems to be coming to a consolidation point. Also teaching CS is really hard.
@@ChrisAthanas I'm not so sure about that. Here in NL kids are separated into tracks early high school. These lead to trade school, science education, and something in between. IT and programming education exists on all levels. The in between level, which I think is what prime is thinking about is a 4 year degree, but you get to leave highschool a year early compared to the university track.
Look into brushing and communications classes in electrical unions, they are literally the trade schools you are referring to.
10:30 this frustrates the hell out of me, when it comes to Masters programs... I want to study computer science, yet the degrees want to insist that I learn software engineering patterns and cloud computing - likely to help pad the schools' job placement stats. When I asked if I could replace those courses with additional algo/compilter/OS/theory courses, they said "no" :/
I feel you so bad, my Uni added an enterprise software development Master's
then apply to a different school moron -- not every masters program is the same -- find one that is more theoretical and less applied
Interesting, i am on the other side of this, i want to learn more practical work habits skills in my masters degree but the school where i live has a lot of theoretical classes.
Then make ur own course like Primeagen
In my university, there's a mandatory software class for electrical engineering where students learn about linux programming and they also learn about git, valgrynd etc. This semester we started teaching devcontainers too, though only at a very basic level.
15:08 I went to a school that genuinely did exactly that - a two year course with a singular focus of preparing you for the workforce. The school board consists of hiring mangers. To be on the board the company must also hire interns from the school.
Students in the same vain are required to complete an internship to graduate. The internship can be with any company related to the degree.
Said that way... It sounds depressing.
Vain ?
"git add -i" gives a helpful interactive loop, and even lets you drill down and choose specific diffs within files to include or exclude from the add.
I had attended Prime's git session on frontend masters... And now I can say that I know git.. atleast I know the part of git that is often used in production, that part which most people fail to understand and perform big oopsies here and there.. thanks Prime❤️
It's weird how many people think there was no source control before git. No, people weren't forced to email zip files back and forth before git. There was actual source control software before git, and it was often more intuitive than git is now.
15:00 In Canada, we have 2 and 3 year programs. Confusingly for most people, we refer to those as College. We refer to bachelors, masters, and PhD courses exclusively as University to differentiate it. The 2 and 3 year courses are essentially vocational training, with much more emphasis on the practical side of things. If you take a third year, there's a lot more of the theory there. A computer programming course for example wouldn't introduce DSA and such until year 3 if you chose to take the 3 year program.
An example of the sort of classes in a college course would be like a couple courses on Java, several classes on web development (one class is just intro to HTML/CSS and SUPER basic JS, next class would be mostly JS focused, maybe using React or some other framework), Classes on networking, digital logic/boolean algebra, basic stats, some embedded dev on an arduino or similar device, etc. The classes are broad, basic, and heavily focused on practical experience. They're generally much easier than the University/academia stuff. They're not as laser focused as a bootcamp, so students get a much broader introduction to programming. The 2 year programs I would consider not a great choice, since they really leave out all the useful comp-sci stuff, but someone who is a motivated self-learner could make do with it and self-learn all the comp-sci they need later.
Many colleges also have co-op programs where they require students to take (paid!) internships for a semester per year, ensuring that students get real-world experience before even graduating.
That actually sounds amazing. Teach practical job stuff first and then go conceptual once you know students can do some form of basic programming job. I got a Software Engineering bachelors in the US thinking it would be more practical than CS. Only took a single web dev course senior year and just got more math requirements than CS to get the coveted “engineering accreditation” and did way too much UML. I think we could learn from Canada here!
@@euclid9492 I forgot to mention, college here is significantly cheaper than university too.
I've been using Git for 10+ years and if I use "git add ." or even "git add -u" that's a huge exception. I'm pretty much always using "git gui" to commit individual lines, not files. I'm basically doing myself a code review while I'm creating the commit and I'll typically catch a stupid typo or some other simple issue before even completing the commit in the first place.
It also allows committing logical changes. For example, if I actually fixed one small bug in existing code and implemented a new feature, that should be two separate patches even if both happen to co-exist in my working directory.
Basically make as small commits as possible but every commit should be able to be reverted as a single commit. If reverting that single commit makes no sense, then it shouldn't be a single commit. Commits should be atomic.
In Denmark, we have the concept of a "trade school" kinda engineering alternatives to the more traditional university bachelor+masters. They are shorter (3.5 years) with half-a-year of mandatory internship in a company with other engineers. All the courses is industry-oriented (more practical and less theoritical) and we learn the techonologies in demand here (C#, Git, HTML/CSS, React, SQL, Testing, CI/CD etc.). At the same time you get a bachelor in engineering, where you can either go out and work or study for a masters of science in engineering (a few foundational physics/math electives are necessary to go this path). This education is offered for lots of fields, like civil engineering, computer/software engineering, bio/chemical engineering, mechanical etc.
15:30 sounds like prime talking about a vocational training system. In Germany nobody has to go to a university to become a software developer, you just do a paid, dual (on-site at a company aa well as on-site at a vocational school) apprenticeship as a software developer for three years.
Definitely on board for trade schools being prioritized. I think bootcamps are a great format for updating your skills and getting familiar with new technologies, so amend them instead of removing them. But university education has become overblown, especially with how much it costs in the US.
I always add each file to git because I like seeing the diffs and sometimes catch something I wouldn’t have otherwise before committing.
9:40 that's how the free git book on the git website and the o reilly version goes about teaching git. really does help with learning git
Rebase makes the history nicer. Seems to be my experience as well. We all start of as merge, but then discover the awesomeness of rebase.
and if they even bother to have us use git, DON'T FORCE US TO USE THE DAMN GUI IN WHATEVER GARBAGE IDE THEY ALSO FORCE US TO USE
Thought Prime was gonna lose me on his super spicy take, but he nailed it!
I agree with Primes take on this wholeheartedly. A surface level understanding of git does not really provide enough workflow benefit over manual tracking of small personal projects. A deeper understanding would inherently 1) make it easier and understand 2) faster to use and 3) allow for more access to the more complex benefits. Also a degree should emphasize the mechanism behind any tool since there is no guarantee that git will remain the de facto solution 30 years later.
16:14 @ThePrimeagen in Germany we actually have vocational training, spanning 3 years for two separate occupations. IT specialist for system integration and IT specialist for software development.
2:15 You could have also just run "git rebase --continue" after creating one or more extra commits. Git will accept that just fine because it specifically supports splitting commits when you "edit" a commit during a rebase. It may mess "git rerere" a bit but everything else will be just fine.
19:20 I think that one null check 40 lines before is the correct way to go but it's sometimes good to have an assert() near the use site to trigger and error if somebody modifies the code above. The idea is that assert()s are active while developers are modifying the code but it's not needed to run in production version.
And if developers are running with assert()s disabled, they should be shamed of themselves.
41:00 Basically ThePrimeagen elevator pitch for the coffee is "This is targeted to developers and will have the same price as Starbucks but higher quality."
For the git in school, so far, whenever we have had team projects they would always tell you to use the school gitlab (for multiple reasons)
(ok actually first year there was a full year project where they just said you can use whatever implementation of version control you want, which I didn't really like since they gave no info on what options you may want to pick and kinda just threw first years into the deep end, luckily I already knew git from using it personally and just told everyone how to use it, although we did some cursed stuff with it.)
Anyway, we were directed on commands and a brief summary of different git flows and why you may use them and said that for that courses project you should try to implement a kinda github flow (it very much wasn't because they needed it to fit some marking schema, idk). It felt much better than the first year but a lot of the time just felt that there were still some stuff missing.
But hey, schools are already doing some of the stuff Primeagen is saying, just maybe not enough.
lol its funny thats how things were in the late 90s early 00's for Web Development. It was considered a trade at that time...Honestly I think they should keep the CS Model for the first 2 years and the second 2 is a straight up bootcamp...similar the Software Engineering degree but more in depth.
beastco mentioned
Shout-out beastco
We used to have 4 year bachelor equivalent trade schools here in the netherlands. But the introduction of the bachelor/master system is messing them up as they all want to be more academic. They were ok, but I still didn't get any courses on source control (git didn't exist yet).
Need to learn how and why the abstraction exists before learning the abstraction
I learned git on college, graduated like 10 years ago
Went to SUNY potsdam and they had their own git server, and all the computers in the comp sci computer labs ran Linux
It wasn't for a specific class or anything, one professor just required you to use it for any assignment you submitted
You know it's interesting about how AI services and things are shifting academia into a newer direction that I think is like how was described as an older, more ephemeral style of grading that required participation in the group. Because homework and reports and stuff like that are basically toast. idk
a tool is something you gotta respect and so, I hear ya about, when schools teach git, but don't teach it properly, they are giving people credit for knowing something they don't really know. And it comes across anyway as, they don't respect the tool
I’m deep in the sauce and I still do git add . , git commit, git push… I just run git status and git diff -staged 400 times before because I’m apparently cyber ocd
38:02 Brasil mentioned!
Ahh, the deep words of Samuel Coolranch.
why would rebase or not be a question what
Always rebase your branches before merging a pull, and generally squash merge each pull request.
If you rebase frequently, any issues rebasing are very manageable. And if you feature branch gets really big (and does and undoes and modifies itself in a place that may have changed on main) then you can squash some of your commit in the branch and then rebase.
I don't think universities should teach any specific tools, but rather more theoretical foundations which are universal and don't become that quickly stale. Teaching specific tools / languages is totally fine for more vocational institutes where you need to learn stuff that is directly applicable at work. Having said that using particular techs/languages as an example is probably great idea, but I'd rather see graph theory and conflict resolution algorithms taught at unis than particular tool
I learnt git myself through practicing, i recently have had some freelance jobs where i had a bunch of smarter devs than me on every aspect, well as you guessed they didn't know the crucial roles of git and their whole hard working job was fixing conflicts and i laughed my but on them 😂
8:29 that’s a good take. Uni should teach how to build git, not how to use git.
Bachelor's degree in Sweden is 3 years.
git commit -am 'comment' will add the changed files and commit them.
Unfortunately there are many issues with this course. Back merges are not identified as issues. Rebase suffers badly from multiple conflict resolution sessions. Many problems.
I personally don't use GIT that much, basically because I used to trust in my own criteria when merging code and not leaving it to a merging tool (completely), sometimes there is bussiness decision to be made in order to know which code has to be pushed to remote. I usually do pull after push and if there's a conflict I revert the whole thing and resolve it with Beyond Compare (or any diff tool you wanna name) all in local before pushing to remote, it gives me peace of mind always.
I always hear from colleagues "you will never be a senior developer if you don't learn all the bells and whisles of GIT, blablabla", but I rather to learn other skills that gives value to the product and help to solve problems, so I choose the tools and how I'm gonna do it, mind your own businesses. I mainly do this because i'm not vegapunk from onepiece, the amount of tech skills you can attach to your head is not infinite so I choose which to master and which to learn the very basics.
git push --force-with-lease aliased to gpf for safe and fast push forces
Bro why are you looking at me like that
Seems y’all are trying to distinguish between CS and Software Development.
I really like actually preserving the history of the existence of a branch. I cut feature branches from master, rebase them back on master whenever master has changes, and then I _merge_ the feature into master when it's done. Then if my feature has a critical bug we revert the entire merge. Edit: also git push --force-with-lease exists and is wonderful.
Did I just watch Prime invent run length encoding in real time?
This take on not teaching git is a good take. Like learning to edit movies with razors and tape before they give you a computer. True.
GIT MENTIONED
CS education works very differently here in India... they only talk about stuff without teaching us to implement the foundations. I had to learn everythng on my own... rendering the degree practically useless
Go watch a FREE video on git for about an hour at most on youtube, and it will cover you 99.999% of all professional grade development out there. For those that think you are the special one that needs this course cos you are the 0.001% developer, good luck with paying for these courses no matter how cheap it is.
Why not just an irl bifurcation. University education and Vocational school. I mean we already have something of a sorts, but it's all about what the industry will accept.
You also have to pay people a good wage to work at a vocational school vs a university where while they may be paid like shit (i had a professor at a decent school paid like 45k), they get to put that institution on their resume. This is the problem you are up against.
Irresponsibly tearing down institutions is not the answer though. Not that anyone in this video suggested that.
SVN sucks because it gives you too much rope, but its pretty much git
Revert: Revert:
I can’t believe he actually said C#
git add . .... ftw
I accidentally deleted my project's source files trying to get git to track it. Never used it again. My only familiarity with it is in resolving the problems with it, and finding that in general, you just have to delete everything and clone it fresh. Like when everyone was changing their primary branch from master to main, I searched it, I tried to figure it out, could never get it to switch the upstream to main. Fetching tags and branches is hit or miss.
Don't know. It's just never worked for me, something about it is designed completely counter to how my mind wants to work. Which results in me finding all the small cracks to go in and completely screw everything up.
Is that Tortoise? 🤣
I like git add -u
26:00
I don't need git because I git so good at coding
PREWATCH
yall really out here rebasing? im a merge andy and like it
Primeagen isn't just a loudmouth ? 😅 🤯
If you are a dev then you are going to be using git all the fn time, just as you'll be using an IDE or a text editor or compilers if you use C or some other shit and debuggers fairly often. Not learning part of the basic common tooling for the general environments i think is a massive blunder.
Git has merkle trees data structures (which is also used in blockchain), should schools teach fundamentals of tree traversing and hashing. These are very CS concepts, and git is a great case study.
i will just stop talking. whyyyyyyyy backend in js?
Banter should be a required course
rerere!
FTPee
CS is already teaching nothing of value, might as well teach something
If your CS curse didn't teach you GIT by year 3, you should be able to get full refuns in that shit.
It's literally like if driving class would just nit teach you how to check oil in your car, cause "it's theory of driving, not real driving here".
Before using git, I had a script that automatically zipped my current project on Windows startup. The zip file was named after the current day and time.
I regularly uploaded those zip files to an FTP server (manually) and actually never lost any data by accident.
real question is, was it written in clojure ;)
I have been questioning why I use git for personal projects and recently set up an automated hourly (rsync) backup of my dev files to another disk on my computer. A missing feature is to have some historical backups to rewind changes.
@@GDScriptDude seems like you answered your own question
Most developers rolled thier own backup routine before source control became popular. We were all forced to when we lost our work just once, maybe twice for a slow kid like me.
if you're using git as a backup tool, you're probably using the wrong backup tool. eg. borg backup would probably serve you much better
Good grief, we had trade schools, polytechnics, apprenticeships up til the 1970's. Only 10% of kids went to university to float away in academia and research etc. Since then we had the big push to get every kid a "university" education, which involved renaming all the trade schools and polytechnics to "university". Along with the whole disaster of kids having to borrow piles of money to do the study that is now demanded of them. No longer any chance to get a grant or work and study. And of course the bachelors degrees simply got devalued, unless you were one of the luck few to go to a traditionally renowned university. I have been watching this disaster unfolding since I graduate in 1979.
On the other hand when I've worked at places hiring fresh-out-of-college devs, the fact that the colleges teach a lot of useless information but couldn't even be bothered to expose students to git was infuriating. Because _consistently_ I'd have to spend 70% of their onboarding time walking them through "okay, first you have to git add, then- no you have to type git add- no you can't do a commit yet because you have to stage things first... Yeah git _is_ really useful I have _no idea_ why your teachers didn't tell you about it :eye-twitches:" These kids aren't even _at_ the starting line half the time.
Yeah... there are certain tools every CS student should learn, and Git is one of them. Version control, debugging practices, and an example of a build system should be mandatory stuff you learn.
I recall first version control. Sources on 64MB USB drive, once in the week we met with friends, we compared our new files with "repository" copied them over. If two of us had files modified in last week, we manually checked for conflicts. Then maybe in 2003 or 2004 we started using tortoisesvn.
Just put a link to a quick git crash course in your Programming 101 class handbook and move on.
My daughter was in a hackathon at 14 years old, where I witnessed a bunch of children learning Git; on a random mix of Windows and MacOS. Git has to be taught in school. Because teachers without it will give you assignments full of bugs. My daughter actually quit high-school computer science because of all of the drudgery of just catching up to debugged code. High school and college absolutely must teach basic Git as a prerequisite. I think CS professors saying that "teaching git is not my job!" are total idiots. It's a prerequisite to any class where the teacher needs to disseminate code. The teacher ALWAYS has bugs; that get mixed in with student bugs.
Or you know… tell them to download the zip lol
@@ar_xiv that's exactly what the problem is. most of the kids download the zip. they can't get the example to work. the teacher has YET ANOTHER bug; almost every other project. if teacher keeps putting out new versions, it's chaos when the patches come in over the buggy code that the kids are writing. Rather than.... teacher diffs to see what the kids did, and merging the teacher's bug fixes.
"just send zips around", or "just put code in a directory" is why git was created in the first place; to stop that madness of multiple editors on the same archive.
I feel this. No so much that they need to teach git, but that requiring the subject will force teachers to learn it, and thus improve the deployment of their assignments. That makes sense. Assignments of complexity can make the learning more "cool". But deployment of assignments with complexity requires a level of ops sophistication many teachers lack.
@@robfielding8566bro idk what school you went to but my teachers use Linux and CML and bash to make sure all files follow same format and syntax and don’t have bugs
@@ryanfeeley2407what projects do you think students work on? Their not projects that build , their usually stand alone 2week-1month projects . A student submits it and moves on. GIT has no place in this . These aren’t mass contributed projects
I learned to not use "git add ." after adding 1000 meta file changes to a unity project during my first job. Also, another job had a build system that added unwanted local configs occasionally. So I think double checking isn't bad. Also, I also think going file by file helps remove any extra comments or unused code. Like a mini pr you do for your own code.
No, you can still use "git add .". Just have to put those meta files in ignore.
@@marioprawirosudiro7301 You can't just add them to a git ignore. Unity meta files sometimes need to be adjusted. Because they positioning and more game object values. I don't know what it was but something slightly adjusted every unity object in the scene after I saved. Sorry, but you not very convincing. We all make mistakes, and looking at you work before committing is probably going to help in the long run as a professional.
@@jeremylakey680 I know. This is one of the biggest reasons why I moved away from Unity. Back then my solution was to ONLY include the scripts, zip away the corresponding meta folder and share it on a file sharing site so my teammate can have the same ones, effectively treating the meta files as blobs (which tbh, it effectively is). We did this for every commit. It was tedious, but still better than dealing with the incessant messages because the meta files keep changing.
The issue with this is that programming without a ruined education is very limiting. Existing vocational trade schools you are thinking of exist, but they are largely terrible at picking good subjects to teach and often hire incompetent people as instructors.
Or... you just use git feature built into intellij. I have used so many git tools as well as git cli and there's nothing easier and faster to use than the feature simply built into intellij. No git add -a. Everything you want to be added is just automagically added
One doesn't simply learn git in three days. Or three years. Or ever.
Can't wait to check the git course out. But, Lazygit ❤ check it out!!!
Hey Lane, I'm a new graduate who was feeling pretty dispirited the last few weeks while trying to find a job. Your videos have really helped motivate me and put me on the right path to enjoy making projects and doing some leetcode in the meantime. Thanks for all you do!
In Germany, we have the concept of a University of Applied Sciences. You will also be able to do a Bachelor's or Master's but the goal is not to prepare you for academia, it is to prepare you for a career in the field. And often, professors are actual practitioners who do the teaching on the side. The degree also includes projects where you help a company with some practical problem.
yeah but fuck `git stash`
Woah woah why you gotta be hatin
Pull main into your branch, resolve commits, push and squash back into main. Clean, fast, easy, and hides the horrors that happened on the feature branch.
Also supports reverting.
whats up with the framerate? is prime an elaborate claymation hoax?
For those who wondered who he was talking about "The man that knew everything" in the 1700s... @14:06
Samuel Taylor Coleridge & William Wordsworth
28:00 "Always bet against yourself". I totally agree. Always assume you've made a mistake you're not aware of and you'll need to fix the code two years into the future when you cannot even remember writing the problematic line. The code should be as simple as possible to be easy to debug and commit messages should explain *why* the line of code was written in the first place. Commit messages should not explain *how* the code was modified because automatically generated patch already contains that information. It's okay to *also* include summary of changes but it's not replacement for documenting why the code was modified.
AI generated commit messages can only do the summary part at best.
BTW, couldn't agree more on teaching how to build it (git) and how the distributed algorithms work, how 3 way merge works, etc, etc... Once you know that, using the tool is easy, and you have the benefit of being able to build other systems that use those same ideas (just hopefully not blockchain stuff) :)
Add some "evil merges" in that Git training. Lol. Those are always fun.
Finally I might end the debate. "Why use neovim? VSCode so pretty. VSCode so kewl" but can it order COFFEE?
Starting from 28:00
Is it not already possible to use squash commits on merge without using rebase? One only needs to resolve the merge conflicts once per merge into their feature branch.
This points toward the norms around your team's contributions. If you're releasing with branches, developing branches off of other branches, maintaining a feature for a long time outside the main, rebase makes more sense. It's less necessary for trunk based development.
No we don't need to teach git. It is an overly convoluted version-control software. The fact that you need a class to avoid "big oopsies" should be a big hint. The most effective devs are often those who avoid needless complexity, something that is often learned with age and experience..
Just think about kids at CS programs who are trying to learn git when they don't understand all the foundational concepts that it relies on.
If you don't know about hash functions and content-addressable databases, how can you understand git commits?
If you don't understand trees and pointers and graphs, how can you understand git history and branches?
If you don't know what a stack is and the push/pop interface, you'll learn about git stash and most of your confusion will be about stacks, not about git stash.
Git is a good way to get quickly exposed to a lot of programmer culture in an informal way, just like any other good command-line tool. But an academic program should take a more systematic approach to learning the concepts in a more formalized and in-depth way, not just hold your hand through learning to be a consumer, like some sort of wildly expensive boot-camp.
Honestly I have senior (senior, senior) devs in my team that use a git frontend and have no clue what is happening in the background. It's insane the checks and config scripts we need to add to make sure people don't fuck up our repository. I feel like it has gotten better with newer devs, as they tens to at least use the CLI.
Technically, I have a proposal.
What if we remove useless degree. Like instead of having phd or masters, we should just have professional degree.
So you can have bachelor's degree in computer science (this teach you the basics and fundamental concepts)
Then you can get the Professional degree (which teach you businesses setting, corporate, how programming is done in those setting)
Just to note. Every business and company is different. You can't technically teach everything, but at least Professional Degree should teach you how real world works.
I learned git at work when the R&D team started letting me do bug fixes