Pseudocode
#1

Just wondering, do any of you write pseudocode and/or plan out your code before actually coding it? I have never done this myself, but we were talking about it at college and I'm interested to know. The closest thing I've done to pseudocode is thinking logically about something in detail before coding it.
Reply
#2

Same as you, I think about how one or another process should work in code. I may not think of all the functions and operations - that's the pseudocode part - but I never write up any.
The first implementation of some process may be a bit raw compared to the final code, but is still conformed to the language specifics.
Reply
#3

Sometimes I'll just take a piece of paper and write some things down. This is most frequent when trying to work out some kind of algorithm. Like right now, I have this lying around:
Reply
#4

Before I start coding something, I write how everything should work in a notepad file. I write things like what should happen when the player connects, disconnects, dies, uses spectate mode, enters a vehicle, exits a vehicle, is teleported by an admin.
Having a plan makes me more productive because I don't have to stop coding and think about how stuff should work, rewrite stuff or search for similar stuff created by someone else and end up on *******.
Reply
#5

Quote:
Originally Posted by im
Посмотреть сообщение
Before I start coding something, I write how everything should work in a notepad file. I write things like what should happen when the player connects, disconnects, dies, uses spectate mode, enters a vehicle, exits a vehicle, is teleported by an admin.
Having a plan makes me more productive because I don't have to stop coding and think about how stuff should work, rewrite stuff or search for similar stuff created by someone else and end up on *******.
Pseudocode isn't really about that; that's just planning in general.

Pseudocode is coding something at a really high level first, for example:

Quote:

player enters a vehicle.
get the model of the vehicle.
if it's a hunter
deny entry:
get player's pos
set their pos to those coordinates

becomes
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new model = GetVehicleModel(vehicleid);
    if(model == ???)
    {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        SetPlayerPos(playerid, x, y, z);
    }
    return 1;
}
Although you probably wouldn't write pseudocode for that as it would be a waste of time because it's really simple.
Reply
#6

actually never done this really... When it comes to some more or less complicated things in relation to vectorcalculation and things like that, I sometimes write the mathematics before scripting it, but that's not really it...
Only time that I've done something similar to what you are saying, is when I made a system for any aircraft to shoot a guided or unguided missile, but on that I didn't really plan each step before, just some of them.
Reply
#7

I code everything in my mind before I actually start writing it.

Sometimes I write important checks that is for optimizing the code incase I forget it. So usually the coding starts a lot before I start writing it. Infact If I straightly start it I am like "okay how am I going to get started?"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)