News for hackers. Stuff that matters.
Re:What Could I Possibly Learn From a Mentor Half My Age by jcadam on Monday September 12, 2016 @10:57AM (#12480198)
We hired a new grad last year... he's very sharp, though of course inexperienced when it comes to working as part of a team on a large project (but time will fix that).

Now, I have no idea how this is possible, but he has deeper knowledge of Hg and Git than anyone I've ever met (If your experience is limited to school and solo personal projects, how in the world do you develop advanced knowledge of version control? On my personal projects, I rarely need anything more than git add/commit/push/pull and basic branching).

I'm over 10 years older than this guy, but I find myself asking his advice whenever I need to do something advanced or out of the ordinary with Git.

Re:What Could I Possibly Learn From a Mentor Half My Age by lmm on Monday September 12, 2016 @11:20AM (#12480458)
Fancy git is still useful on personal projects - if anything it's more so, e.g. you can rewrite history without worrying about other people using it. I think a lot of people who remember a time when committing was expensive are stuck in that mentality, whereas if you commit every 5 minutes you'll naturally end up using the more advanced features to organize your work.
Re:What Could I Possibly Learn From a Mentor Half My Age by jcadam on Monday September 12, 2016 @11:34AM (#12480589)
I'm getting better about committing more often (unlike back in the days of SVN/ClearCase/etc.), but I'm still not quite up to committing several times a day like these kids are wont to do :)
Re:What Could I Possibly Learn From a Mentor Half My Age by kwhitefoot on Monday September 12, 2016 @02:39PM (#12482448)
I don't use git at work, we use TFS instead. I commit to the build server as soon as I have something that is a complete step in the process of developing a feature or fixing a bug especially if that step carries a risk of breaking something.

The build server then builds the whole application and runs the unit tests. I might do this once a day if I'm mostly thinking rather than furiously typing or ten times a day if it is all flowing perfectly.

It's not just the kids who do this, I'll be 61 in a couple of months. On the other hand one of my colleagues who really is half my age prefers to complete the feature and only commit to the build server once the whole feature is complete. He uses TFS shelvesets to make sure he won't lose anything.

Re:What Could I Possibly Learn From a Mentor Half My Age by shostack on Monday September 12, 2016 @02:00PM (#12482050)
I wonder if there is any correlation between commit frequency and a person's tweet or FB post frequency. Are people more active on social networks more likely to carry that over and commit more often?
Re:What Could I Possibly Learn From a Mentor Half My Age by aninhumer on Tuesday September 13, 2016 @12:41AM (#12485673)
Well I commit relatively frequently and post on twitter/facebook approximately never, so make of that what you will.

More generally I don't see the connection? I'm not making commits to show off my cool code to my colleagues. I'm making commits in case I want to revert specific changes later.

I learn to commit more frequently every time I realise I need to undo something manually because my history is insufficiently granular.

Re:What Could I Possibly Learn From a Mentor Half My Age by lmm on Tuesday September 13, 2016 @06:27AM (#12486813)
For me if anything it's the opposite. I blog rarely, because I spend a while thinking over my posts and getting them right. (That said, I commit frequently even there, because I maintain my blog in git).
Re:What Could I Possibly Learn From a Mentor Half My Age by wott on Monday September 12, 2016 @02:38PM (#12482430)
It's funny you mention that, because I have developed the same feeling, although I have no idea if it holds true or not.
Re:What Could I Possibly Learn From a Mentor Half My Age by TeMPOraL on Monday September 12, 2016 @01:35PM (#12481776)
> If your experience is limited to school and solo personal projects, how in the world do you develop advanced knowledge of version control?

If your experience is limited to university and programming for work, how in the world do you develop advanced knowledge of... well, anything?

That is - is that new grad perchance a hobbyist programmer? When you do this stuff for fun and without deadline pressure, especially when young and thus having ample free time, it's much easier to actually learn stuff, and to develop deep understanding of it. Adult life and commercial pressures really go a long way to make people avoid understanding things they work with - after all, we're not being paid to comprehend the tech deeply, we're paid to achieve business goals.

Re:What Could I Possibly Learn From a Mentor Half My Age by Florin_Andrei on Monday September 12, 2016 @02:05PM (#12482080)
> We hired a new grad last year [...] Now, I have no idea how this is possible, but he has deeper knowledge of Hg and Git than anyone I've ever met (If your experience is limited to school and solo personal projects, how in the world do you develop advanced knowledge of version control?

I learned Linux in the '90s, when it came on a stack of floppies, long before anyone else would have thought to use it in production. It was never more than a pet project, but I kept hammering it because it was so cool. Unlimited size matrices. Compile the kernel any way I want. A real multi-user OS? Holy smokes, this is a very cool hobby.

Eventually I got a job at a startup that was running all their stuff on Linux. Lo and behold, I was the local "Linux expert", blowing everyone else out of the water with my knowledge of, well, everything needed to make that thing work.

So that's how it happens. If you like something, and you're passionate about it, and you have an obsessive streak, you'll jump lightyears ahead in a very short time.

The Git guy probably spent countless hours figuring out obscure aspects of the tool's workflow, just for the heck of it. Deep interest + focus + long practice = mastery.

> On my personal projects, I rarely need anything more than git add/commit/push/pull and basic branching)

Neither did he, strictly speaking, but the difference is that he kept hammering it.

So you see, this is not about generational differences. This is good old fashion geeks doing what geeks do best.

Re:What Could I Possibly Learn From a Mentor Half My Age by antisthenes on Monday September 12, 2016 @03:59PM (#12483144)
> So that's how it happens. If you like something, and you're passionate about it, and you have an obsessive streak, you'll jump lightyears ahead in a very short time.

You forgot lots and lots of free time . Time like that you simply don't have as an adult.

Re:What Could I Possibly Learn From a Mentor Half My Age by Florin_Andrei on Monday September 12, 2016 @04:14PM (#12483253)
That's a good point.
Re:What Could I Possibly Learn From a Mentor Half My Age by pacala on Monday September 12, 2016 @11:27AM (#12480514)
Deep knowledge of git is a sign of immaturity :) There are literally 10 commands one will ever need, which can be conveniently aliased to something more sane. Keep the brain space for something that produces higher value add.
Re:What Could I Possibly Learn From a Mentor Half My Age by teej on Monday September 12, 2016 @11:50AM (#12480716)
Ehh, I've been in situations where I screwed up so bad I had to find the "person who actually knows Git" come and save me. Let the kid go deep into whatever they want. Maybe having useful knowledge that others don't drives that person to like coding and makes it fun for them.
Re:What Could I Possibly Learn From a Mentor Half My Age by dasil003 on Monday September 12, 2016 @12:18PM (#12480982)
I disagree, git is my favorite VCS by far because of the power it gives to truly craft a record of ones development history. A finely crafted development history pays major dividends as a project ages. I just got a thank you note for commit messages I wrote 4 years ago on a previous project.

A lot of devs see commit messages and rebasing as useless pedantry, but once you start to take it seriously it only takes a little bit of extra time, and it provides so much future benefit via git-bisect and general spelunkability.

I also think it's worth investing more time in a tool based on its longevity in ones workload. In that regard I put git at the top of the food chain, as I expect to use it even longer than Linux, for example in my case: Git > Linux > Vim > Ruby/Python > OS X / GUI tools.

A side effect of being this good at git is the ability to bail out your colleagues when they royally fuck up a merge or rebase.

Re:What Could I Possibly Learn From a Mentor Half My Age by pacala on Monday September 12, 2016 @01:20PM (#12481618)
For development history, we're using good PRs and good PR comments on GitHub. We've started using GitHub squash commits, but not enough long term usage to say how reliable it is. No need to manually rebase or fix someone else's broken rebase.

The workflow is directly inspired by git-as-a-wrapper-around-Perforce used at Google.

Re:What Could I Possibly Learn From a Mentor Half My Age by dasil003 on Monday September 12, 2016 @04:17PM (#12483275)
I'm a big fan of PRs/comments on GitHub as well (although they do raise some data ownership issues). Squashed commits are interesting, but not something I've used personally in GitHub. I think squashing, especially automatically, has big tradeoffs.

It's nice to have a cohesive unit of change in a single commit, but if your mergeable features have a lot of moving parts it may be too much information in one giant blob, losing valuable history. There are certain things I like to be in individual commits, like for instance, DB migrations in Rails or Django, or Gemfile/Gemfile.lock upgrades. Having these in separate commits allows for easier conflict resolution later, and are also a nice granularity for practices like zero-downtime continuous deployment where you need to have multi-phase deploy of migrations (ie. phase 1: deploy migrations that add fields, phase 2: deploy code that requires new fields, phase 3: remove fields required by legacy code).

Maybe in a large team with a large volume of PRs then squashing by default is preferred so you can make sense of a fast-moving history, but given that it's so easy to squash selectively with `git rebase -i` that is my preferred method, at least for the team I'm on now.

Re:What Could I Possibly Learn From a Mentor Half My Age by barrkel on Monday September 12, 2016 @12:09PM (#12480898)
I find thinking of git as a DAG of diffs, and branches as mutable references to DAG nodes, a simplifying conceptualization. I found git really easy to pick up and much, much simpler to learn and use than svn or cvs.

Thinking of it this way, I know the solution to my code repo problems before I know the exact commands that perform the graph transitions. Because I have this mental model, I know the commands must exist in one form or another.

Re:What Could I Possibly Learn From a Mentor Half My Age by gregshap on Monday September 12, 2016 @11:56AM (#12480764)
1) You never know what someone means by 'deep knowledge' 2) What works on a personal project, or microservice repo, might not scale well with many engineers doing overlapping work in the same codebase 3) consider that even if you are perfect, other people can make mistakes that introduce issues 4) 'advanced' techniques can make a complex version history more readable, which pays dividends by saving brain space in the future
Re:What Could I Possibly Learn From a Mentor Half My Age by copperx on Monday September 12, 2016 @11:43AM (#12480667)
Some day you will be caught in a corner case and you'll spend half a day learning about git's internals.
Re:What Could I Possibly Learn From a Mentor Half My Age by alexbanks on Monday September 12, 2016 @11:57AM (#12480777)
Which I've always thought was a sign of mediocre software, but HN/Reddit seems to crucify those that criticize git.

I think Git is like Javascript, it takes relatively little time to learn enough to get up and running, causing most people to forgoe learning all they'll actually need to be successful.

Re:What Could I Possibly Learn From a Mentor Half My Age by pacala on Monday September 12, 2016 @11:57AM (#12480786)
I've been using git for 7 years now, never had the need to go deeper. Lately, I'm using github and pushing / saving my work every so often [kind of like CTRL + S in Windows Office in the '90s]. If something goes wrong, happy to yank the local git and start with a fresh clone from github :)
Re:What Could I Possibly Learn From a Mentor Half My Age by mixmastamyk on Monday September 12, 2016 @02:58PM (#12482601)
Re:What Could I Possibly Learn From a Mentor Half My Age by thesmallestcat on Monday September 12, 2016 @11:56AM (#12480763)
You have to know how git works to use those commands competently...
Re:What Could I Possibly Learn From a Mentor Half My Age by Koshkin on Monday September 12, 2016 @06:55PM (#12484338)
I am not sure if that would be a good thing to say about Git. The idea is that a well-designed system with a sane user interface should insulate the user as much as possible from the need to know the system's internals.
Re:What Could I Possibly Learn From a Mentor Half My Age by thesmallestcat on Monday September 12, 2016 @08:15PM (#12484791)
Not the internals, but what the commands are doing. What the index is, what a parent or child reference is, things like that are essential to using git effectively.
Re:What Could I Possibly Learn From a Mentor Half My Age by 6DM on Monday September 12, 2016 @11:03AM (#12480273)
I personally learned better on side projects instead of homework. This usually led to my grades suffering :( However, on the up side, I gained more knowledge on Flex at the time than even my professor. I liked working with it and really dug into it. I'm glad I did becuase I when I ran out of money for school, my reputation got me a few gigs that helped me make it to the end.

That guy is probably smarter than me and both dug into git and was diligent in his homework. Those kind of people can have some really deep knowledge on areas they care about.

Re:What Could I Possibly Learn From a Mentor Half My Age by thesimpsons1022 on Monday September 12, 2016 @01:13PM (#12481546)
one of my friends was really into doing fancy git stuff for no reason. he knew a lot. but I'll never forget that one time he was trying to do some crazy fancy stuff and accidentaly deleted our local changes for our OS project... Truth is most of it is unneeded.
Re:What Could I Possibly Learn From a Mentor Half My Age by drzaiusapelord on Monday September 12, 2016 @11:27AM (#12480516)
hen I do something 'for work' its just that, work. I'm not going to spend my nights and weekends on it or learning the finer points of it. I have other responsibilities and am way past the age where I'm deeply curious about technology and have to 'get it' on a deep level to feel satisfied or competitive. When you're a student and hobbyist, you have all these things. If your curious, then you have the time to fulfill that curiosity.

I also suspect the young coders today are all about github so knowing git's in's and out's is going to be natural for them.

Re:What Could I Possibly Learn From a Mentor Half My Age by UK-AL on Monday September 12, 2016 @11:13AM (#12480365)
Different generation. The new generation has grew up on social coding on GitHub.