Author Topic: how do you organize code, versions, projects etc?  (Read 15563 times)

joeclark77

  • Rogueliker
  • ***
  • Posts: 90
  • Karma: +0/-0
    • View Profile
how do you organize code, versions, projects etc?
« on: March 07, 2013, 07:24:16 PM »
How do you guys keep track of your code as you write and revise programs?  I'm looking for something that allows me to keep track of versions, and access the older versions of the code.  I also am undecided about whether I want to open-source my stuff... perhaps with some programs I will, and others I'll want to keep private.

I know there are version-control systems but haven't used anything like that since I was doing website professionally more than ten years ago.  So what's the best tool to use now?

NON

  • Rogueliker
  • ***
  • Posts: 349
  • Karma: +0/-0
    • View Profile
    • Infra Arcana
    • Email
Re: how do you organize code, versions, projects etc?
« Reply #1 on: March 07, 2013, 07:39:39 PM »
I recommend Git and to host it on Github. Though open source is a requirement for hosting on github for free IIRC.

My repository:
https://InfraArcana@github.com/InfraArcana/ia.git

It's very handy to look at older versions, here I can see how all the code looked at any time I committed it (as you can see, I mostly use commit messages like "bla" and "asdf" :D):
https://github.com/InfraArcana/ia/commits/master

If you want to use this I could write a little about how to set up and use Git.
Happy is the tomb where no wizard hath lain and happy the town at night whose wizards are all ashes.

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: how do you organize code, versions, projects etc?
« Reply #2 on: March 07, 2013, 09:33:35 PM »
I'm seconding Git. If you have code that you don't want to open source, you can have a local repository. If you want to later open source the code, it is trivial to upload your changes to Github (including the full version history).
Everyone you will ever meet knows something you don't.
 - Bill Nye

Nymphaea

  • Rogueliker
  • ***
  • Posts: 74
  • Karma: +0/-0
  • Maria Fox
    • View Profile
    • Nymphaea.ca
Re: how do you organize code, versions, projects etc?
« Reply #3 on: March 07, 2013, 10:12:48 PM »
There's lots of options. One I've been looking into recently is Fossil, it seems very promising.

joeclark77

  • Rogueliker
  • ***
  • Posts: 90
  • Karma: +0/-0
    • View Profile
