Program Design With Pseudo Code

 admin

Before you write one piece of computer code, you have to know what the program is supposed. The point of pseudocode is to design a program that can be translated.

  1. Program Design With Pseudocode Ebookee

We've got a small programming project coming up. Basically we need a form built that will collect new project & project change information. The information will then be formatted & passed on to various in-house departments as needed (Accounting for billing purposes, Marketing for CRM purposes, etc.) It should work out to be a pretty simple project, and we're probably going to contract it out to a local programmer. Here's the question though - is there some sort of generally accepted format for a 'wireframe' or pseudocode or anything like that that we could provide to the programmer? Basically what we want to be able to do is hand over a few sheets of paper to a programmer and say 'here, this is all the information you'll initially need to code what we're looking for'. I can quickly draw a few mock-ups of what we're looking for, but I'm wondering if there is an accepted standard of sorts that describes all the information a programmer would need to get cracking. Sandeep Gonsalves wrote: Basically what we want to be able to do is hand over a few sheets of paper to a programmer and say 'here, this is all the information you'll initially need to code what we're looking for'.

Never, ever, ever do that. If you have the skills to write the pseudocode then you have no need for the programmer. If you can't write the program yourself then you can't produce useful pseudocode and you are shooting yourself in the foot.

A programmer is the person designing your system. It is the programmer who will write any pseduocode. The entire work of the project is in the low level design.

I think you need to back up. What skills do you have in house and why are you hiring a developer at all? If you can write the pseudocode then you're past the point of hiring someone.

Writing pseudocode before coding is certainly better than just coding without planning, but it's far from being a best practice. Test-driven development is an improvement.

Even better is to analyze the problem domain and design solutions using techniques like user stories, use cases, CRC cards, diagramming, as espoused by methodologies such as Cleanroom, RUP, Lean, Kanban, Agile, etc. Thoroughly understanding the nature of the problem and the components you use to implement the solution is the principle behind best practices.

No, do not pseudo-code first This is too much overhead. You're doing the work of writing the logic with none of the benefits.

I'd suggest any of the following instead:. Prototype in the language you're going to ship with (AKA ). Architecture diagrams w/ code snippets to test assumptions / key designs. Test Driven Development where you write your interfaces/code structure first, followed by tests, followed by implementing the code. All three of these move you directly towards your solution, unlike pseudo-code. Personally I tend to use techniques 1 or 2 depending upon team size.

For smaller (e.g. 5 people or less) teams, prototyping works very well. For larger teams that have multiple groups of developers working in parallel, I've found that documentation produced early by technique 2 works well because it gives you something to discuss early and helps you define component boundaries better. I'm sure TDD would work very well too, but I have yet to work on a team which had committed to this process. Is pseudo-code a suggested approach? For beginning programmers, I say yes. It helps the new programmer learn how to translate a problem into code without worrying about the exact syntax of the language.

This shapes the thought process and can help ingrain useful habits (and I suppose bad habits too). This is why it is used in schools so much. Is it practiced in industry? In my experience, no. No one has the time to rough out the project between the documentation (requirements, specifications, story boards, use cases or whatever else they use) and the actual code. It is generally assumed that sufficient thought has already been put into the problem prior to the green-light to code.

Program Design With Pseudocode Ebookee

At that point, coding the project is more important than adding one more layer of design preparation. Pseudocode can be useful if you're unfamiliar with the language, or if you need to change mental contexts. On the rare occasion that I write pseudocode, it's on paper.

Sometimes just taking your hands off the keyboard and scribbling on paper can help get around a mental block. But as a formalised part of the development process? It's a sporadically helpful tool for individuals. There are better ways to 'know what you're writing before you write it', like:.

defining the contract (pre/post/invariant conditions) of the method before you start. Plants vs zombies full version hacked online. TDD. 1 and 2 combined (writing tests to execute the contract) I'd also suggest that getting any sort of approval before you start writing code is likely to cause much more hassle than it's worth. Design reviews (pre-implementation) can be useful, but they need to be at a higher level than individual algorithms. If you're writing COBOL or C, pseudocode may be helpful because writing the actual code will take much longer, and if you can verify your algorithm/requirements from the pseudocode, you can save some time.

In more modern languages, pseudocode doesn't make as much sense. What would work better is writing method stubs, and filling out the top level logic, and as much detail as necessary to verify the algorithm and requirements, all of this in actual code.

