r/learnpython • • Jun 09 '20

Github as a beginner

As a beginner learning python, is it too early to create and start coding simple projects on Github. and how do I transfer these codes (simple calculators) to a website I build subsequently?

401 Upvotes

111 comments sorted by

View all comments

5

u/tradrich Jun 10 '20

Github is not a bad way at all to start as an absolute beginner. Unfortunately it's based on git which is not a beginner tool (I've ranted about that elsewhere - forgive me) but there's no escaping it, so you'd do well to read about it.

One option is to use gitpod.io (my interest comes from its use in education). The great thing is that it provides *everything* you need to get going - all in your browser: the latest Ubuntu distribution as the execution environment and an IDE.

So what you do is create a new Github repo - like github.com/your-name/your-project then just throw https://gitpod.io/#https://github.com/your-name/your-project into your browser's address bar, wait a bit and "hey presto" a development environment appears in your browser ready to go - no need to download or purchase anything. Not bad!

4

u/thirdegree Jun 10 '20

Re: the rant

So git was definitely not designed to be a beginner tool. What it was designed to be is incredibly powerful and incredibly flexible. And at those things, it succeeds wildly. Git fundamentally trusts it's users (because Linus wrote it for himself, and he trusts himself) and that can end up with a lot of foot shooting.

I teach a course on git, and I'm generally the person that gets asked when nobody else can fix a git issue. And even then, my knowledge of git internals is pretty shallow. But also, I can manipulate changes and change histories to my heart's content, secure in the knowledge that absolutely nothing I can do will lose content (short of manually messing with things in .git/). That's the power of git.

3

u/tradrich Jun 10 '20

The point in my rant is that the _value_ of git doesn't imply the _pain_ of git. The fact that tools like Mercurial exist shows that. It's a pity and disappointing (to me) that it is git that won the implicit marketing battle - I assume mostly due to its association with the Linux Kernel project.
Given its current importance to the world, it's a shame we don't have a better default version control tool. It's sort of too late now because everyone assume that just how it is - that version control management is hard. It doesn't need to be though!

3

u/thirdegree Jun 10 '20

I mean it kinda does? Version control is an inherently difficult problem, any full solution will also be complex.

I've not used mercurial a ton, but my understanding is that it strips out a lot of the complexity of git, in favor of user friendliness. But what it sacrifices is flexibility and power.

And that's a totally reasonable tradeoff to make. But for people like me that value the flexibility and power more than the user friendliness, that's not a tradeoff I want to make.

1

u/tradrich Jun 10 '20

I'm sure that it is possible to have all the version control features of git with a similar level of simplicity of use as Hg.

Hg's market is such that not enough people need the marginal improvements that the delta with git would give for those to be implemented at present. I'm not sure this delta would actually make a difference for the vast majority of, say, Github users, but gaining the ease of use of Hg would - I contend - in sum, make a big difference.

It's not going to happen though - fine. In that case what would be valuable is improvement in git. I don't think _that_ is going to happen either though - Linus et al have no interest in such changes. What we're getting instead is wrapping tools like Github, Gitlab - others, and surely many more to come. Git is to be the assembly language of their higher-level languages - and that's fine I suppose.

It could've been a better and simpler history.

2

u/thirdegree Jun 10 '20

It might be possible, I don't know. There isn't currently an example of this, and it's impossible to prove a negative.

I don't disagree that most people don't need the full power of git, but some of us do. And I don't have a ton of sympathy for people that don't bother to learn their tools. I've seen too much of that.

But git gets improvements constantly. Better interface, more power, it gets improvements in all aspects all the time. I don't think it's accurate or fair to say that Linus et al aren't interested in these changes, just that they aren't interested in exchanging friendliness for power.

I'd also disagree with characterizing GitHub, gitlab, etc as "wrapping" git. They provide remote hosting, which is a fantastic and important utility, but in no way do they replace or hide git. You still use git to do all the operations on the development side, GitHub just provides a place to push, to receive pull requests, to track issues. And that's super useful, and does replace the whole "email patches to the upstream maintainer" flow which is definitely a good thing.

1

u/tradrich Jun 10 '20

It's a bit like arguments between C++ and say, Java or Python: C++ has the power - but oh the pain! I'm intoxicated by the power and rapid improvement of C++ - but beginners shouldn't *have* to suffer that. Luckily with programming languages they don't! But due to the dominance of Github, for version control it's pretty much git or go home...

Github makes many simpler git operations graphical if you want them to be (I don't) - that's what I meant.

Well, here's to a better world!