iyeager Posted August 4, 2011 Report Share Posted August 4, 2011 Any developers write (draw?) pseudocode before actually hacking out code? I guess it's the part of me that doesn't want to ignore the text based education I've had, but I've written pseudocode for everything as it helps me think everything out prior to actually writing. However, I can't seem to do it in Labview and I was hoping perhaps some of you could shed some light on how you accomplish the "roughing" out process? -Ian Quote Link to comment
dannyt Posted August 4, 2011 Report Share Posted August 4, 2011 Hi Ian Often I do a bit of pseudocode on a scrap piece of paper before I code something especially if it is a little nested or I want to talk it over with somebody else first. I am not sure I see your problem, after all the whole point of pseudocode is that it is NOT specific to the language you are going to code in. for example initialise power meter initialise signal generator get frequency list for each frequency set signal generator to frequency get power reading from power meter check stop button state if STOP STOP plot graph this can help you plan what you are going to do before you code it up and applies equally well for LabVIEW or C or Python Danny Quote Link to comment
Val Brown Posted August 4, 2011 Report Share Posted August 4, 2011 Or just do that in the BD as your initial "sketch" of what you'll be actually coding and use your pseudocode as the comments... Quote Link to comment
Black Pearl Posted August 4, 2011 Report Share Posted August 4, 2011 Depending on the complexity of the problem, I also start with pseudo-code. On the more detailed level, I keep an uml model together with the code. For state machines, at least a bubble and arrow diagram (using dia, OpenOffice/MSOffice, or simple a paper) will be my starting point. Both get pasted as pictures on the BD. The most 'primitive' form is a simple comment on the BD as Val pointed out. I think this practice is 'good' and even is encouraged by NI for the exams (I think you get points when just commenting 'this vi will save the data' as much as coding it actually). Those design comments also serve as documentation later. Felix Quote Link to comment
Val Brown Posted August 4, 2011 Report Share Posted August 4, 2011 And can be pasted into the documentation area of VI Properties as a "summary" of what the entire VI is meant to accomplish... Quote Link to comment
Daklu Posted August 4, 2011 Report Share Posted August 4, 2011 Pseudocode is too close to implementation for it to be much value to me. I'll do pseudocode in text languages when I'm trying to figure out how to implement an algorithm. In Labview I'm usually working at a higher level than specific algorithms. It's fine for single threaded apps, but I haven't had much luck modelling multi-threaded applications with it. Like Felix I'll sketch out state diagrams or flow chart-ish diagrams during design to clarify my thoughts. Quote Link to comment
SuperS_5 Posted August 4, 2011 Report Share Posted August 4, 2011 I have to agree with Daklu. I only start to use any kind of flow-charts/Pseudocode for very large programs. I usually define these when the program must be split up so that multiple developers can work simultaneously. On one project, I used the state chart module fairly effectively for a single developer. Quote Link to comment
Tim_S Posted August 4, 2011 Report Share Posted August 4, 2011 Any developers write (draw?) pseudocode before actually hacking out code? I have a composition book of descriptions and flowcharts and (pseudo-) state diagrams and UML models and K-maps and ... well, you get the idea. It helps me think through to a good implementation of the system and writing it down ensures that I'll remember (or have a good reference) to what I was thinking a month ago before something interrupted me. Tim Quote Link to comment
Daklu Posted August 4, 2011 Report Share Posted August 4, 2011 a month ago before something interrupted me. Wow... that's quite an interruption. Quote Link to comment
Tim_S Posted August 5, 2011 Report Share Posted August 5, 2011 Wow... that's quite an interruption. Heh, yea, yet it is surprising how many times it's been that long especially when there are multiple projects going on at once. Quote Link to comment
crelf Posted August 16, 2011 Report Share Posted August 16, 2011 I have a composition book of descriptions and flowcharts and (pseudo-) state diagrams and UML models and K-maps and ... well, you get the idea. It helps me think through to a good implementation of the system and writing it down ensures that I'll remember (or have a good reference) to what I was thinking a month ago before something interrupted me. Me too - I have an artist's sketch book, a 2B pencil and a good soft eraser Quote Link to comment
Daryl Posted August 16, 2011 Report Share Posted August 16, 2011 Bar napkin flow charts Quote Link to comment
Cat Posted August 17, 2011 Report Share Posted August 17, 2011 Bar napkin flow charts Ditto! Does dreaming about while loops and event structures count? Quote Link to comment
Wire Warrior Posted August 17, 2011 Report Share Posted August 17, 2011 I do a lot of block diagram generation (using Dia or Visio) for larger/more complex programs. I find it helps me keep track of what needs to be done and what has been done. Also, I find it's a good way to communicate with others especially managers. They like the pretty colors. I fill completed elements with green. Jason Quote Link to comment
Tim_S Posted August 17, 2011 Report Share Posted August 17, 2011 Does dreaming about while loops and event structures count? Only if I can plead the fifth... Quote Link to comment
Black Pearl Posted August 17, 2011 Report Share Posted August 17, 2011 Ditto! Does dreaming about while loops and event structures count? No. Dreamed of broken resistors. Didn't replace a schematic. Wish you better dreams. Felix Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.