Re: how do you organize code, versions, projects etc?
« Reply #4 on: March 07, 2013, 10:16:08 PM »
Thanks for the tips, I have installed Git and it works pretty well.  The Windows-Github GUI is a little bit cartoonish for my taste, but I guess that's the way everything's supposed to look with Windows 8 (I'm still on windows 7).  I will let you all know if I get around to uploading anything that might be of use.

PS: I noticed that GitHub has the advantage of offering a built-in bug tracker, issue tracker, etc, which would be nice since I'm not interested in running a new website for every project.

NON

  • Rogueliker
  • ***
  • Posts: 349
  • Karma: +0/-0
    • View Profile
    • Infra Arcana
    • Email
Re: how do you organize code, versions, projects etc?
« Reply #5 on: March 07, 2013, 10:25:19 PM »
The Windows-Github GUI is a little bit cartoonish for my taste
The git client comes with a bash terminal emulator. I use it myself since I don't like the cartoony stuff either.
Happy is the tomb where no wizard hath lain and happy the town at night whose wizards are all ashes.

joeclark77

  • Rogueliker
  • ***
  • Posts: 90
  • Karma: +0/-0
    • View Profile
Re: how do you organize code, versions, projects etc?
« Reply #6 on: March 07, 2013, 10:57:10 PM »
Ah, what the heck.  I uploaded what I've got so far.
https://github.com/joeclark77net/jc77rogue

There are dozens of python roguelikes but apparently I'm the only person on GitHub using pyglet as an input/output library, so I figured it might be of some use to somebody to share my work.

sokol815

  • Rogueliker
  • ***
  • Posts: 85
  • Karma: +0/-0
  • Web Developer by Day, still Web Developer by night
    • View Profile
    • Email
Re: how do you organize code, versions, projects etc?
« Reply #7 on: March 08, 2013, 04:40:02 AM »
I just upload them to my google docs folder under a project name. Everything has the date it was committed at. e.g. 13-03-07 2139

keeps them private, and always at my fingertips should I need them anywhere. If you do decide to share a certain version or the whole thing, it is easy to assign individual people different types of access/edit permissions.

The main thing is to have a backup that is not on your hard drive... you would be sad if that crashed and you lost your project.
« Last Edit: March 08, 2013, 04:41:57 AM by sokol815 »

TheCreator

  • Rogueliker
  • ***
  • Posts: 370
  • Karma: +0/-0
    • View Profile
    • Fame
    • Email
Re: how do you organize code, versions, projects etc?
« Reply #8 on: March 08, 2013, 08:28:50 AM »
I think it's safer to have the repository on a local hard drive and make backups manually, from time to time. You will lose some changes if your computer should explode, but you are able to work offline. TortoiseSVN offers this kind of functionality, almost without any effort to set things up. It just integrates with Windows Explorer, so that there's no gayish GUI unlike the Git client (at least not under good old Windows XP).
Fame (Untitled) - my game. Everything is a roguelike.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: how do you organize code, versions, projects etc?
« Reply #9 on: March 08, 2013, 02:32:40 PM »
I never knew why you should access older code. I don't use version control, because I don't need it.

Nymphaea

  • Rogueliker
  • ***
  • Posts: 74
  • Karma: +0/-0
  • Maria Fox
    • View Profile
    • Nymphaea.ca
Re: how do you organize code, versions, projects etc?
« Reply #10 on: March 08, 2013, 02:42:13 PM »
It's pretty much necessary for projects with multiple people to prevent conflicts and such. But even with a single person, it helps with finding bugs, keeping track of changes, and if need be, rolling back to an older version because you liked it better. It's also very good with mods, as mods are generally version specific, and some people may be interested in having access to older versions.

I find the main problem with most version systems, especially for independent developers, is they are too clunky and fancy for simple use, and get tedious. It's why I have been looking for something new lately; SVN is a pain when working alone, Git is better, but still somewhat excessive. I'm looking at trying Fossil, and if that doesn't work out, I'll just write my own simple system, not like I need full sharing support.

joeclark77

  • Rogueliker
  • ***
  • Posts: 90
  • Karma: +0/-0
    • View Profile
Re: how do you organize code, versions, projects etc?
« Reply #11 on: March 08, 2013, 03:03:10 PM »
Well, for me I keep re-factoring my code as I figure out what works better, and each time that means deleting a bunch of objects and methods that I put some time into.  So I'm thinking about a situation where I want to go and grab some methods from an old object and move them into a new object that fits the game better.

Also, I'm planning on branching/forking my code into a couple of different projects.  I like the idea of tracking the changes and being able to potentially merge them back.

TheCreator

  • Rogueliker
  • ***
  • Posts: 370
  • Karma: +0/-0
    • View Profile
    • Fame
    • Email
Re: how do you organize code, versions, projects etc?
« Reply #12 on: March 10, 2013, 04:10:57 PM »
I never knew why you should access older code. I don't use version control, because I don't need it.

No. You don't use it because you don't know why you should access older code, you have told us already.
Fame (Untitled) - my game. Everything is a roguelike.

NON

  • Rogueliker
  • ***
  • Posts: 349
  • Karma: +0/-0
    • View Profile
    • Infra Arcana
    • Email
Re: how do you organize code, versions, projects etc?
« Reply #13 on: March 10, 2013, 04:56:35 PM »
I never knew why you should access older code. I don't use version control, because I don't need it.
You are not concerned that this project which you probably spent hundreds of hours in gets lost?

Also, I found that if you know you have backups you tend to take bigger risks when removing code/refactoring. I have very little commented-out code because I can just remove it without worry instead.
Happy is the tomb where no wizard hath lain and happy the town at night whose wizards are all ashes.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: how do you organize code, versions, projects etc?
« Reply #14 on: March 10, 2013, 08:45:07 PM »
You don't use it because you don't know why you should access older code, you have told us already.

I don't need old code. I guess some people notice they did something wrong and have to trace back to older code. That's how ordinary people code, I think. For me programming is a linear process, it can only get better.