Jump to content




Pseudocode and you


  • You cannot reply to this topic
5 replies to this topic

#1 Bossman201

  • New Members
  • 92 posts

Posted 09 June 2012 - 01:57 AM

Definition of pseudocode: Pseudocode is an informal high-level description of the operating principle of a computer program or other algorithm.
--Taken directly from wikipedia.

This basically says it's code, but simple as it's not ACTUAL code but rather words meant to make programming or understanding code easier. An example:

Program Code
local x = 0

if x == 0 then
x = 1
end

Pseudocode
if variable x equals 0 then
set x to 1

So how often do you guys use pseudocode? Do you use it at all? Give one example of when pseudocode helped you find a bug or design a part of code. I'll go first:

About a week ago, I had no knowledge of the FileSystemAPI and in-game help just did not help so I did what anyone should do, go to Ask a Pro (a rather nice place where MysticT answers all your questions, seriously, I should just start PM'ing him instead.) He gave me a few examples on how to use the fsAPI and I was on my way to making an updater for BossChat. Soon I ran into a problem, I've never used fsAPI! So I typed out what I wanted my updater to do in pseudocode before painstakingly "translating" into program code. Thus, it was completed. Took maybe an hour because I write code slow and pretty much debug every line as I write it, which probably causes more bugs than if I just wrote the entire block of code.

Spoiler


#2 Orwell

    Self-Destructive

  • Members
  • 1,091 posts

Posted 09 June 2012 - 03:52 AM

For my studies I sometimes need to code projects of several thousands lines of code. I always start with pseudo code then and with UML too. When you're still figuring out your structure, it's a lot less painful to change some sentences that indicate a task rather than changing dozens of lines of code.

#3 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 19 June 2012 - 09:33 PM

i never, i just comment then optimize

#4 kazagistar

  • Members
  • 365 posts

Posted 20 June 2012 - 01:41 PM

Your pseudocode is too low-level for me. If I am going to write pseudocode, it will be at a level of at least a few degrees of magnitude simpler and shorter then the code proper, or I might as well just write the code.

#5 Wukl

  • New Members
  • 1 posts
  • LocationNether lands

Posted 24 June 2012 - 03:01 PM

Nope, never. At least, not when developing a program. I sometimes use pseudocode when talking to my friends but it always changes to real code while explaining.

#6 D3matt

  • Members
  • 830 posts

Posted 26 June 2012 - 02:53 AM

I use pseudocode only for explaining things, generally. I might put something similar in comments in incomplete sections of code, but usually it'll be something like //TODO Make this do that thing.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users