View RSS Feed

Petr Schreiber

Idea for handling your project code in 2017

Rate this Entry
Your code. Your creation. Your history of thrill, discovery, ingenious solutions and proud publishing.

Let me remind you of how we shared the code in the past, and what could be the possible direction for 2017.

For years, we got used to a simple system. When we developed piece of code worth sharing or showcasing, we pasted it as forum post, or added it as attachement.
This approach worked, and over years we learned some rules - to stick the latest version to the first post of the thread, along with instructions how to use it.

This approach works, but can be fragile at time. Why? What are the risks?

Problems of the current approach
Sometimes, you would like to take the published version and revert some changes - but you can't, because you erased the original on the hard drive.
And even if you found the backups, there is ton of them and you don't know the differences between different versions.
Sometimes, you would like to step up and create project with multiple collaborators. Fixed ZIP file is not the most reliable choice.
Sometimes, you create a project which could use an extensive documentation, laid along with the code.

I believe all of these issues can be solved by publishing the code into some form of versioning system.

There are many solutions, but I found one especially useful in the last two years - GitHub.

Enter the GitHub
GitHub is one of the services built around Git. Not helping? Git is low level tool for versioning management, it has a very powerful commandline interface, and a well crafted documentation available.

GitHub makes the work with Git simpler by providing both free online hosting for public code and Windows GUI client, which hides the complexity from you.

GitHub client stores every change you do on your code - you just snapshot the code by so called commiting from time to time, and you can both view the changes and revert to them and back at any time later.

GitHub also makes it easy to collaborate - your helpers can create branches, where they can experiment with the original code base.
Then they can propose a change to be integrated to the main branch, usually called master by making so called pull request.
This means you can stay in control of the development and integrate only changes you wish to happen.

Last but not least - you can accompany the code by a Wiki page, which is one of the many extra features the service offers, for free.

The whole code is organised in so called repository, which can be further cloned and adjusted by your collaborators. If you allow them to.

Practical example
I used GitHub for many personal and professional projects over the years. You can have a look for example at Log007, a very simplistic logger for thinBasic scripts.

You can see the project consists of few files:
  • README.md, which is GitHub standard way to give users information about the project
  • .gitattributes, which is Git configuration file, telling that we want to preserve Windows line endings in the projects
  • log007.tbasicu, which is the actual code unit, shared with the community
  • ...and unitTests directory, which contains some tests verifying the functionality


You can review the changes I did over time by looking at commits.
You can also review the documentation on attached Wiki, and also download various Releases for those, who don't want to use Git/GitHub to obtain the code.

To stay connected with our community here, I created a related forum post and I encourage to do so for your projects as well.

Getting started
If I got you interested, you may consider starting your first thinBasic GitHub project. I created a template for you, in our thinBasic repository.

All you need to do now is:


By doing so, you did the first bold step in becoming a modern thinBasic coder, with his code under complete control.
Should you have any questions, just let me know in the comments.

Submit "Idea for handling your project code in 2017" to Facebook Submit "Idea for handling your project code in 2017" to Digg Submit "Idea for handling your project code in 2017" to del.icio.us Submit "Idea for handling your project code in 2017" to StumbleUpon Submit "Idea for handling your project code in 2017" to Google Submit "Idea for handling your project code in 2017" to Twitter

Updated 01-01-2017 at 17:14 by Petr Schreiber

Categories
Development

Comments

  1. kryton9's Avatar
    Hi Petr,

    I used git a couple years back but not since then. I have one question...
    If we fork the thinBasic project, will it go under the thinBasic section or under our own account?
    I never forked a project before, obviously. I don't want to mess up the thinBasic section on github

    Update: I just tried it and it forks it to your own account, so it is safe to do without feeling like you are going to mess up the thinBasic github site.
    Updated 03-05-2017 at 21:52 by kryton9