How does your Pseudocode look?

Started by
22 comments, last by 100GPing100 10 years, 1 month ago
Question. So, in the event that you are dealing with a foreign API, you all still don't use pseudo code? It's usually the API that makes getting things done a bit slower for me. I am using a game engine on the PC that uses lua, as well as game IDE called CODEA on the ipad that uses lua. I find instances where I don't know how to do something using their API, so I have to use some sort of fill in until I find out how to do it.

They call me the Tutorial Doctor.

Advertisement

Question. So, in the event that you are dealing with a foreign API, you all still don't use pseudo code? It's usually the API that makes getting things done a bit slower for me. I am using a game engine on the PC that uses lua, as well as game IDE called CODEA on the ipad that uses lua. I find instances where I don't know how to do something using their API, so I have to use some sort of fill in until I find out how to do it.

No. Empty methods again can be useful and even filled with dummy code but I fail to see the point personally in writing things out step-by-step in psuedo then translating it into API calls. If I have an empty method called paintControl() it is obvious what it needs to do, then as I am implementing the details I refer to the API documentation.

But there's nothing wrong with using psuedocode in the way you describe. Not sure why you are asking this. If it works for you, great. Who cares what other people do?


Not sure why you are asking this

Just wondering how other people do it, because there might be a better way than what I do. I am trying to find the fastest ways to get things done since I am making things by myself. Then I can iterate over the project with details as needed. Trying to use this process for my 3d modeling as well as my programming. For instance, thanks to your response in the other thread about the behavior system, and the responses here on how I might lay out the code before I have all the parts, I was able to get it working in less than 5 minutes. Adding features this quickly speeds up my workflow tremendously, and I get less annoyed at myself.

I do see where I might use some of the other techniques mentioned here though. Perhaps I might do the layout diagramming thing mixed with a little mind mapping to display how the 3d models interact with the code.

They call me the Tutorial Doctor.

I either use C, Lua, my custom language or the language I'll be using at the end.

My custom language is something like this:


class MyClass inherits object as(abstract);

enum UselessEnum
{
    EnumsHere,
    WorkLikeIn,
    CSharp, //UselessEnum.CSharp
};

struct Vector2
{
    float x, y;
}
struct Vector3 inherits Vector2 // same as declaring x and y before z
{
    float z;
}
struct Vector4 inherits Vector2
{    
    float w;
    
    defaults // can be useful
    {
        w = 1.0f;
    }
}

/* A block comment */
var int myinteger;

// A single line comment
var private string mystring;
var private string[] mystringarray;

/**
 * A documentation block comment.
 */
function MyFunction(bool booleanarg, float floatingpointarg, optional int optionalintegerarg = 0)
{
    myinteger = (booleanarg ? (int) floatingpointarg : (int) floatingpointarg - optionalintegerarg);
}

function string OtherFunction()
{
    if (myinteger < 0 || myinteger >= mystringarray.Length) {
        return mystring;
    }
    
    return mystringarray[myinteger];
}

defaults
{
    mystring = "default string";
    mystringarray = { "zero", "hyper zero", "too", "tree", "floor", "fly V" };
}

It's a mix of UnrealScript, C# and Java. Its rules are not completely defined yet so sometimes it has namespaces and the guts of the classes get wrapped in a body.

This topic is closed to new replies.

Advertisement