You can then show that code to the Team Lead for approval, and have your real code already started. The only times I've used pseudocode in the last 10 years are on interview when we're working on a whiteboard and the particular language doesn't matter. It's certainly helpful for talking through a process/algorithm in loose terms without getting bogged down with syntax. Writing a C class which has C# properties, just to illustrate the point. It has its' place, but should only be used where needed (it's work that you'll throw away) and certainly not part of a formal process, unless you have ISO-type standards that insist on it. For myself and the people I have worked with for the last few years pseudocode has pretty much turned into not entirely perfect real code. Unless you work with many languages at the same time, most people seem to start thinking in the general pattern of their main language.

I have worked in.net shops for a while so most people's whiteboard scribbles around the office tend to look like vb or c# with some of the punctuation missing. The exercise is still valuable when debating options and such, but the language agnostic bit tends to drift away as you spend more time with a few languages. More and more, pseudocode is written graphically with tools like UML. For instance, try out.

An online tool for creating and publishing simple UML diagrams. It's makes it really easy for you to:. Embed UML diagrams in blogs, emails and wikis. Post UML diagrams in forums and blog comments. Use directly within your web based bug tracking tool. Copy and paste UML diagrams into MS Word documents and Powerpoint presentations.yUML saves you time.

It's designed to for those that like to create small UML diagrams and sketches. Without yUML, creating a UML diagram might involve loading up a UML tool, creating a diagram, giving it a name, fiddling with layout, exporting it to bitmap, and then uploading it online somewhere. YUML doesn't make you do any of that. You started a good discussion. As of me, I used to write pseudo codes when I was learning programming to understand the various loops and algorithms. This was more then one and half decades ago.

ProgramCode

That days, even programming languages were not much powerful. And event driven programming was future. Now with 4GLs and 5GLs, we think in the language itself rather then in plain English.

When we think of a problem, we think in terms of objects and operations. And until it is a complex algo, writing pseudo codes (or P-S-E-U-DO-Codes, just kidding) does not make any sense. Better, represent the solution in a graphic way. There tend to be a couple circumstances where pseudocode tends to get broken out in my work, which is in academia where programming tends to get used as a tool or the 'and now we solve it' filling in the middle of a project:. When the code is going to be more counter-productive to an actual understanding of what's going to happen than pseudo-code will be.

SAS for example, will take up half the whiteboard doing some fairly basic programming tasks. See also C, which some other posters have discussed. With a lot of data analysis and statistics coding, there tends to be a lot of tinkering with the code as results are generated. Pseudocode is somewhat easier to use for 'herein lies a back-and-forth process, if the diagnostic plot doesn't look right, try X'. Students learn lots of different programming languages.

For example, among people I know, a statistics problem might be analyzed in SAS, R or Stata. Something that requires something closer to traditional programming might be done in R, Matlab, C, C, Java, Python.

It really depends on what particular student is implementing the program, and for what purpose. But it's still useful for the Java people and the Python people and the Matlab people to have a joint idea of what the others are doing, and how the approach, rather than the code itself, works. This is not a yes/no kind of question. Rather, one should wonder when to use pseudo-code.

It is important to understand the problem before designing a solution, and it is important to have a clear view of the solution before you implement it. Pseudo-code can be used in any of these steps:. When defining the problem, it's common to write down use cases, sometimes using sequences of actions. When designing a solution. Class diagrams are nice, but they only describe the 'static' part, i.e. For the dynamic part, as soon as you need to deal with a loop and non-trivial data, I find pseudo-code to be the best method available. Graphical alternatives include state machines (good for complex control flow with little data) and dataflow diagrams (good for simple flows with complex data).

When implementing the solution (or just before). Some programming languages are hard to read (think, assembly).

An alternative representation can be valuable in this case. If you are unfamiliar with the languages, it's also worth doing. Pseudo-code that's actually proper code in a high-level language is also used, it's usually called prototyping. In addition to achieving understanding, pseudo-code is also good for communication. If you are wondering if you should use pseudo-code on a regular basis, I am personally against all kinds of rigid rules. This can easily turn into a boring waste of time if used for trivial problems everybody in the team understands.

Using pseudo-code for specifications that you maintain throughout the project's life can also be costly and offer little value.

Comments are closed.