• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
kirkd

Code management

14 posts in this topic

I've been programming for a while, and I know have a rather large collection of scripts, classes, functions, etc. that I find useful in different situations, but I find it difficult to manage them. Does anyone use a code management application, or does one even exist? I haven't found much thus far in my searches. One requirement would be different languages - C++, Java, Python, R...

-Kirk
0

Share this post


Link to post
Share on other sites
Describe what you mean by "management". Are you talking about managing versions of them, i.e. using version control software? Or perhaps separating them into standalone libraries that you can quickly re-use?
0

Share this post


Link to post
Share on other sites
Good question. Not so much managing versions (in the SVN sense), but more the latter, a tool (database?) where I can collect the routines/libraries I use, and easily access them for later reuse.
0

Share this post


Link to post
Share on other sites
Unless you're using Lisp, Smalltalk or one of its descendants, reuse generally isn't practical since very little code actually is reusable.

For Java, there is Maven. Create POMs for each reusable artefact, keep it in suitable repository.
For C# there is at very least nuget.
C++ is... a mess.
R has CPAN-like project called CRAN.

And so on.

Reuse of small fragments is not practical due to language design - reusing fragments brings in the entire project with it, unless the code was design from scratch to minimize dependency surface.

Hence all of the above projects require you to define code in well-defined contexts which may be reusable.
0

Share this post


Link to post
Share on other sites
antheus - thanks for the response.

NuGet seems to be most closely with what I'm looking for. Unfortunately, I don't write in C#. It would be nice if there was something like this for C++.
0

Share this post


Link to post
Share on other sites
[quote name='kirkd' timestamp='1335456993' post='4935111']
antheus - thanks for the response.

NuGet seems to be most closely with what I'm looking for. Unfortunately, I don't write in C#. It would be nice if there was something like this for C++.
[/quote]

[code]{
std::vector<int> foo;
}[/code]

Congratulations, you just included entire Linux or Windows kernel, all 50 million lines of it.
-3

Share this post


Link to post
Share on other sites
[quote name='Antheus' timestamp='1335457130' post='4935114']
[quote name='kirkd' timestamp='1335456993' post='4935111']
antheus - thanks for the response.

NuGet seems to be most closely with what I'm looking for. Unfortunately, I don't write in C#. It would be nice if there was something like this for C++.
[/quote]

[code]{
std::vector<int> foo;
}[/code]

Congratulations, you just included entire Linux or Windows kernel, all 50 million lines of it.
[/quote]



OK. I'm not sure I follow you on that one. No. I'm certain I don't.
0

Share this post


Link to post
Share on other sites
[quote name='kirkd' timestamp='1335457442' post='4935116']
OK. I'm not sure I follow you on that one. No. I'm certain I don't.
[/quote]

In theory, definition of vector<> complies with standard, so typing above will work anywhere. While vector itself is very well tested, it's not completely portable.

It includes, for example, std::allocator. Implementation of that allocator may be stateful or stateless, which affects the rest of the code and algorithms.

But how is allocator itself implemented? It might need to make a syscall somewhere or call malloc which does the same. Malloc is not defined, it's provided by OS kernel. And OS kernel needs to manage these blocks. And blocks themself are defined arbitrary by OS writers, so there's a linked list somewhere. And this linked list will be making some special ring-0 calls specific to CPU. And the output of all of this is determined by C++ compiler which generates assembly while itself uses same implementation.

Or, C++ code might be compiled to an OS which has no strict kernel and no virtual memory, so vector's allocator would map directly to DRAM, causing slightly different behavior on edge cases, such being unable to support same handling of invalid memory accesses.


C and C++ do not come with abstraction layer that would allow code to be reliably reusable, it depends on everything, from compiler implementation, OS design, build toolchain and standard library implementation. Standard library works pretty well, but just about any other code is completely bound compiler settings and version of OS kernel. Change any of that and things can break in a million ways, while remaining standard-compliant C or C++ code.
0

Share this post


Link to post
Share on other sites
I see your point. It's a bit of an extreme example, but I do get your point.
0

Share this post


Link to post
Share on other sites
[quote name='kirkd' timestamp='1335459212' post='4935125']
I see your point. It's a bit of an extreme example, but I do get your point.
[/quote]

Simpler version is that any real world C++ source depends on implementation of compiler (less so these days) and the OS (down to version) it runs on.

Consider a simple DX example - it implies version of Windows, version of Visual Studio and version of DX. You could copy paste it, but unless you replicate the environment, chances are it won't compile, won't work correctly or will have subtle bugs.

Ideally, all code would seek to minimize external dependencies, but in practice it's too expensive.

Same applies to, say, Python which depends on VM version and implementation (2 vs. 3, CPython, PyPy, Jython, ...) as well as any hidden dependencies, such as native C code used by project. But all of these would be called Python code and snippet might be copyable between them.
0

Share this post


Link to post
Share on other sites
I'm really looking for something smaller scale. I have a couple of dozen C++ classes I wrote that I use regularly (custom exception handler, parameter file parsing, data file clean up, etc.), a large number of Python scripts that do a whole variety of things, and a few R scripts that I use for general data mining, chart generation etc. The issue I run into, is that when I start a project, I find myslef doing many of these things over and over and I find myself looking through my directory tree to find the script I wrote that did this last time, trying to remember where I saved it. I'm just looking for something that will conveniently organize the classes/scripts/etc., and maybe give me the ability to more simply find the ones I've already written. Maybe searchable keywords - that sort of thing.

Again, I'm not doing anything monumental here. I would just like to organize the pieces I have a little (lot) better.
0

Share this post


Link to post
Share on other sites
Why not just include a comments section in each script, where you list keywords you think you might like to search by later?

Then you could just use the search built into your OS.
0

Share this post


Link to post
Share on other sites
[quote name='mrbastard' timestamp='1335465523' post='4935159']
Why not just include a comments section in each script, where you list keywords you think you might like to search by later?

Then you could just use the search built into your OS.
[/quote]

Yeah, I thought of that, too. I was interested in how others manage their code, and hoping for something a bit more elegant.
0

Share this post


Link to post
Share on other sites
You could try putting code you reuse in a personal wiki. Almost all such software has search functionality and versioning. Some also have tagging.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0