🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Do you write pseudo-code/comments before coding?

Started by
20 comments, last by Waterlimon 8 years, 5 months ago

I do that on paper, I dont have much mind freedom doing this on comments, I like pushing arrows and boxing stuff with outlines, small flying notes about specific stuff, etc.. It gets really graphic sometimes, like drawing the actual game action Im implementing. I have a notebook I use only for that, Its not to take notes, cause I never go back on it (I cant even understand old notes withouth lots of struggle), its just to layout, organize. But its kind fun looking at it..its like Im a mad, cause its really fucked up

paper programming for the win

Advertisement

When writing more complex things, there usually is some high level structure that I need to decide on. So I write a comment with a high level step-by-step list of things the function needs to do.

The benefits for me are:

-I can set the design in stone and assure myself the problem is solved in full. Otherwise I might waste time rethinking the decisions as I cant keep every detail in my mind at once and so it will never form a complete whole unless I prove completeness by writing it down.

-I can first solve the problem at high level (actual problemsolving), then later implement it (boring manual work)

-I can implement only part of the steps, and implement rest later (and be certain that I will know what to do next)

-The steps double as good documentation (either turned into comments with code between them, or remain as a single chunk that explains the high level workings)

I would say a single step represents a piece of code that I will almost certainly want to write in a single go. So how big the steps are, and if I make them at all, depends on how I feel at the moment. If I rougly know what Im doing and dont expect distractions from the specific piece of code, Ill just write it directly. Otherwise, Ill write steps to save the knowledge that will not persist in my mind after splitting the implementation work in multiple chunks (my intentions).

o3o

This topic is closed to new replies.

Advertisement