Details
-
AboutHello everybody, I am a Python developer.
-
SkillsJavaScript, Python, Linux, C
-
LocationSZ
-
Website
-
Github
Joined devRant on 3/9/2017
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
My team is like the Avengers except instead of different superpowers we all have different personality disorders.9
-
I think the reason why git beginners have a hard time with it is because the api is a bit untuitive.
For example: if you want to "unstage" staged changes, you run git reset, and if you want to "delete" those changes from your working copy, you git checkout those files.
But then, you find out that you can do all of that if you git add . and git reset --hard.
So you're like "huh..."
And then you discover that if you end the resethard with a branch name/commit id then you also make current branch point to the commit or that branch/commit (respectively).
So you're like "huh..."
And also if you add a commit id or branch name to git checkout, you change the current branch to specified/enter detached state with HEAD pointing to that commit (respectively).
Oh and you don't use git branch to create branches, you use git checkout -b because it's a lot shorter.
So here's a rundown: git reset mutates things related to files, but also mutates things related to branches.
git checkout also mutates things related to files and mutates things related to branches too (in a diff way). Also, creates new branches.
I don't think this is intuitive. We users use the same commands for different purposes with just a different flag.
Commands shouldn't mutate different types of things. But don't composite commands (as in, "smart" commands that mutate different things) shoudln't be a flag in an existing command, it should be a single new command of its own.
Maybe if I reread the internals of git now, I'll be able to disgest the dozens of technical terms they throw at you (they are many). And in my mind, the api will cognitively fit to the explanations.
Here's another one that feels weird too.
If you want to make your changes start on top of someone else's commit, you do git rebase.
But git rebase -i can be used for that, and also to delete, modify changes or message of, reorder or combine previous commits of the current branch.
Maybe the reason why several things we do overlap with the same commands is because they internally do similar things, and while not separating those commands might make it less intuitive, it makes them more sensible? i dunno...
disclaimer: I'm not setting this opinion in stone though, and am aware that git was created by one of the most infuential programmers.6 -
"Hi xxx, please stop asking me the same question. I've answered it 4 times already via email, slack and in person on our zoom calls, over the past 2 weeks. I do not own the ticket and have no idea of the status or the dates. Ask the owner."
- slack response I was forced to write this morning to the guy my company put in charge of the entire product (mobile, multiple backends, frontend etc.).7 -
Was helping somebody with a little C++ issue (disclaimer: I know jackshit about C++).
After a while off reading his code and opening a file called "pi.cpp", I noticed something odd...
This guy literally thought is was a good idea to put 81663 fucking decimals of pi in a #define statement :^)
On the screenshot, that weird "noise" on the right is actually a scrollbar of the code itself...33