Sign in to follow this  
Followers 0
Info

Pseudocode

26 posts in this topic

Do you write your own pseudocode before any project? I'm curious

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Why use pseudo when you can use real code? :unsure:

Edited by Mobius

Share this post


Link to post
Share on other sites

Info,

Often, but not always - it depends a lot on the size and complexity of the project.

I more frequently use pseudo-code to tidy up once the script is running - when I look back and see that I have written some awful "spaghetti" code. Or to clear my mind about a complicated section before I start to code - although this is not always as successful as I might wish! :unsure:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Pseudocode is not a bad thing, but I don't like the syntax we have to use in university. For private purpose I like using a BASIC / AutoIt-based syntax for pseudocode (including classes, namespaces ... if necessary)


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Drawing diagrams is much better IMO, but the way I do it is to write out all the functions just as placeholders and fill them with comments instead.

Edited by Mat

Share this post


Link to post
Share on other sites

Drawing diagrams is much better IMO, but the way I do it is to write out all the functions just as placeholders and fill them with comments instead.

I will pick my own variant of pseudocode any day over a sequence diagram.

Share this post


Link to post
Share on other sites

I will pick my own variant of pseudocode any day over a sequence diagram.

I will pick my own doodles over a sequence diagram any day.

Share this post


Link to post
Share on other sites

I occasionally write what I want in English so I have a framework that I can easily drop into comments and fill in at my leisure.

Share this post


Link to post
Share on other sites

I generally use Pseudocode to describe what I want to do before I get into the detail for a complex method or class. I find I use A3 paper and a pacer more then then the computer to do it though.


Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Share this post


Link to post
Share on other sites

I usually have the full picture of what I want to do and how to do it before I start doing it. Not being a programmer and not coding anything terribly complicated ever, I have had no need to write ideas or pseudo code to paper/solid_media. I run pseudocode in my head :unsure: .

Even though I can imagine situations when writing it down would be more than necessary.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Here's some of my pseudo code (unedited). It's about as obfuscated as it gets.

"(?i)[012345679abcdefgijmnorstux ºØ^#/\^\+\-]"

Root Notes
[CDEFGAB] ([CDEFGAB][#|b]) [DEGAB]bb [CDFGA]X

BAD PATTERNS "s"
#s  bs  as  /s  ms
"(m[^a])"..s  11..s  s..s  im7..s  º7..s  Ø..s

RETURN VALUES "s"
sus

BAD PATTERNS "d"
+d  -d  #d  bd  ºd "(º[^7])"d
Ø..d  g..d  im..d  º..d

RETURN VALUES "d"
ad = Add  º7d = º7dim3  im7d = im7dim3  d = dim /d = /D

BAD PATTERNS "º"
+d  -d  #d  bd  ºd "(º[^7])"d
Ø..d  g..d  im..d  º..d

BAD PATTERNS "a"
#a  ba

RETURN VALUES "a" If letter /[a-g]
/a = /A

GOOD PATTERNS "[ijn]"
mi  in  maj

BAD PATTERNS "i"
mmi

GOOD PATTERNS "o"
no  jo  [\d+-gs(im)]o OR If Stringlen > 4 Return omit

GOOD PATTERNS "u"
au

BAD PATTERNS "u"
mau  º..au  Ø..au [A[º|Ø]]..au must test for a first => not allow this (dd)

GOOD PATTERNS "m"
\Am|mm rm inm im

GOOD PATTERNS "[cefg]"
/"[cefg]"

BAD PATTERNS b alt
bb  [^m]ab #b +b -b Øb

BAD PATTERNS # alt
b#  [^m]a# ## +# -# Ø#

BAD PATTERNS + alt
b+  [^m]a+ #+ ++ -+ Ø+

BAD PATTERNS - alt
b-  [^m]a- #- +- -+ Ø-

It was meant to be part of a heuristic musical chord name recognition system. Although I have abandoned the idea for the time being, looking back at it is confusing. :unsure:

Edited by czardas

Share this post


Link to post
Share on other sites

#12 ·  Posted

Posted Image

Does this count as pseudocode?

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Is that Google Chrome? How did you pin those tabs in the left corner?

Edit: Holy shit there's a pin tab option!>!@#!@#!@#!#$@$5t35 never saw that

Edited by Info

Share this post


Link to post
Share on other sites

#14 ·  Posted

It's not my browser. I just found the screenshot.

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

It's not my browser. I just found the screenshot.

I'd like to hav the complete definition list, but the url is not accessible without an account and I don't feel like creating one.

Why are there no defines in AutoIt. I want to create such code with it, too :unsure:

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

#16 ·  Posted

I'd love to see the defines as well. I've got no idea what the program actually does but it got 100% scores.

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Does this count as pseudocode?

I thought it was real code, but it just made me think of something. If you could define keywords, and introduce syntax, in some way that allowed the code to be easily interpreted as natural language; then you could write something that others would perceive as being a story. Only if you compiled it, would it become a program. If someone asks what you are doing, depending on who asks, you could pretend you are writing a story. I'm still trying to think of a purpose for this crazy idea. :unsure: Edited by czardas

Share this post


Link to post
Share on other sites

#18 ·  Posted

Holy shit there's a pin tab option!>!@#!@#!@#!#$@$5t35 never saw that

I posted about it

Share this post


Link to post
Share on other sites

#19 ·  Posted

That is some really bad code, reminds me of the How to Write Unmaintainable Code article.


Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Share this post


Link to post
Share on other sites

#20 ·  Posted

bo8ster, which code are you referring to?

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