1. Managing Code

I'm wanting to go through a few directories of source files and kinda clean up the place. I'm sure some files are tests and can be removed. Others might have been temporary utilities or somesuch. I know we have programmers here working with huge code bases. How do you guys manage the code? I'm using mercurial for versioning/archiving/whatever-it's-called, but would like ideas on actually managing the lines of code and code files themselves.

Here's what I'm contemplating: go through each source file and put comments about what the file does. After reviewing all that code, I should have a better handle on what code is where and what it does. Then I might refactor into directories? Just maintain a database of code-dependencies? Are there automated tools for this? Seems Euphoria has a program that will list all dependencies for a source file.

Thanks, smarty-pantses!

new topic     » topic index » view message » categorize

2. Re: Managing Code

euphoric said...

I'm wanting to go through a few directories of source files and kinda clean up the place. I'm sure some files are tests and can be removed. Others might have been temporary utilities or somesuch.

My personal historic backlog of random tests, one-off scripts, bad ideas, and failed projects is absolutely massive.

Every few years I collect it all into a zip file and archive it somewhere, and then purge the actual files off my system.

I am sure a lot of us suffer from this clutter. At least it helps me feel better to think that we do.

euphoric said...

I know we have programmers here working with huge code bases. How do you guys manage the code? I'm using mercurial for versioning/archiving/whatever-it's-called, but would like ideas on actually managing the lines of code and code files themselves.

The best advice I can give is that you try to modularize your code as much as possible.

euphoric said...

go through each source file and put comments about what the file does.

Why do you not have this already?! Stop reading now and go do that first! blink

euphoric said...

After reviewing all that code, I should have a better handle on what code is where and what it does. Then I might refactor into directories?

Several functions that work towards a common goal should be put into a separate library.

Forcing yourself to examine the category and purpose of each function, and then sorting them into discrete libraries can go a long way towards code maintenance.

euphoric said...

Just maintain a database of code-dependencies?

A code snippit manager can be helpful if most of your code is made up of other little bits of code.

Start a new Mercurial repo called snippits and manage each snippit as its own file - with adequate comments and descriptions.

Then include a README that describes the hierarchy of module dependencies, if necessary.

euphoric said...

Are there automated tools for this? Seems Euphoria has a program that will list all dependencies for a source file.

EuDist sort-of does this.

-Greg

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu