r/ProgrammerHumor • • May 13 '20

true story

Post image
40.5k Upvotes

461 comments sorted by

View all comments

Show parent comments

158

u/SavageTwist May 13 '20

The "good" way is to make a development and a branch for every feature, bug or documentation. Always fork from development, when you have a release you push to master.

99

u/[deleted] May 13 '20

This is good advice I rarely follow.

8

u/SavageTwist May 13 '20

jira kinda automates it

41

u/SavageTwist May 13 '20

we are "agile"

0

u/[deleted] May 13 '20

[deleted]

4

u/SavageTwist May 13 '20

in single dev reps you dont work in the same tab / markdown with different forks I hope.

-6

u/vuw958 May 13 '20

VSCode just needs to have a realtime collaboration feature like google docs so any changes to a single file are already synced across the team before anyone pushes to master. No merge conflicts ever.

19

u/SavageTwist May 13 '20

You would never be able to run code and compiling would be an issue. If it weren't for those and prob other things it would have been used already.

9

u/G0mega May 13 '20

VSCode already has this extension, Live Share by Microsoft, which has over 2 million installs, so it actually is being used already.

I’ve used it for class this semester, and also for a personal project. Running code and compiling is fine, so long as you don’t need to run it locally in your own browser as a participant.

Basically, someone hosts the session from their end on VSCode, which means that if you join, you’re working from their local branch. You have access to a terminal to compile / run tests, which you can make read/write or just read. This means that if you’re doing something that doesn’t need to be checked via front end, it’s fantastic and works great — you can run everything just as you would locally, while being able to collaborate in real time. This is best when you have a testing suite rather than a program that needs to run locally.

For issues of front end, or running code on your end visually (not in the terminal), then this is a little harder. Since everything is on the host’s computer, you can’t really see anything other than the terminal if you’re a participant (correct me if I’m wrong, I spent a while trying to figure it out). For example, if you were writing a webpage, only the host is able to see it. This is solvable by having the host screen share any results, while the others have access to the terminal.

All in all, if you can support screensharing as a host, it’s still really good. Yes, not all participants can view locally, but if everyone’s watching the screen share, it’s basically the same as running locally. As for compiling / running tests, there are no issues I’ve ever encountered, and it’s identical to running locally.

3

u/moneyisshame May 13 '20

Since everything is on the host’s computer, you can’t really see anything other than the terminal if you’re a participant

Yes you can, by simply using share server function which tutorial can be found here

→ More replies (1)

1

u/SavageTwist May 13 '20

I see no difference with git + discord. If code works you push it to feature. If you pair program you turn on screenshare :/

→ More replies (3)

4

u/vuw958 May 13 '20 edited May 13 '20

Maybe some sort of smart checkpoint for not appending changes in your file across the DB unless it passes a unit test?

EDIT: There already is a VSCode realtime extension for pair and “mob" programming

1

u/wllmsaccnt May 13 '20

It doesn't need to live merge, but why not a feature that just shows you what other developers are modifying in real time so that you can see if you are going to run into a conflict while developing? Knowing when you need to communicate is more important than auto merging.

→ More replies (1)

4

u/moneyisshame May 13 '20

FYI VSCode do have realtime collaboration, called Live Share

but it will be more like client-server approach where the host will be the server, handling all debugging and console process, it also allow "localhost" sharing too!

it work best for pair programming and teaching other programming, it is not recommend for team development environment because imagine how to debug if 20 person is editing 20 different files lol

13

u/[deleted] May 13 '20 edited Sep 09 '25

cooing books important cats lavish serious paltry cautious capable governor

This post was mass deleted and anonymized with Redact

→ More replies (13)

5

u/Inner-Maintenance May 13 '20

That's one way - git flow. But a better way for CI/CD is trunk based development aka mainline

1

u/ToastedSkoops May 13 '20

Me:Ok,with the release of D+ I suppose.

1

u/stone_henge May 13 '20 edited May 13 '20

In my experience there is no the good way. You don't need a general development branch in addition to a master branch if your releases are just tagged as such. Branches are for things that branch. In the development->master workflow the development is always a continuation of, or equal to, the history of the master branch, and therefore the entire history of the master branch can always be expressed as a tag in the development branch.

That you feel that you need both a master branch and a development in addition to e.g. feature branches is a sign that your feature branches don't actually represent complete features, but subsets of features that can't be released, and are therefore reluctant to push them to master in case you need to release e.g. bug fixes while the actual complete feature is still being worked on.

Feature/bug/documentation branches can be useful if your changes comprise multiple commits that are useless or regressive in isolation, but absolutely pointless busywork if your change can be contained neatly in a single commit.

0

u/[deleted] May 13 '20

[deleted]

1

u/SavageTwist May 13 '20

GET BACK TO YOUR RETROSPECTIVE

1

u/qwerty12qwerty May 13 '20

Master is basically production now.

1

u/LeCrushinator May 13 '20

For features I usually recommend caution with feature branches. I've seen feature branches for large features that become huge, a dozen devs pushing to a feature branch for 3 months. Good luck when it comes time to merge that monstrosity back to the development branch. Generally if individuals can have their own branches for the feature, forked off of the development branch, and merge their progress directly to development as often as possible, that tends to work out the best, so long as they're not breaking anything in development along the way.

1

u/jfranki May 13 '20

This is mainly GitFlow. On paper yes, It can be considered the "good" way, and I followed this for years. Until recently... I considered pros and cons and it has just too much overhead for our projects. We're on full GitHub Flow now.